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

Merged
merged 1 commit into from
Sep 23, 2024

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
@FreeTubeBot FreeTubeBot merged commit 84ee64c into FreeTubeApp:development Sep 23, 2024
5 checks passed
@github-actions github-actions bot removed the PR: waiting for review For PRs that are complete, tested, and ready for review label Sep 23, 2024
@absidue absidue deleted the fix-locales branch September 23, 2024 20:09
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants