We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 18 days ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
本地化对于嵌入式系统来说可能是一个巨大的痛苦。首先需要考虑一些事情:您的翻译语言是否需要备用字符集?您是否在图形显示器或串行控制台之类的设备上显示文本?
如果翻译的语言集相对较小并且文本字符串集定义良好,您可能会避免使用成熟的翻译库。我继承了一个嵌入式产品,该产品使用一组特定于语言的字符串表。每个文本元素在表中都有一个位置,因此可以按语言然后按元素在 2D 表中查找特定翻译的文本片段。 (这些表存储在本应用程序的 ROM 中。)
如果您采用此方法,则还需要考虑许多其他问题。有些语言可以比英语或多或少地简洁地表达内容。德语就是一个很好的例子——简单的短语可以有类似句子的长度。因此,您应该做好准备应对以下情况:一个文本元素的长度因语言而异。在我继承的应用程序中,这是通过将表格扩展到 3D 来完成的,以便文本元素可以具有多个“行”。当然,文本布局(缩写、句子长度、分页等)也由此延伸。
如果 ROM 空间有限,您可以考虑翻译短语片段,然后根据需要将它们粘贴在一起。这种所谓的字符串合并方法可能很棘手,因为所需的本地化短语可能会笨拙地翻译成片段。换句话说,如果您随意将翻译文本的片段粘贴在一起,请做好“英语”的准备。 Babelfish 等人可以提供帮助 - 但辩护是由母语人士对最终产品进行的良好的国内审查。 (注意:母语人士应代表“普通”方言。)
Localization can be a huge pain in embedded systems. There are a couple of things to first consider: will your translated languages require alternate character sets? Are you displaying text to a graphical display or a something like a serial console?
If the set of translated languages is relatively small and the set of text strings is well-defined, you might avoid a full-blown translation library. I inherited an embedded product that used a set of language-specific string tables. Each text element had a position in the table, thus a particular translated piece of text could be looked up in a 2D table by language, then by element. (These tables were stored in ROM in this application.)
If you go this route, there are a number of other issues to consider. Some languages can express content more or less concisely than English. German is a good example - simple phrases can take on sentence-like lengths. As a result, you should be prepared for the case in which one text element varies substantially in length from language to language. In my inherited app, this was done by extending the table to 3D such that a text element could have more than one "line". Of course, text layout (abbreviations, sentence length, pagination, etc.) extend from this, as well.
If ROM space is limited, you might consider translated snippets of phrases, then pasting them together as needed. This so-called string consolidation approach can be tricky because the desired localized phrase might translate clumsily into snippets. In other words, be prepared for "Engrish" if you paste snippets of translated text together willy-nilly. Babelfish, et al, can help - but the defense is a good in-country review of the end product by a native speaker. (Note: the native speaker should represent an "average" dialect.)
如果您使用 LCD,可能值得查看 EasyGui - www.easygui.com - 因为它有一个翻译模块,可以非常轻松地管理翻译。
您可以查看 PC 上的显示布局并即时更改语言,检查文本是否适合分配的空间。
还有一个翻译插件,它是一个 EXE,您可以将其发送给翻译人员,以便他们可以在屏幕上看到各种语言及其工作原理。
If you're driving a LCD it might be worthwhile looking at EasyGui - www.easygui.com - because it has a translation module making it really easy to manage the translations.
You can look at the display layout on your PC and change languages on the fly, checking that the text fits into the space allocated.
There is also a translation add-on which is an EXE you can send to a translator so they can see the various languages and how it works on the screen.