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

Improve broken translation strings #4944

Open
1 of 2 tasks
p2edwards opened this issue May 23, 2024 · 1 comment
Open
1 of 2 tasks

Improve broken translation strings #4944

p2edwards opened this issue May 23, 2024 · 1 comment
Assignees

Comments

@p2edwards
Copy link
Contributor

p2edwards commented May 23, 2024

Description

Ideally, each string we send to Transifex is a cohesive translatable unit, with enough context to translate it well.

We've fallen short on this ideal in a few places. Collect related PR's under this issue.

Things to improve

  1. Fix strings that were missing from the build output entirely for some reason1
  2. Replace fragments like t('This is ') + isNot ? t('NOT') : t('') + t(' how we do it') with proper templating.2
  3. Follow established or predictable conventions when it comes to field interpolation, links, or formatting; don't use HTML tags in translated strings.3
  4. Stretch goal: Adopt a convention for providing more context in translations — visible to translators in transifex, but discarded from UI)4

Upcoming PR's

Footnotes

  1. See "fix string concatenation", Allow concat in frontend t()-string sources #4945

  2. Fragments like this arrive all out of order in Transifex and are not grammatically friendly.
    You can find instances of this by sorting the keys in extracted-strings.json and manually reading top to bottom, or applying regex.
    We're tracking some of these internally here (notion) and here (chat)

  3. Related: Standardize placeholders in translated strings #3651

  4. See "Context in translations": xref (chat)

@p2edwards p2edwards self-assigned this May 23, 2024
@p2edwards
Copy link
Contributor Author

Detecting issues sooner

Maybe we should consider un-ignoring extracted-strings.json at some point (at least on the frontend.)1 I know it's abnormal to check in generated assets or build artifacts,2 but one upside is we'd be more likely to spot potential translation issues earlier, like during code review.

Footnotes

  1. If we do this to make spot-checking easier then we should sort the output by key, and maybe simplify from json {"key":"key"} to array ["key"] format, or plaintext, one per line with escaped \n's.

  2. This might be a different idea but it sounds related: Put the language MO files inside this repository (?) #4801

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

No branches or pull requests

1 participant