How to find and amend un-translated strings


(Claas Aug.) #1

In this case, you can add the missing translations yourself on Transifex, which is an independent online platform/service used by the Discourse team to manage translations.

For example, the current status for Persion is as follows:

In general, there are a few reasons for an English label in a localized instance:

  1. The string is translatable and translated, just not yet in the version you’re running, or
  2. The string is translatable, but just not yet translated in your language, or
  3. The string is not yet translatable (but rather hardcoded in the code), or
  4. The string is not translatable within the scope of Discourse core (e.g. if it comes from a plug-in).

In order to investigate this, you can…

  1. Go to Admin / Customize / Text Content in your Discourse instance and search for the untranslated string, and if you find it, it’s translatable and just not yet translated (or at least not in the version you’re running),

  2. Go to Transifex (for which you will need to sign-up and probably apply to join the team there), and if you find the string untranslated, go ahead and translate it.

  3. Go to GitHub and search for the string (which will search both in the code and in the translations):

  4. Check out the Discourse code and search for the string (assuming you are using Linux or you have git for Windows installed):

$ git clone https://github.com/discourse/discourse.git
$ cd discourse
$ grep -R "foobar" .

I have to say this was a rather special case, but basically I looked for “Berechtigungen” (which I saw in the screenshot and is German for “Permissions”) in Transifex. This lead me to the I18n key admin_js.admin.user.permissions (see below). Then I looked for the key in the code and found it (without the prefix admin_js) here, from which the lines referenced above weren’t far away.


User administration: some boolean values not translated
(Pad Pors) #2

Many thanks Class for the detailed and complete answer, :heart_eyes:

I’ve gone several times to transifex and couldn’t use it, I’m not sure why. I’ll try it again as it seems to be the best way.


(Claas Aug.) #3

It definitely has some nits and it can be a struggle at times. Here’s my workflow:

  1. Select “All Resources”
  2. Choose “Untranslated”
  3. Pick the first one, focus Type your translation here, type the translation and press TAB to save and go to the next untranslated key.

Nits:

  • The search field is very bad from a usability viewpoint.
  • Keyboard support is neither elaborate nor documented, e.g. Copy source string and entering I18n keys with options (one/other) don’t work without using the mouse (afaik) and you may loose the input to a one option.
  • Occasionally, saving the current string fails. Therefore I tend to always translate long strings in a separate, local editor.

Feel free to ask questions in #dev:translations if it doesn’t work. :slight_smile:


(Pad Pors) #4

this was the main reason, as I tried again now and I couldn’t find the string I was looking for until the fifth trial!

Now there’s even more important thing: in Persian I looked for the term group with no translation, in the client side. here is what I found:

as shown above, there’s at least one suggested translation for each string. though they are good translations, they’re not accepted. how can I help to those translations to get accepted?

Even a bad translation in transifix is better than no-translation; as when there’s no translation there, one can not customize the text in the admin panel.


(Claas Aug.) #5

As far as I see, you should be able to apply the suggestion with the copy symbol on the right. A suggestion usually does not mean that it’s not accepted, but rather that the string had already been translated before, but with a different key. Especially when a key changes (e.g. to fix a typo in the key itself or to improve the structure), this means that a previously translated key can appear untranslated again.


(Pad Pors) #6

here is the result for transifex, admin panel, and final result of the term for groups in the menu items:

1- in the transifex project, it has been translated:

2- in the admin panel, I translate it myself as well:

3- and finally in the menu it’s still not translated:

and since this happens several places in the forum, it’s becoming little bit ugly :frowning:

Do you have any idea what I can do ?


#7

That is a weird problem that is being discussed eg here:


(Erlend Sogge Heggen) #9

Just musing out loud here, but I wonder if we could do a better job of onboarding translators by including a call-to-action in any un-translated string.

Easy way

On any un-translated string, link here and to the main tutorial.

Advanced way

If at all possible, it’d be so cool if an untranslated string on Discourse could expose a “translate me” link pointing directly to its untranslated resource on Transifex, similar to how some doc sites invite users to suggest edits on GitHub: