Tesseract data language codes with country name - tesseract

Tesseract updated their iOS library and training data. The training data is with language codes. How can I know which language is this and to which country it belongs? I searched all Google for this. Some codes are understandable but not all. i.e.
asm.traindata
aze.traindata
bel.traindata
ben.traindata
bod.traindata
....

Those file names are ISO 639-2/T or ISO 639-2/B language codes. IN THIS WIKI ARTICLE you can find the whole table of languages and their codes, so finding out to which language those files belong should be easy.

Related

Flutter Dart - get localized country name from country code

I have a list of alpha-2 country codes.
List<String> countryCodes = ["DE", "CH", "AT"];
How to get the localized country names in Flutter/Dart?
If the device language is set to english, i want this output..
Germany, Switzerland, Austria
If the device language is set to german, i want this output..
Deutschland, Schweiz, Österreich
Is this possible without any 3rd party package in Flutter/Dart?
In Java you could do..
Locale loc = new Locale("","DE");
loc.getDisplayCountry();
To get the localized country names from a country code one can use the Country Codes package from pub.dev.
Its easy to use. I recommend.
https://pub.dev/packages/country_codes

How can show amount in words in crystal report in english language

I tried to convert amout to words,i used this Function:
ProperCase( ToWords(10000, 0) )
The result is in french language : Dix Mille
My problem is how can i change the translation in english language and how can switch between two languages when i need that
Thanks for helping me to solve my problem
This article about changing Viewing Locale in Crystal Designer may help: https://apps.support.sap.com/sap/support/knowledge/public/en/1969993
There are similar instructions for changing Locale in applications. It's not clear what your situation is (Designer or App).
For situations where you need to switch language on the fly, the best solution is to create or get a User Function Library (UFL).

Customizing phone number or any other String for different Locales in GWT

I am trying to find the best route to get in some Custom formats I need. For example if I have a phone number 0803456765
In India it may be represented as +91 (080) 3456765
In US it may be 080-345-6765 and so on
I could keep the format in the properties file and based on locale I could pull the format and format the String. I could also have a Util class which does this for me after I identify the Locale.
But I think there might be a better route using NumberFormat. I guess NumberFormat automatically figures out the Locale and applies a certain Pattern to the String. Can I customize this pattern ? In the sense, can I tell GWT to use my Custom pattern for the US Locale
I know we can do this
// Custom format
value = 12345.6789;
formatted = NumberFormat.getFormat("000000.000000").format(value);
// prints 012345.678900 in the default locale
GWT.log("Formatted string is" + formatted, null);
but I don't want to specify my formatting pattern as in 'NumberFormat.getFormat("000000.000000")'. I want to override the default number formats of various Locales in GWT to achieve this. How do I do this ?
Don't roll your own. Google open sourced their library which you can leverage. It supports
Parsing/formatting/validating phone numbers for all countries/regions
of the world.

wrong ISO returned from CTCarrier on iPhone for certain countries

This is not a question but rather a note for other developers who might be using CTCarrier.
I have been developing an app which requires reading the iso of the SIM card to determine the country the app is being used in (at least the SIM country). The doc mentions the following about the isoCountryCode property:
This property uses the ISO 3166-1 country code representation.
From my tests and deployment however it appears that the returned iso is not the standard ISO 3166-1 for several countries (not sure if this is Apple's mistake of the carrier who stored the info in the SIM)! So i had to do a translational phase to resolve the incorrect ISO's. The following is the list i have got to so far (will keep updating it once i get new incorrect iso's):
Country: ISO I get Expected ISO
---------- ---------- -------------
UK uk gb
Japan ja jp
Cheers
AF
UK was reserved by the the United Kingdom (and is an an appendix to the standard) so that's a grey area ;)
JA should be Jamacia - why do you expect this to be Japan?
Info from here : http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2

Is NSLocalizedString() based on the user's language or their region setting?

I am localizing my app for Denmark. I have the Localizable.Strings and the XIBs translated into Danish.
On iPhone a user can
Set the 'Region Format' to 'Denmark'
but keep the language 'English'
Set the 'Region Format' to any English-speaking country but keep
the language 'Dansk'
Set the 'Region Format' to 'Denmark' and language 'Dansk'
My question is: for any of the above settings should the app show the 'Danish' version (which for my App will mean all text in UI and the database to be in Danish.) or should the 'Danish' version only come when user sets the language to 'Dansk'?
This is a great question.
The real issue it comes down to is, in Apple's opinion, as they did it, does NSLocalizedString tend to favour the 'Region Format' or the 'language' setting?
I have never been able to find a clear answer on this, I just let NSLocalizedString decide.
(Purely FWIW, I think follow the "language" setting.)
It's possible the following code snippets could help you.
// to ("usually") get the preferred language FROM THE SET WHICH we supplied in bundle
// [[[NSBundle mainBundle] preferredLocalizations] objectAtIndex:0]
// to ("often") get the preferred language REGARDLESS OF what we supplied
// [ [NSBundle preferredLocalizationsFromArray:[NSLocale ISOCountryCodes]] objectAtIndex:0]
// to ("fairly reliably") get the user's chosen language setting...
// [ [NSLocale preferredLanguages] objectAtIndex:0]
It may not help, but I hope it helps.
Languages and locales are treated differently by Cocoa, because they are independent concepts. NSLocalizedString() will obey the current language setting of the OS, where things like dates, times, and numbers are affected by the locale setting.
Why locales are handled separately from languages can be found in the Locales Programming Guide:
When you display data to a user it
should be formatted according to the
conventions of the user’s native
country, region, or culture.
Conversely, when users enter data,
they may do so according to their own
customs or preferences. Locale objects
are used to provide information
required to localize the presentation
or interpretation of data. This
information can include decimal
separators, date formats, and units of
measurement, as well as language and
region information.
For example, by convention in the
United States “7/4/76” represents the
Bicentennial of the Declaration of
Independence. However, in Great
Britain, it represents the “7th of
April, 1976”; in Thailand using the
Thai Traditional Calendar it might
represent “April 7th, 2519”; and in
France it represents “7 avril 1976”.
To take a more subtle example, in the
United States“12.125” represents the
decimal number twelve and one eighth,
whereas in Germany it represents
twelve thousand one hundred and
twenty-five.
In the example given there, you might have a user who prefers to use English as their primary language, yet who lives in Germany and is used to a comma as a decimal separator, not a period.
The Internationalization Programming Topics guide has a lengthy discussion of all the issues involved and how to deal with them.