OpenBookPrices / country-data

Country related data such as ISO codes, currencies etc
MIT License
515 stars 165 forks source link

Internationalization support? #44

Open ilyabreev opened 8 years ago

ilyabreev commented 8 years ago

Do you plan to add internationalization support to your package? I think it may be very useful for non-english development targets.

evdb commented 8 years ago

I'd be interested to try. What sort of things do you think need to be internalionatized? How do you think it would be easiest for the end users to use the i18n?

ilyabreev commented 8 years ago

I think that primary goal is to localize country names. It'll simplify lookup of country in native language. If I have textbox with dropdown on my web page, for example, to make autocomplete and then get all information about country.

In terms of code it can be done if lookup parameter will become a function:

var lookup = require('country-data').lookup('ru');

and then all subsequent calls to lookup functions will use russian (as in the example above) language for querying on name parameter. To change language you need to create another lookup object. It seems to be the appropriate way.

evdb commented 8 years ago

Country names, and currency names too I suppose.

I don't think I would provide a look up function to do the conversion. Instead I would provide the data required for native internationalisation routines to use. That way if an app already has an i18n solution they can continue to use it.

Perhaps providing the translations in gettext compatible files which can then be adapted to other translation setups?

Does that seem sensible to you? On Wed, 13 Jan 2016 at 15:02, Ilya Breev notifications@github.com wrote:

I think that primary goal is to localize country names. It'll simplify lookup of country in native language. If I have textbox with dropdown on my web page, for example, to make autocomplete and then get all information about country.

In terms of code it can be done if lookup parameter will become a function:

var lookup = require('country-data').lookup('ru');

and then all subsequent calls to lookup functions will use russian (as in the example above) language for querying on name parameter. To change language you need to create another lookup object. It seems to be the appropriate way.

— Reply to this email directly or view it on GitHub https://github.com/OpenBookPrices/country-data/issues/44#issuecomment-171381264 .

ilyabreev commented 8 years ago

It's a great idea!

ilyabreev commented 8 years ago

I'd participate in translation into russian, for example.

PhilippMi commented 8 years ago

Any progress on this issue? I would like to have this feature too.

evdb commented 8 years ago

It is not something that I personally have a need for. Pull requests welcome :) On Thu, 14 Jul 2016 at 16:13, Philipp Mitterer notifications@github.com wrote:

Any progress on this issue? I would like to have this feature too.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/OpenBookPrices/country-data/issues/44#issuecomment-232677474, or mute the thread https://github.com/notifications/unsubscribe/AALc7sog09Q7mQqjx0aJSWdjPYRWIbkdks5qVkQPgaJpZM4G7Vwh .