我正在看一个开源的QT4游戏(http://cockatrice.de),它使用QTranslator进行国际化.然而,每个引用玩家的短语都使用男性代名词("他的手","他的牌组","他做这样的"等等)
我首先考虑解决这个问题,就是用一个设置为正确性别代词的变量替换"他"或"他"的每个实例,但我不知道这会对翻译产生什么影响.但是对于翻译/国际化,这可能会破裂,特别是如果代词的性别影响其他短语.
有没有其他人之前处理过这类问题?是否有可能在至少简单的语言(如英语,在这种情况下)中分离出代词和短语?翻译文件是否必须包含每个性别代词的每个短语的副本?(至少翻倍翻译文件的大小)?
一些示例代码来自当前设置的方式:
呼叫来源:
case CaseNominative: return hisOwn ? tr("his hand", "nominative") : tr("%1's hand", "nominative").arg(ownerName);
case CaseGenitive: return hisOwn ? tr("of his hand", "genitive") : tr("of %1's hand", "genitive").arg(ownerName);
case CaseAccusative: return hisOwn ? tr("his hand", "accusative") : tr("%1's hand", "accusative").arg(ownerName);
Run Code Online (Sandbox Code Playgroud)
英文翻译文件:
<message>
<location filename="../src/cardzone.cpp" line="51"/>
<source>his hand</source>
<comment>nominative</comment>
<translation type="unfinished"></translation>
</message>
Run Code Online (Sandbox Code Playgroud)