readthedocs / readthedocs.org

The source code that powers readthedocs.org
https://readthedocs.org/
MIT License
8.05k stars 3.59k forks source link

Add custom placeholders to Transifex #11660

Open rffontenelle opened 1 month ago

rffontenelle commented 1 month ago

What's the problem this feature will solve?

Prevent translators from translating words/expressions that were expected by developers/maintainers to be kept in English.

Describe the solution you'd like

Add custom placeholders to Translation Checks for terms that should be kept in English in the translation.

They can be set in:

  1. https://app.transifex.com/readthedocs/settings/validations/
  2. PO File (.po, .pot) checks > Manage placeholders (last item)
  3. set starting pattern and end pattern for each placeholders, and save
  4. Browse the translation strings of any language in the readthedocs project (UI)

Great candidates to be placeholders are:

Alternative solutions

Do nothing, and translators will keep being able to translate variables in the translation strings.

Additional context

See Setting Translation Checks in Transifex docs.

Custom placeholders are added at organization level, which means it applies for the UI (readthedocs project), docs (readthedocs-docs project) and theme (sphinx-rtd-theme project).

If the translator doesn't keep the placeholder text in their translation, a ⚠️ warning banner will be displayed stating that fact. The translation is still saved, though.

humitos commented 1 month ago

Thanks for opening this issue. This would be a great validation 👍