i18n 应用程序的测试工具

发布于 2024-07-13 22:38:30 字数 87 浏览 4 评论 0原文

对于测试国际化/本地化应用程序的工具有什么建议吗? 该应用程序的用户界面是通过网络界面。 本地化字符串存储在 xml 文件中。

此致

Any suggestion for a tool to test internationalized/ localized application? The application's UI is through web interface. The localized strings are stored in xml files.

Best regards

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

微凉徒眸意 2024-07-20 22:38:30

我不确定您到底想测试什么,但对于桌面应用程序,我正在研究一些可在菜单中使用的可翻译字符串。 这些字符串可能包含键盘快捷键,例如:“Open\tCtrl-O”。 我们需要包含键盘快捷键,因为 Ctrl-O 可能需要翻译为另一种语言的其他键盘快捷键。 然而,一些翻译者会(当然不是故意的)引入错误。 例如,它们会在 \t 和 Ctrl-O 之间包含一个空格,或者它们会翻译“Ctrl”。 我们的解决方案是创建少量单元测试,并对每种语言的每个英语字符串翻译的字符串组合运行这些测试。 因此,这是很多测试(在我们的例子中超过 50000 个),但它们运行得非常快(10 秒左右),因为它主要只是字符串比较。

我们测试以下内容:

  • \t 和键盘快捷键之间没有空格,
  • 如果英文字符串中有键盘快捷键,翻译中也应该有一个,
  • 如果英文字符串没有换行符,翻译也不应该有,
  • 如果英文字符串以“...”结尾(表示打开对话框的菜单项),则翻译也应以“...”结尾。

我希望这仍然有用,因为您正在谈论 Web 应用程序,而我的经验是桌面应用程序。

I'm not sure what exactly you want to test, but for a desktop application I'm working on some of the translatable strings are for use in menu's. These strings may contain keyboard shortcuts, e.g.: "Open\tCtrl-O". We need to include the keyboard shortcut since Ctrl-O might need to be translated to some other keyboard shortcut in another language. However, some translators would (not on purpose of course) introduce bugs. For example, they would include a space between \t and Ctrl-O or they would translate the "Ctrl". Our solution was to create a small number of unit tests and run these on every English string-translated string combination for every language. So that's a lot of tests (over 50000 in our case) but they run very fast (10 seconds or so) since it's mostly just string comparisons.

We test for things like:

  • No spaces between \t and the keyboard shortcut,
  • If there is a keyboard shortcut in the English string, there should be one in the translation as well,
  • If the English string has no line breaks, neither should the translation,
  • If the English string ends with '...' (signalling a menu item that opens a dialog) the translation should end with '...' as well.

I hope this is still useful as you are talking about a web application and my experience is with a desktop application.

黯然#的苍凉 2024-07-20 22:38:30

“测试”i18n 应用程序的一种方法是确保您正在处理所有特定于语言环境的行为和翻译的资源。 这通常需要制定质量保证计划。

您必须执行的步骤之一是确保根据每个区域设置正确完成货币、数字、日期、时间或其他度量单位的格式设置。 据我所知,没有特定的工具可以检查这一点。

另一个方面是确保所有用户可见的字符串确实不在代码和资源包中,无论是哪种类型(从 .properties 到 .po 到 .xml ...选择范围很大)。 一些 QA 团队设置了“伪本地化”策略,这意味着创建的资源包中包含原始字符串,但带有前缀和后缀“特殊”字符,例如日语平假名。 然后使用伪语言环境调用应用程序会显示带有前缀和后缀的所有字符串,同时允许开发人员查看缺少的内容(没有平假名的字符串)以及布局管理的行为方式(裁剪不应裁剪的文本)。

有很多工具可以做到这一点,例如 Lingoport 的 Globalyzer,它通常处理 i18n,伪本地化是其中的一部分(在菜单中,它实际上称为“PseudoJudo”)。 它允许将文本增长给定的百分比,仅将前缀或仅后缀或两者都附加到原始字符串。

希望这至少部分地回答了您的问题。

One way to 'test' an i18n application is to make sure you are addressing all the locale specific behaviors and translated resources. This usually requires setting up a QA plan.

Among the steps you'll have to perform is making sure the formatting of currency, numbers, dates, times or other measurements are done properly, based on each locale. There is not specific tool that I know of to check for that.

Another aspect is to make sure all the user visible strings are indeed out of the code and in the resource bundles, whichever type that may be (from .properties to .po to .xml ... the choice is large). Some QA team set up a 'pseudo-localization' strategy, meaning a resource bundle is created with the original strings in it but with prefix and suffix 'special' characters, such as Japanese Hiragana's for instance. Then invoking the application with the pseudo locale shows all the strings with the prefix and suffix while allowing the developer to see what is missing (those strings without the hiragana's) and how the layout management is behaving (cropping text which it should not).

There are a number of tools to do that, like Globalyzer from Lingoport which deals with i18n in general and the pseudo localization is one part of it (in the menus, it's actually called "PseudoJudo"). It allows to grow the text by a given percentage, have only the prefix or only the suffix or both appended to the original string.

Hope that answers your question, at least partly.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文