【发布时间】:2011-03-16 01:34:48
【问题描述】:
我正在研究一款开源 QT4 游戏 (http://cockatrice.de),它使用 QTranslator 进行国际化。但是,每个提及玩家的短语都使用男性代词(“他的手”、“他的套牌”、“他做某事”等)
我解决此问题的第一个想法是将“his”或“he”的每个实例替换为设置为正确性别代词的变量,但我不知道这会如何影响翻译。但是对于翻译/国际化,这可能会中断,尤其是当代词的性别影响到短语的其余部分时。
以前有没有其他人处理过这类问题?是否可以至少用简单的语言(如英语,在这种情况下)中分离出代词和短语?翻译文件是否必须包含每个性别代词的每个短语的副本? (至少翻倍翻译文件的大小)?
当前设置的一些示例代码:
调用来源:
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);
英文翻译文件:
<message>
<location filename="../src/cardzone.cpp" line="51"/>
<source>his hand</source>
<comment>nominative</comment>
<translation type="unfinished"></translation>
</message>
【问题讨论】:
-
请注意,在某些语言中,性别取决于拥有的对象而不是所有者。法语就是这样一种语言。
标签: c++ qt internationalization qt4