在几年之内使桌面应用程序国际化...我们现在应该怎么做? [英] Internationalizing Desktop App within a couple years... What should we do now?

查看:78
本文介绍了在几年之内使桌面应用程序国际化...我们现在应该怎么做?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我们确信我们将把我们的产品推向国际,并最终需要将其国际化.您会建议我们在进行多少国际化的工作?

So we are sure that we will be taking our product internationally and will eventually need to internationalize it. How much internationalizing would you recommend we do as we go along?

我想换句话说,现在有什么国际化现在很容易,但是如果我们让代码库成熟,会变得更糟,而如果我们选择现在就开始这样做的话,这不会让我们感到很慢吗?

I guess in other words, is there any internationalization that is easy now but can be much worse if we let the code base mature and that won't slow us down very much if we choose to start doing it now?

使用的技术:C#,WPF,WinForms

Tech used: C#, WPF, WinForms

推荐答案

在编写代码库本身中的所有字符串之前,请立即进行准备.

Prepare it now, before you write all the strings in the codebase itself.

现在以后的一切都为时已晚.现在或永远不会!

Everything after now will be too late. It's now or never!

的确,现在要做好准备,需要付出一些额外的努力,但是如果不这样做,最终会变得更加昂贵.

It's true that it is a bit of extra effort to prepare well now, but not doing it will end up being a lot more expensive.

如果您不遵循下面链接中的所有指南,请至少注意摘要的第1,2和7点,这些点现在很便宜,而这是我以后的最大痛苦.

If you won't follow all the guidelines in the links below, at least heed points 1,2 and 7 of the summary which are very cheap to do now and which cause the most pain afterwards in my experience.

查看这些指南,并亲自了解为什么现在开始并准备好一切都更好.

Check these guidelines and see for yourself why it's better to start now and get everything prepared.

  1. 开发世界就绪的应用程序

开发适用于世界的应用程序的最佳做法

少量摘录:

  1. 将所有可本地化的资源移动到单独的仅资源DLL中.可本地化的资源包括用户界面元素,例如字符串,错误消息,对话框,菜单和嵌入式对象资源. (将资源移至DLL会很痛苦)
  2. 请勿对字符串或用户界面资源进行硬编码. (如果您不准备的话,您会知道您将对字符串进行硬编码)
  3. 请勿将不可本地化的资源放入纯资源DLL中.这会给翻译人员造成混乱.
  4. 请勿使用在运行时根据串联短语构建的复合字符串.复合字符串很难本地化,因为它们通常假定英语语法顺序并不适用于所有语言. (在界面设计之后,更改短语会变得更加困难)
  5. 避免使用诸如空文件夹"之类的歧义结构,在此结构中,根据字符串组成部分的语法作用,可以对字符串进行不同的翻译.例如,空"可以是动词,也可以是形容词,这可能导致不同的翻译,例如意大利语或法语. (同一期)
  6. 避免在应用程序中使用包含文本的图像和图标.它们本地化很昂贵. (使用在图像上渲染的文本)
  7. 在用户界面中为扩展字符串的长度留出足够的空间.在某些语言中,短语可能需要50-75%以上的空间. (同一问题,如果您现在不计划的话,重新设计会更昂贵)
  8. 使用System.Resources.ResourceManager类根据区域性检索资源.
  9. 使用Microsoft Visual Studio .NET创建Windows窗体对话框,以便可以使用Windows窗体资源编辑器(Winres.exe)对其进行本地化.请勿手动编写Windows窗体对话框的代码.
  1. Move all localizable resources to separate resource-only DLLs. Localizable resources include user interface elements such as strings, error messages, dialog boxes, menus, and embedded object resources. (Moving the resources to a DLL afterwards will be a pain)
  2. Do not hardcode strings or user interface resources. (If you don't prepare, you know you will hardcode strings)
  3. Do not put nonlocalizable resources into the resource-only DLLs. This causes confusion for translators.
  4. Do not use composite strings that are built at run time from concatenated phrases. Composite strings are difficult to localize because they often assume an English grammatical order that does not apply to all languages. (After the interface design, changing phrases gets harder)
  5. Avoid ambiguous constructs such as "Empty Folder" where the strings can be translated differently depending on the grammatical roles of the strings' components. For example, "empty" can be either a verb or an adjective, and this can lead to different translations in languages such as Italian or French. (Same issue)
  6. Avoid using images and icons that contain text in your application. They are expensive to localize. (Use text rendered over the image)
  7. Allow plenty of room for the length of strings to expand in the user interface. In some languages, phrases can require 50-75 percent more space. (Same issue, if you don't plan for it now, redesign is more expensive)
  8. Use the System.Resources.ResourceManager class to retrieve resources based on culture.
  9. Use Microsoft Visual Studio .NET to create Windows Forms dialog boxes, so they can be localized using the Windows Forms Resource Editor (Winres.exe). Do not code Windows Forms dialog boxes by hand.

这篇关于在几年之内使桌面应用程序国际化...我们现在应该怎么做?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆