internationalization

i18n-able way to get number ordinal in C++/MFC on Windows? (1->1st, 2->2nd, etc.)

Is there an easy way to convert the number 1, 2, 3, ... to "1st", "2nd", "3rd", ..., and in such a way that I can give the function a language and have it return me the correct form for the language I'm targeting? Either standard C++ (stl or boost OK), MFC or ATL, win32 api or a small, single-purpose and free library that I can download ...

Is there an open source java enum of ISO 3166-1 country codes

Does anyone know of a freely available java 1.5 package that provides a list of ISO 3166-1 country codes as a enum or EnumMap? Specifically I need the "ISO 3166-1-alpha-2 code elements", i.e. the 2 character country code like "us", "uk", "de", etc. Creating one is simple enough (although tedious), but if there's a standard one already ...

Using locale.setlocale in embedded Python without breaking file parsing in C thread

We're using a third-party middleware product that allows us to write code in an embedded Python interpreter, and which exposes an API that we can call into. Some of these API calls allow us to load various kinds of file, and the loading code is implemented in C. File loading happens in a separate thread, and calls back into Python when t...

Best practices in PHP and MySQL with international strings

It often happens that characters such as é gets transformed to é, even though the collation for the MySQL DB, table and field is set to utf8_general_ci. The encoding in the Content-Type for the page is also set to UTF8. I know about utf8_encode/decode, but I'm not quite sure about where and how to use it. I have read the "The Absolute...

Java, unicode and fonts

I've looked at the java documentation and scoured the net for information on java's support for international characters with specific fonts (such as Monospace), but haven't been able to get a clear concrete answer. There has been a change between java 1.4 and java 1.5/1.6. For example, in java 1.4 if you set the font on a JTextArea to ...

Algorithm to estimate number of English translation words from Japanese source

I'm trying to come up with a way to estimate the number of English words a translation from Japanese will turn into. Japanese has three main scripts -- Kanji, Hiragana, and Katakana -- and each has a different average character-to-word ratio (Kanji being the lowest, Katakana the highest). Examples: computer: コンピュータ (Katakana - 6 chara...

File name corruption on file download (IE)

I have implemented a simple file upload-download mechanism. When a user clicks a file name, the file is downloaded with these HTTP headers: HTTP/1.1 200 OK Date: Tue, 30 Sep 2008 14:00:39 GMT Server: Microsoft-IIS/6.0 Content-Disposition: attachment; filename=filename.doc; Content-Type: application/octet-stream Content-Length: 10754 I...

What are good tools/frameworks for i18n of a php codebase?

I have been looking at a few options for enabling localization and internationalization of a dynamic php application. There appears to be a variety of tools available such as gettext and Yahoo's R3 and I am interested in hearing from both developers and translators about which tools are good to use and what functionality is important in ...

Best practices for internationalizing web applications?

Internationalizing web apps always seems to be a chore. No matter how much you plan ahead for pluggable languages, there's always issues with encoding, funky phrasing that doesn't fit your templates, and other problems. I think it would be useful to get the SO community's input for a set of things that programmers should look out for w...

How would you transform a pre-existing web app in a multilingual one?

I am going to work on a project where a fairly large web app needs to tweaked to handle several languages. The thing runs with a hand crafted PHP code but it's pretty clean. I was wondering what would be the best way to do that? Making something on my own, trying to fit the actual architecture. Rewriting a good part of it using a fram...

What options do exist now to implement UTF8 in Ruby and RoR?

Following the development of Ruby very closely I learned that detailed character encoding is implemented in Ruby 1.9. My question for now is: How may Ruby be used at the moment to talk to a database that stores all data in UTF8? Background: I am involved in a new project where Ruby/RoR is at least an option. But the project needs to rel...

Localization in OpenSocial gadget app

I'm trying to add multi-language support to an OpenSocial application. I see that I can link to my own message bundles in the gadget XML markup: <Module> <ModulePrefs title="Hello" description="Message bundle demo"> <Require feature="opensocial-0.7"/> <Locale lang="en" messages="http://example.com/hello/en_ALL.xml"/&gt; </...

How can I add internationalization to my Perl script?

Hi there, I'm looking at introducing multi-lingual support to a mature CGI application written in Perl. I had originally considered rolling my own solution using a Perl hash (stored on disk) for translation files but then I came across a CPAN module which appears to do just what I want (i18n). Does anyone have any experience with in...

Reporting Services internationalization

We use SQL Server Reporting Services for our web reports. At the moment, our clients are all in the UK, so for each report, we set the Language property for the report to "English (United Kingdom)". But now we have US and French clients. So, we'll need to change the language and currency for the French, and the date format and currency ...

Case-insensitive UTF-8 string collation for SQLite (C/C++)

I am looking for a method to compare and sort UTF-8 strings in C++ in a case-insensitive manner to use it in a custom collation function in SQLite. The method should ideally be locale-independent. However I won't be holding my breath, as far as I know, collation is very language-dependent, so anything that works on languages other than...

Insert array into database in a single row

I wonder if this would be doable ? To insert an array into one field in the database. For instance I have a title, I want to have that title with only one id, but it's going to be bilingually used on the website. It feels a bit unnecessary to make another table to have their global ids and then another table with the actual titles link...

Which Version of StringComparer to use

If I want to have a case-insensitive string-keyed dictionary, which version of StringComparer should I use given these constraints: The keys in the dictionary come from either C# code or config files written in english locale only (either US, or UK) The software is internationalized and will run in different locales I normally use St...

How do you manage the String Translation Process?

I am working on a Software Project that needs to be translated into 30 languages. This means that changing any string incurs into a relatively high cost. Additionally, translation does not happen overnight, because the translation package needs to be worked by different translators, so this might take a while. Adding new features is c...

ASP.Net: Approaches to multilingual websites with Javascript and AJAX

We've recently completed phase 1 of a ASP.Net website in English and French. We went with using resource files to store language specific strings, but because the site used ASP.Net AJAX and javascript heavily we rigged up a solution to pass the right files through the ASP.Net pipeline where we could catch "tokens" and replace them with t...

How do I properly store and retrieve internationalized Strings in properties files?

I'm experimenting with internationalization by making a Hello World program that uses properties files + ResourceBundle to get different strings. Specifically, I have a file "messages_en_US.properties" that stores "hello.world=Hello World!", which works fine of course. I then have a file "messages_ja_JP.properties" which I've tried all...