Difference between Locale FRENCH vs Locale FRANCE
Asked Answered
S

3

17

http://developer.android.com/reference/java/util/Locale.html

What is the difference for example between

 Locale FRENCH vs Locale FRANCE 

and

Locale GERMAN vs Locale GERMANY 

I am searching, but I can't find the anything about the difference in the documentation. Any idea?

Schematize answered 22/8, 2012 at 11:13 Comment(0)
H
20

French and German are spoken in more countries than just France and Germany. In different countries they will have different currencies, different ways of writing numbers, etc. That's why you can indicate both the language & region of your locale, and that's why you can define specific resources for each language/region-combination (e.g. de-DE for Germany vs de-AT for Austria, or fr-FR for France vs fr-rCA for Canada).

Hanseatic answered 22/8, 2012 at 11:20 Comment(1)
It depends; if you're localizing your app for users specifically in France then yes. If you just want to translate your application to the French language and don't really care where those users are from (e.g. your app doesn't display currency or dates) then use French.Hanseatic
L
1

One refers to a geographic area (and its conventions, such as using commas or decimal points in numbers), the other to a language.

For example, French could be spoken in France or Canada.

Laruelarum answered 22/8, 2012 at 11:20 Comment(0)
H
1

A Locale contains:

  • language code
  • country or region code (optional)
  • optional variant code (optional)

Therefore there are multiple predefined Locale objects for the same language. Some with Countrycode and some just with the language.

See: java.sun.com/developer/technicalArticles/J2SE/locale for more details

Huckaby answered 22/8, 2012 at 11:29 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.