Default site language based on the ip with rails 3 - ruby-on-rails

I've a multilanguage site, based on the localization of the visitor (his ip), I'll use one language or another (setting the I18n.locale).
i.e: for a visitor from France, the default language will be french, for a visitor from US the default language will be english.
Which gem do you recommend for that, there is a wide range of choice.
Thanks

Some countries have more than one official language, or multiple commonly spoken languages. For these countries, you may want to consider defaulting to the most prevalent spoken and then display a ranked list by prevalance. You can get the official and common languages spoken and percentage from the CIA World Factbook listing on country languages:
https://www.cia.gov/library/publications/the-world-factbook/fields/2098.html
If you need to map the language to the ISO 639-1 alpha-2 or alpha-3 codes, you can get that information from the US Library of Congress at:
http://www.loc.gov/standards/iso639-2/php/English_list.php
The OpenGeoCode.Org Team
Andrew

Related

Is there a way to get the language from Medium posts?

I need to review numerous articles every day, however, I'm only interested in articles in a specific language (Portuguese, pt-br, in this case).
I even read Medium's API and didn't find language information, but I'm not a technical reference lol
I would like to:
Know if there is any way to get the language parameters of an article from Medium (Medium.com) to be able to return only articles in Portuguese
If not possible, recommendations on how I could collect published articles, and filter them by language using another technique or technology (e.g.: artificial intelligence)
Medium currently does not support a way to filter stories by language.
But you can change the app language. If your app doesn't load in your language, you can easily change that in your phone settings.
you can follow this link for further details
about language availability on medium

Is there a translated / localized ISO 4217 currency code list?

I am trying to find a localized / translated ISO 4217 currency code list. What I found so far was only an English version of ISO 4217, but currency names like "Swiss Franc" have different translations per languages (as per https://www.wikidata.org/wiki/Q25344). Any lists or dbs out there that could be used inside an app without reinventing the wheel?
The ISO 4217 standard defining the international currency codes seems to be provided by ISO only in English language. This is quite unusual, since many of the general purpose standards are provided by ISO in English, French and Russian.
Since currency codes per country evolve more quickly than standard committee can follow, the maintenance of the standard was delegated to an agency that provides a static list for free, but also only in English. The European Publication Office provides the list of currencies on a page that is translated in the 24 official languages of the European Union. There are a couple of other websites, not to speak of wikipedia, which also provide some more translations.
But before you start to develop a web-scraping app to get all the translations across all the known public sources, maybe you could just have a look at this amazing GitHub repository, which provides the list in almost any language, and in a lot of different formats (I recently discovered this link on the wikipedia page that you referenced).

English to European-Portuguese translator

I am using Google Translator for multilingual support. As far as I googled, it provides only Brazilian Portuguese & not European Portuguese. Is there any other translator/API(Free or Licence) that could provide European Portuguese. Please suggest.
I am pretty sure google translate covers European as well as Brazilian Portuguese.
Just entered a bunch of words that are only used in Portugal such as
Descapotável
Fixe
Aferrolhar
Gajo
and they provided the correct translation into English. I did have to set the source language as Portuguese ( if left to autodetect in some cases it failed to detect the language )
The google api documentation shows both Portugal and Brazil as being covered ( see code 'pt')
In my experience, the most consistent translation matrix between American English (en_US) and European Portuguese (pt_PT) that's available online is the DeepL Translator/DeepL API. Their paid offering, DeepL Pro, takes it a step further to supplying formal and informal tones for both regions and represents the pinnacle of machine translation for European Portuguese that I've personally used.
Bing Translator also offers an explicit choice between European and Brazilian Portuguese translations and does a fair job at minding the differences, though it appears less nuanced about the vernacular usage than DeepL.
Both of these are far superior to Google's offerings when working with Portuguese. As a participant in their Crowdsource project and the support forums for it, according to the Google representatives there (as of Q4 2021), there remains no official plan to fork the Portuguese part of the database into Brazilian and European variants despite years of requests for it.

Is it possible to localize the application name based on a criterion other than language?

Thanks to #Jano, I know how to localize application strings based on the country in which the application is running - in my question : How to localize text based on criterion other than language. The answer is to take these strings out of the Settings.bundle and bring them into the application, where they can be localized in whatever manner the developer requires.
My question now is: is it possible to localize the application name (the name under the app icon) using a criterion other than language? I think that doing this on a language basis is well understood - there are several questions and answers on Stack Overflow and elsewhere which discuss localizing the BundleDisplayName.
But my customer would like to give the application a different name in the various European countries in which he expects to market it, and some of these countries (Germany, Austria, Switzerland), share a language.
Xcode allow you to add de-AT, de-DE and de-CH localization files, but I have just tried this out and looks like it has no effect. I tried to change device language to German and then switch region format between Austria, Germany and Switzerland, but the bundle display name didn't change from English. When I added de (without a -XX suffix for country) it changed to German name, again ignoring region format. I'm a bit confused as I was under impression we could use those country-specific localizations like that. I hope someone offers a better solution, but until then I would suggest a workaround: building 3 targets, one for each country, and submitting them to AppStore and only making them available in their respective countries.

Similar languages when submitting to Apple's AppStore

I am uploading a new App which is localized in 10 languages to the Apple AppStore.
Apple offers several languages with country specific options such as
Canadian French
Mexican Spanish
Brazilian Portuguese
We have set up localizations for French, Spanish and Portuguese.
On the iPhone, an App defaults to the closest language available. For example, an iPhone set to "Brazilian Portuguese" will use the regular Portuguese localization instead of the English default localization.
Is it the same on the AppStore? Do we need to also set "Mexican Spanish" or will customers from Mexico default to Spanish (instead of the defaulting to English)?
edit:
To clarify, this is not about whether we should localize to these dialects (we already decided against that when making the app), but whether the store page shown to the customer will be displayed in the closest dialect or english.
For example, will a Mexican user automatically see the Spanish version (the closest language) or the default language (English)?
I can confirm that the closest available language is selected by the App Store.
For example in the Mexican App Store if you have Spanish set up but not Mexican Spanish, Spanish will show up. This app has Spanish activated on iTunes but not Mexican Spanish and everything is in Spanish on the Mexican App Store.
https://itunes.apple.com/mx/app/id502222888
The language that is displayed on the App Store depends also on the user's language settings since they set the language query parameter. The URL format used by Apple with the language query parameter is:
https://itunes.apple.com/tw/app/id502222888?l=zh where tw is Taiwan and l=zh is the Chinese language.
The language query parameter is not always used.
For example in Germany, even if you set the another language via the query parameter it will be ignored and the German language will show up since it is the only language for that location:
https://itunes.apple.com/de/app/id502222888?l=fr
While in Canada that has both English or French, you can use the language query parameter:
https://itunes.apple.com/ca/app/id502222888?l=fr
To answer my own question: No, Apple does not automatically choose the closest language on the AppStore.
Here is an example of the Mexican AppStore using English despite standard Spanish being present:
Let's start with Spanish. As far as I know Spanish (Mexico) is considered International Spanish, which is fairly similar to English (USA).
I don't know about French, so I might be wrong here but I believe French (France) would be perfectly understandable by the Canadians.
As for Portuguese... Well, in this case you did something that I believe should be the other way round. I read on the Internet that Portuguese government (?) recently pass a reform so that regular Portuguese would be similar in terms of grammar with Brazilian Portuguese. You see as Brazil is much bigger country, Brazilian version is much more common. Therefore I don't think it is OK to use regular Portuguese in Brazil (there might be some problems) but it is probably just about right to use Brazilian Portuguese in Portugal.
There is also the case of Chinese. As in Simplified vs Traditional. If you ever going to localize your application into Chinese (not the easiest thing to do), Traditional is the one to be used in Hong Kong, Taiwan and Macao whereas Simplified is the one they use in China (mainland) as well as in Singapore.
It would be very inappropriate to confuse them (i.e. try to sell Simplified version to the Taiwanese).

Resources