Internationalization in your projects

后端 未结 11 1335
借酒劲吻你
借酒劲吻你 2020-12-12 10:39

How have you implemented Internationalization (i18n) in actual projects you\'ve worked on?

I took an interest in making software cross-cultural after I read the famo

相关标签:
11条回答
  • 2020-12-12 11:17

    I worked on a project for my previous employer that used .NET, and there was a built in .resx format we used. We basically had a file that had all translations in the .resx file, and then multiple files with different translations. The consequence of this is that you have to be very diligent about ensuring that all strings visible in the application are stored in the .resx, and anytime one is changed you have to update all languages you support.

    If you get lazy and don't notify the people in charge of translations, or you embed strings without going through your localization system, it will be a nightmare to try and fix it later. Similarly, if localization is an afterthought, it will be very difficult to put in place. Bottom line, if you don't have all visible strings stored externally in a standard place, it will be very difficult to find all that need to be localized.

    One other note, very strictly avoid concatenating visible strings directly, such as

    String message = "The " + item + " is on sale!";
    

    Instead, you must use something like

    String message = String.Format("The {0} is on sale!", item);
    

    The reason for this is that different languages often order the words differently, and concatenating strings directly will need a new build to fix, but if you used some kind of string replacement mechanism like above, you can modify your .resx file (or whatever localization files you use) for the specific language that needs to reorder the words.

    0 讨论(0)
  • 2020-12-12 11:19

    One thing no one have mentioned yet is strings with some warying part as in "The unit will arive in 5 days" or "On Monday something happens." where 5 and Monday will change depending on state. It is not a good idea to split those in two and concatenate them. With only one varying part and good documentation you might get away with it, with two varying parts there will be some language that preferes to change the order of them.

    0 讨论(0)
  • 2020-12-12 11:23

    I think everyone working in internationalization should be familiar with the Common Locale Data Repository, which is now a sub-project of Unicode:

    Common Locale Data Repository

    Those folks are working hard to establish a standard resource for all kinds of i18n issues: currency, geographical names, tons of stuff. Any project that's maintaining its own core local data given that this project exists is pretty bonkers, IMHO.

    0 讨论(0)
  • 2020-12-12 11:25

    I suggest to use something like 99translations.com to maintain your translations . Otherwise you won't be able to tell what of your translations are up to date in every language.

    0 讨论(0)
  • 2020-12-12 11:29

    One website I use has a translation method the owner calls "wiki + machine translation". This is a community based site so is obviously different to the needs of companies.

    http://blog.bookmooch.com/2007/09/23/how-bookmooch-does-its-translations/

    0 讨论(0)
  • 2020-12-12 11:30

    Another challenge will be accepting input from your users. In many cases, this is eased by the input processing provided by the operating system, such as IME in Windows, which works transparently with common text widgets, but this facility will not be available for every possible need.

    0 讨论(0)
提交回复
热议问题