Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use BCP 47 compatible languages codes for all locales #5723

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

absidue
Copy link
Member

@absidue absidue commented Sep 21, 2024

Use BCP 47 compatible languages codes for all locales

Pull Request Type

  • Refactoring

Description

FreeTube has 3 locales that use underscores in their codes (en_GB, es_AR and nb_NO), the rest of them use hyphens. As all web APIs expect BCP 47 compatible language codes, we end up having to replace the underscores with hyphens in many places in the code. This pull request converts those 3 locales to use hyphens, that allows us to cleanup all the code that has to handle both underscores and hyphens. It also includes a one time migration for users that are currently using those locales.

⚠️ The only thing I'm not sure about is how weblate will handle the files being renamed.

Testing

  1. Before switching to this pull request: Set your locale to English (UK)
  2. Start FreeTube with this pull request
  3. Check that everything is still displayed correctly (if it is, then the migration worked)

Desktop

  • OS: Windows
  • OS Version: 10
  • FreeTube version: 9ca2c74

@github-actions github-actions bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Sep 21, 2024
@FreeTubeBot FreeTubeBot enabled auto-merge (squash) September 21, 2024 17:36
@absidue absidue added the PR: low priority For pull requests that don't require a fast review. e.g. code cleanup label Sep 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: low priority For pull requests that don't require a fast review. e.g. code cleanup PR: waiting for review For PRs that are complete, tested, and ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants