How to translate gender pronouns in Qt QTranslator

I am watching the open source QT4 game ( http://cockatrice.de ) and it uses QTranslator for internationalization. However, each phrase relating to the player uses a masculine pronoun ("his hand", "his deck", "he does such and such," etc.).

My first thought on how to fix this is to simply replace each instance of "my" or "he" with a variable that is set to the correct pronoun place, but I do not know how this will affect translations. But for translation / internationalization, this can break down, especially if the vocabulary affects the rest of the phrase.

Has anyone else worked with similar issues before? Is it possible to separate a pronoun and a phrase in at least simple languages ​​(for example, in English)? Will the translation file include a copy of each phrase for each pronoun? (doubling at least the size of the translation file)?

some sample code from how it is currently configured:

calling source:

case CaseNominative: return hisOwn ? tr("his hand", "nominative") : tr("%1 hand", "nominative").arg(ownerName); case CaseGenitive: return hisOwn ? tr("of his hand", "genitive") : tr("of %1 hand", "genitive").arg(ownerName); case CaseAccusative: return hisOwn ? tr("his hand", "accusative") : tr("%1 hand", "accusative").arg(ownerName); 

English translation file:

  <message> <location filename="../src/cardzone.cpp" line="51"/> <source>his hand</source> <comment>nominative</comment> <translation type="unfinished"></translation> </message> 
+7
source share
1 answer

possible split:

 tr("his hand") 

in

 tr("his").append("hand") 

and then translate "him," her, "his," ... separately. but there will be some problems in languages ​​such as Italian, where there are personal suffixes ...

alternative:

 tr("his hand"); tr("her hand"); //... 

and translate them all.

EDIT: The second alternative is also shown in many other games (for example, oolite, ...), because this is the only way to make sure that there will be no problems (for example, suffixes instead of prefixes ...) in other languages.

btw, what will Konami or Nintendo say when they realize that you are creating an open source playing field Yu-Gi-Oh! / Pokemon? nobody will buy their cards: -P

+1
source

All Articles