common-util

local.tomas.i18n
Class Locales

java.lang.Object
  extended by local.tomas.i18n.Locales

public final class Locales
extends Object

Helper class for locale processing.

Author:
tomas.teubner

Method Summary
static Locale findBest(String str)
          Find locale which best matches the specified requirements.
static Locale findBest(String language, String country, String variant)
          Find locale which best matches the specified requirements.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

findBest

public static Locale findBest(String language,
                              String country,
                              String variant)
Find locale which best matches the specified requirements.

Parameters:
language - a language name
country - a country
variant - a variant
Returns:
best locale or null if none was found
See Also:
Locale

findBest

public static Locale findBest(String str)
Find locale which best matches the specified requirements.

Parameters:
str - locale string in the format language_country_variant, language_country or language alone
Returns:
best locale or null if none found
See Also:
Locale

common-util

Copyright © 2005-2007 Tomas Teubner. All Rights Reserved.