简体   繁体   English

如何在Qt的QTranslator中翻译性别代词

[英]How to translate gendered pronouns in Qt's QTranslator

I'm looking at an open source QT4 game ( http://cockatrice.de ), and it uses QTranslator for internationalization. 我正在看一个开源的QT4游戏( http://cockatrice.de ),它使用QTranslator进行国际化。 However, every phrase that refers to the player uses a masculine pronoun ("his hand", "his deck", "he does such-and-such", etc.) 然而,每个引用玩家的短语都使用男性代名词(“他的手”,“他的牌组”,“他做这样的”等等)

My first thought for fixing this would be to just replace every instance of "his" or "he" with a variable that is set to the correct gendered pronoun, but I don't know how this would affect the translations. 我首先考虑解决这个问题,就是用一个设置为正确性别代词的变量替换“他”或“他”的每个实例,但我不知道这会对翻译产生什么影响。 But for translating/internationalization, this might break, especially if the pronoun's gender affects the rest of the phrase. 但是对于翻译/国际化,这可能会破裂,特别是如果代词的性别影响其他短语。

Has anyone else worked with this sort of problem before? 有没有其他人之前处理过这类问题? Is it possible to separate out the pronoun and the phrase in at least the easy languages (like English, in this case)? 是否有可能在至少简单的语言(如英语,在这种情况下)中分离出代词和短语? will the translation file have to include a copy of each phrase for each gendered pronoun? 翻译文件是否必须包含每个性别代词的每个短语的副本? (doubling, at least, the size of the translation file)? (至少翻倍翻译文件的大小)?

some sample code from how it's currently set up: 一些示例代码来自当前设置的方式:

calling source: 呼叫来源:

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);

english translation file: 英文翻译文件:

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

maybe split: 也许拆分:

tr("his hand")

into: 成:

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

and then translate "his", "her", "its", ... seperately. 然后单独翻译“他的”,“她的”,“它的”...... but there will be some problems in languages like italian, where there are personal suffixes... 但是像意大利语这样的语言会有一些问题,那里有个人后缀......

alternative: 替代方案:

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

and translate them all. 并将它们全部翻译。

EDIT: the second alternative shown is also used in many other games (like oolite, ...), because it's the only way to be sure there will not be problems (like suffixes instead of prefixes...) in other languages. 编辑:显示的第二个替代方案也用于许多其他游戏(如oolite,...),因为这是确保在其他语言中不会出现问题(如后缀而不是前缀...)的唯一方法。

btw what would Konami or Nintendo say when they'll realize you are creating an open source Yu-Gi-Oh!/Pokemon playing field? 顺便说一句Konami或任天堂会说什么,当他们意识到你正在创造一个开源的Yu-Gi-Oh!/ Pokemon游戏场? nobody will buy their cards :-P 没有人会买他们的卡:-P

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM