Don't translate interpolation keys

AI-generated summary

Don’t translate interpolation keys is a crucial reminder for translators. neil pointed out that translating variables in English strings can break translations and the build, as seen in the Urdu translations.

icaria36 and neil discussed the possibility of declaring these variables to prevent translation, but gerhard noted that Transifex only detects %{placeholder} format, not {{placeholder}}.

gerhard warned against replacing the percent sign (%) with translated versions, and zogstrip suggested enforcing consistent formatting or automatic replacement.

However, gerhard discovered Transifex’s Translation Checks feature, which has been configured to prevent issues with missing or translated interpolation keys. Translators will now receive error messages when attempting to save invalid translations.

This is a friendly reminder that variables in the english strings should not be translated since they will break the translations and break the build.

This is currently a problem in the Urdu translations. One example:

Anyone on the Urdu team, can you please spread the word?

14 Likes

Is there a way to declare these variables as such, so Transifex doesn’t even allow their translation?

1 Like

That would be ideal. I don’t know of a way to do that in Transifex.

Unless you enable “raw editor mode”, Transifex detects %{placeholder}, but unfortunately not {{placeholder}}. I have no idea why we use different placeholder formats. :thinking:

image

5 Likes

Maybe we should enforce this? Or automatically replace with the format recognized by Transifex?

6 Likes

And please do not replace the percent sign ( % ) with a translated version such as ٪

Transifex allows you to insert the placeholder into your translation by clicking on the placeholder (e. g. %{count} in the following example.


The Urdu translations currently have that problem.

8 Likes

Transifex has this nice little feature called Translation Checks – we just didn’t know about it.

Well, I configured it today, so there shouldn’t be any problems with missing or translated interpolation keys anymore. You will see an error message when you try to save an invalid translation.

10 Likes