现在,最佳操作方式是从一个DSL生成代码,它要比使用像UML 这样的目标语言更简便。
Nowadays, it is best practice to generate code from a DSL, which is simpler to use than a general purpose language like UML.
每次添加或更改字符串时,都应当重新生成消息文件,否则将在目标语言环境显示未翻译的新文本。
Every time strings are added or changed, the message file should be regenerated, or the new text will appear untranslated in the target locales.
在从事翻译的过程中,源语言和目标语言常常像是在玩儿“拔河”游戏,生成一种持续的“拉力”,也许会充实我们的工作——也许相反,这取决于我们如何能很好地把握它。
During translation, source and target language play a game of tug of war, creating an unceasing tension that may enrich our work-or not, depending on how well we can handle it.
这一功能使理解和维护生成器更加容易,而且可以将生成器重定位到其他目标语言。
This functionality makes understanding and maintaining the generator easier, and also makes it possible to repurpose the generator for other language targets.
尽管代码生成器可以理解一点儿目标语言的知识,但是它们通常都不是完整的语法分析器,不重新编写一个完整的编译器是无法全面考虑目标语言的。
While code generators understand a little bit about the target language, they are usually not full parsers and cannot take the target language into account without rewriting a complete compiler.
要生成成功的代码则需要对目标语言(这里是php)和代码生成语言(该例中即XSLT)有充分的了解。
Successful code generation requires both an understanding of the target language (in this case, PHP) and the code generation language (in this case, XSLT).
要生成成功的代码则需要对目标语言(这里是php)和代码生成语言(该例中即XSLT)有充分的了解。
Successful code generation requires both an understanding of the target language (in this case, PHP) and the code generation language (in this case, XSLT).
应用推荐