Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do people use plain english as translation placeholders?

This may be a stupid question, but here goes.

I've seen several projects using some translation library (e.g. gettext) working with plain english placeholders. So for example:

_("Please enter your name"); 

instead of abstract placeholders (which has always been my instinctive preference)

_("error_please_enter_name"); 

I have seen various recommendations on SO to work with the former method, but I don't understand why. What I don't get is what do you do if you need to change the english wording? Because if the actual text is used as the key for all existing translations, you would have to edit all the translations, too, and change each key. Or don't you?

Isn't that awfully cumbersome? Why is this the industry standard?

It's definitely not proper normalization to do it this way. Are there massive advantages to this method that I'm not seeing?

like image 495
Pekka Avatar asked Nov 20 '10 13:11

Pekka


People also ask

What is a placeholder in translation?

It is a character, word, or string of characters that temporarily takes the place of the final data. It may also indicate where a programmer needs to add specific code that they have not yet written. As a result, placeholders need to appear in the translated text even if they are moved around for the sake of syntax.

What is the purpose of translation in English?

Most common definitions would agree that the purpose of translation is to “convey the original tone and intent of a message, taking into account cultural and regional differences between source and target languages” (Globalization and Localization Association), but how does this reflect the relationship between ...

Why translation is important in a world where English is everywhere?

Translation is Important Because Not Everyone Speaks EnglishAnd just because a person can speak some English, that doesn't mean they can speak it well enough to cope in all situations.

What is the most commonly used translation?

Mandarin translation Given its position as the most commonly spoken language in the world, with some 955 million native speakers, it is perhaps unsurprising that Mandarin is the most common target language.


2 Answers

Yes, you have to alter the existing translation files, and that is a good thing.

If you change the English wording, the translations probably need to change, too. Even if they don't, you need someone who speaks the other language to check.

You prep a new version, and part of the QA process is checking the translations. If the English wording changed and nobody checked the translation, it'll stick out like a sore thumb and it'll get fixed.

like image 54
Nicholas Knight Avatar answered Sep 19 '22 13:09

Nicholas Knight


  1. The main language is already existent: you don't need to translate it.
  2. Translators have better context with a real sentence than vague placeholders.
  3. The placeholders are just the keys, it's still possible to change the original language by creating a translation for it. Because when the translation doesn't exists, it uses the placeholder as the translated text.
like image 23
Savageman Avatar answered Sep 20 '22 13:09

Savageman