<p>How have you implemented Internationalization (i18n) in actual projects you've worked on?</p>

<p>I took an interest in making software cross-cultural after I read the famous post by Joel, <a href="http://www.joelonsoftware.com/articles/Unicode.html" rel="noreferrer">The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)</a>. However, I have yet to able to take advantage of this in a real project, besides making sure I used Unicode strings where possible. But making all your strings Unicode and ensuring you understand what encoding everything you work with is in is just the tip of the i18n iceberg.</p>

<p>Everything I have worked on to date has been for use by a controlled set of US English speaking people, or i18n just wasn't something we had time to work on before pushing the project live. So I am looking for any tips or war stories people have about making software more localized in real world projects.</p>

[{'answer_id': 906, 'author': 'Mike Stone', 'author_id': 122, 'author_profile': 'https://Stackoverflow.com/users/122', 'pm_score': 3, 'selected': False, 'text': '<p>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.</p>\n\n<p>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.</p>\n\n<p>One other note, very strictly avoid concatenating visible strings directly, such as</p>\n\n<pre><code>String message = "The " + item + " is on sale!";\n</code></pre>\n\n<p>Instead, you must use something like</p>\n\n<pre><code>String message = String.Format("The {0} is on sale!", item);\n</code></pre>\n\n<p>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.</p>\n'}, {'answer_id': 921, 'author': 'Michael Stum', 'author_id': 91, 'author_profile': 'https://Stackoverflow.com/users/91', 'pm_score': 4, 'selected': False, 'text': '<p>Some fun things:</p>\n\n<ol>\n<li><p>Having a PHP and MySQL Application that works well with German and French, but now needs to support Russian and Chinese. I think I move this over to .net, as PHP\'s Unicode support is - in my opinion - not really good. Sure, juggling around with utf8_de/encode or the mbstring-functions is fun. Almost as fun as having Freddy Krüger visit you at night...</p></li>\n<li><p>Realizing that some languages are a LOT more Verbose than others. German is a LOT more verbose than English usually, and seeing how the German Version destroys the User Interface because too little space was allocated was not fun. Some products gained some fame for their creative ways to work around that, with Oblivion\'s "Schw.Tr.d.Le.En.W." being memorable :-)</p></li>\n<li><p>Playing around with date formats, woohoo! Yes, there ARE actually people in the world who use date formats where the day goes in the middle. Sooooo much fun trying to find out what 07/02/2008 is supposed to mean, just because some users might believe it could be July 2... But then again, you guys over the pond may believe the same about users who put the month in the middle :-P, especially because in English, July 2 sounds a lot better than 2nd of July, something that does not neccessarily apply to other languages (i.e. in German, you would never say Juli 2 but always Zweiter Juli). I use 2008-02-07 whenever possible. It\'s clear that it means February 7 and it sorts properly, but dd/mm vs. mm/dd can be a really tricky problem.</p></li>\n<li><p>Anoter fun thing, <a href="https://stackoverflow.com/questions/192/floating-point-number-parsing-is-there-a-catch-all-algorithm">Number formats</a>! 10.000,50 vs 10,000.50 vs. 10 000,50 vs. 10\'000,50... This is my biggest nightmare right now, having to support a multi-cultural environent but not having any way to reliably know what number format the user will use.</p></li>\n<li><p>Formal or Informal. In some language, there are two ways to address people, a formal way and a more informal way. In English, you just say "You", but in German you have to decide between the formal "Sie" and the informal "Du", same for French Tu/Vous. It\'s usually a safe bet to choose the formal way, but this is easily overlooked.</p></li>\n<li><p>Calendars. In Europe, the first day of the Week is Monday, whereas in the US it\'s Sunday. Calendar Widgets are nice. Showing a Calendar with Sunday on the left and Saturday on the right to a European user is not so nice, it confuses them.</p></li>\n</ol>\n'}, {'answer_id': 1312, 'author': 'Michael Stum', 'author_id': 91, 'author_profile': 'https://Stackoverflow.com/users/91', 'pm_score': 3, 'selected': False, 'text': '<p>I was just listening to a <a href="http://www.hanselminutes.com/default.aspx?showID=135" rel="nofollow noreferrer">Podcast from Scott Hanselman</a> this morning, where he talks about internationalization, especially the really tricky things, like Turkish (with it\'s four i\'s) and Thai. Also, Jeff Atwood had a <a href="http://www.codinghorror.com/blog/archives/001075.html" rel="nofollow noreferrer">post</a>:</p>\n'}, {'answer_id': 1462, 'author': 'McDowell', 'author_id': 304, 'author_profile': 'https://Stackoverflow.com/users/304', 'pm_score': 6, 'selected': False, 'text': '<p>It has been a while, so this is not comprehensive.</p>\n\n<p><strong>Character Sets</strong></p>\n\n<p>Unicode is great, but you can\'t get away with ignoring other character sets. The default character set on Windows XP (English) is Cp1252. On the web, you don\'t know what a browser will send you (though hopefully your container will handle most of this). And don\'t be surprised when there are bugs in whatever implementation you are using. Character sets can have interesting interactions with filenames when they move to between machines.</p>\n\n<p><strong>Translating Strings</strong></p>\n\n<p>Translators are, generally speaking, not coders. If you send a source file to a translator, they will break it. Strings should be extracted to resource files (e.g. properties files in Java or resource DLLs in Visual C++). Translators should be given files that are difficult to break and tools that don\'t let them break them.</p>\n\n<p>Translators do not know where strings come from in a product. It is difficult to translate a string without context. If you do not provide guidance, the quality of the translation will suffer.</p>\n\n<p>While on the subject of context, you may see the same string "foo" crop up in multiple times and think it would be more efficient to have all instances in the UI point to the same resource. This is a bad idea. Words may be very context-sensitive in some languages.</p>\n\n<p>Translating strings costs money. If you release a new version of a product, it makes sense to recover the old versions. Have tools to recover strings from your old resource files.</p>\n\n<p>String concatenation and manual manipulation of strings should be minimized. Use the format functions where applicable.</p>\n\n<p>Translators need to be able to modify hotkeys. <kbd>Ctrl</kbd>+<kbd>P</kbd> is print in English; the Germans use <kbd>Ctrl</kbd>+<kbd>D</kbd>.</p>\n\n<p>If you have a translation process that requires someone to manually cut and paste strings at any time, you are asking for trouble.</p>\n\n<p><strong>Dates, Times, Calendars, Currency, Number Formats, Time Zones</strong></p>\n\n<p>These can all vary from country to country. A comma may be used to denote decimal places. Times may be in 24hour notation. Not everyone uses the Gregorian calendar. You need to be unambiguous, too. If you take care to display dates as MM/DD/YYYY for the USA and DD/MM/YYYY for the UK on your website, the dates are ambiguous unless the user knows you\'ve done it.</p>\n\n<p><strong>Especially Currency</strong></p>\n\n<p>The Locale functions provided in the class libraries will give you the local currency symbol, but you can\'t just stick a pound (sterling) or euro symbol in front of a value that gives a price in dollars.</p>\n\n<p><strong>User Interfaces</strong></p>\n\n<p>Layout should be dynamic. Not only are strings likely to double in length on translation, the entire UI may need to be inverted (Hebrew; Arabic) so that the controls run from right to left. And that is before we get to Asia.</p>\n\n<p><strong>Testing Prior To Translation</strong></p>\n\n<ul>\n<li>Use static analysis of your code to locate problems. At a bare minimum, leverage the tools built into your IDE. (Eclipse users can go to Window > Preferences > Java > Compiler > Errors/Warnings and check for non-externalised strings.)</li>\n<li>Smoke test by simulating translation. It isn\'t difficult to parse a resource file and replace strings with a pseudo-translated version that doubles the length and inserts funky characters. You don\'t have to speak a language to use a foreign operating system. Modern systems should let you log in as a foreign user with translated strings and foreign locale. If you are familiar with your OS, you can figure out what does what without knowing a single word of the language.</li>\n<li>Keyboard maps and character set references are very useful.</li>\n<li>Virtualisation would be very useful here.</li>\n</ul>\n\n<p><strong>Non-technical Issues</strong></p>\n\n<p>Sometimes you have to be sensitive to cultural differences (offence or incomprehension may result). A mistake you often see is the use of flags as a visual cue choosing a website language or geography. Unless you want your software to declare sides in global politics, this is a bad idea. If you were French and offered the option for English with St. George\'s flag (the flag of England is a red cross on a white field), this might result in confusion for many English speakers - assume similar issues will arise with foreign languages and countries. Icons need to be vetted for cultural relevance. What does a thumbs-up or a green tick mean? Language should be relatively neutral - addressing users in a particular manner may be acceptable in one region, but considered rude in another.</p>\n\n<p><strong>Resources</strong></p>\n\n<p>C++ and Java programmers may find the ICU website useful: <a href="http://www.icu-project.org/" rel="noreferrer">http://www.icu-project.org/</a></p>\n'}, {'answer_id': 54340, 'author': '8128', 'author_id': 1530, 'author_profile': 'https://Stackoverflow.com/users/1530', 'pm_score': 0, 'selected': False, 'text': '<p>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. </p>\n\n<p><a href="http://blog.bookmooch.com/2007/09/23/how-bookmooch-does-its-translations/" rel="nofollow noreferrer">http://blog.bookmooch.com/2007/09/23/how-bookmooch-does-its-translations/</a></p>\n'}, {'answer_id': 96000, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 1, 'selected': False, 'text': '<p>I think everyone working in internationalization should be familiar with the Common Locale Data Repository, which is now a sub-project of Unicode:</p>\n\n<p><a href="http://unicode.org/cldr" rel="nofollow noreferrer">Common Locale Data Repository</a></p>\n\n<p>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.</p>\n'}, {'answer_id': 112575, 'author': 'Decio Lira', 'author_id': 12423, 'author_profile': 'https://Stackoverflow.com/users/12423', 'pm_score': 2, 'selected': False, 'text': '<p>Besides all the previous tips, remember that i18n it\'s not just about changing words for their equivalent on other languages, especially for non-latin languages alphabets (korean, Arabic) which written right to left, so the whole UI will have to conform, like</p>\n\n<ul>\n<li>item 1</li>\n<li>item 2</li>\n<li>item 3</li>\n</ul>\n\n<p>would have to be</p>\n\n<p>arabic text 1 -</p>\n\n<p>arabic text 2 -</p>\n\n<p>arabic text 3 -</p>\n\n<p>(reversed bullet list doesn\'t seem to work :P)</p>\n\n<p>which can be a UI nightmare if your system has to apply changes dinamically once the user changes the language being used.</p>\n\n<p>Another very hard thing is to test different languages, not just for the correctness of word, but since languages like Korean usually have bigger font type for their characters this may lead to language specific bugs (like "SAVE" text on a button being larger than the button itself for some language).</p>\n'}, {'answer_id': 177944, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 0, 'selected': False, 'text': '<p>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.</p>\n'}, {'answer_id': 200981, 'author': 'MSalters', 'author_id': 15416, 'author_profile': 'https://Stackoverflow.com/users/15416', 'pm_score': 2, 'selected': False, 'text': "<p>One of the funnier things to discover: italics and bold text makrup does not work with CJK (Chinese/Japanese/Korean) characters. They simply become unreadable. (OK, I couldn't really read them before either, but especially bolding just creates ink blots)</p>\n"}, {'answer_id': 394644, 'author': 'user43685', 'author_id': 43685, 'author_profile': 'https://Stackoverflow.com/users/43685', 'pm_score': 1, 'selected': False, 'text': '<p>I suggest to use something like <a href="http://99translations.com" rel="nofollow noreferrer">99translations.com</a> to maintain your translations . Otherwise you won\'t be able to tell what of your translations are up to date in every language. </p>\n'}, {'answer_id': 394755, 'author': 'TokenMacGuy', 'author_id': 49287, 'author_profile': 'https://Stackoverflow.com/users/49287', 'pm_score': 1, 'selected': False, 'text': '<p>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.  </p>\n'}]
['https://Stackoverflow.com/questions/898', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/200/']