Skip to content

Fix some template strings in locale files, add script to find problematic values #7519

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

Merged

Conversation

ChunkyProgrammer
Copy link
Member

@ChunkyProgrammer ChunkyProgrammer commented Jun 5, 2025

Pull Request Type

  • Bugfix

Description

I ended up updating some code that I wrote for Invidious to find locales that use incorrect template strings/are missing template strings. iv-org/invidious#1951 (comment)

This should make finding issues with other locales a lot easier

Ideally we would upstream some of this functionality into vue-i18n-eslint

Screenshots

image

Testing

  • yarn run checkforbadtemplates should create a locale-errors.json file at the root of the project as well as log the errors to the console. I didn't fix every issue as some of them aren't that straightforward without knowing the language that is being translated.

Desktop

  • OS: Fedora Linux
  • OS Version: 42
  • FreeTube version: latest nightly

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) June 5, 2025 21:22
@github-actions github-actions bot added PR: dependencies Pull requests that update a dependency file PR: waiting for review For PRs that are complete, tested, and ready for review labels Jun 5, 2025
PikachuEXE
PikachuEXE previously approved these changes Jun 6, 2025
@ChunkyProgrammer ChunkyProgrammer added PR: changes requested and removed PR: dependencies Pull requests that update a dependency file PR: waiting for review For PRs that are complete, tested, and ready for review labels Jun 8, 2025
@ChunkyProgrammer ChunkyProgrammer added PR: waiting for review For PRs that are complete, tested, and ready for review and removed PR: changes requested labels Jun 17, 2025
@ChunkyProgrammer ChunkyProgrammer force-pushed the fix-some-template-strings branch from 2f68245 to 171be96 Compare June 17, 2025 11:54
absidue
absidue previously approved these changes Jun 17, 2025
@PikachuEXE
Copy link
Collaborator

Wondering if duplicate variables can/should be ignored
e.g.

  • This setting is overridden by the app-wide "{appWideSetting}" setting, in the "{subsection}" section of the "{settingsSection}"
  • 此设置被应用级的 "{appWideSetting}" 设置所覆盖,"{appWideSetting}" 位于 "{subsection}" 部分,该部分在 "{settingsSection}" 中
    {appWideSetting} repeated twice but valid (I can read this locale
    image

We should only need to validate if the key is in the string, not how many times the key is in the string
@FreeTubeBot FreeTubeBot merged commit 77109c8 into FreeTubeApp:development Jun 27, 2025
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 Jun 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants