org.mentawai.i18n
Class LocaleManager
java.lang.Object
org.mentawai.i18n.LocaleManager
public class LocaleManager
- extends Object
- Author:
- Sergio Oliveira
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_LOCALE
public static Locale DEFAULT_LOCALE
I18N_RELOAD_TIME
public static long I18N_RELOAD_TIME
I18N_DEBUG
public static boolean I18N_DEBUG
LocaleManager
public LocaleManager()
usePrefixForActions
public static void usePrefixForActions(boolean b)
isUsePrefixForActions
public static boolean isUsePrefixForActions()
stopLocaleScan
public static void stopLocaleScan()
startLocaleScan
public static void startLocaleScan()
scanLocales
public static Set<Locale> scanLocales(String dir)
throws Throwable
- Throws:
Throwable
scanLocales
public static Set<Locale> scanLocales(String dir,
String filename)
throws Throwable
- Throws:
Throwable
setUseMasterForEverything
public static void setUseMasterForEverything(boolean useMaster)
- Deprecated. use useMasterI18N(boolean useMaster) instead
- Since:
- 1.1.2
useMasterI18N
public static void useMasterI18N(boolean useMaster)
- Since:
- 1.12
setDir
public static void setDir(String directory)
- Set the directory from where to look for i18n files.
Default directory is "i18n" on the root dir. ("/i18n")
To change for WEB-INF/classes/i18n you can call:
LocaleManager.setDir("WEB-INF/classes/i18n");
Notice that this method will also change the location of the master file,
if and only if you never called the setMaster method!
- Parameters:
directory - The new directory for the i18n files.- Since:
- 1.9
getDir
public static String getDir()
- Return the current dir for i18n files.
- Returns:
- The current dir
- Since:
- 1.9
isUseMasterForEverything
public static boolean isUseMasterForEverything()
- Since:
- 1.1.2
add
public static void add(Locale loc)
setMaster
public static void setMaster(String s)
getMaster
public static String getMaster()
add
public static void add(String loc)
getDefaultLocale
public static Locale getDefaultLocale()
getLocales
public static Locale[] getLocales()
getLocaleIds
public static int[] getLocaleIds()
getLocaleFromString
public static Locale getLocaleFromString(String text)
isSupportedLocale
public static boolean isSupportedLocale(Locale loc)
isSupportedLocale
public static boolean isSupportedLocale(String text)
getLocale
public static Locale getLocale(int id)
getId
public static int getId(Locale loc)
getSupportedLocale
public static Locale getSupportedLocale(Locale loc)
getSupportedLocale
public static Locale getSupportedLocale(Locale loc,
Locale def)
getLocale
public static Locale getLocale(javax.servlet.http.HttpServletRequest req)
getLocale
public static Locale getLocale(javax.servlet.http.HttpServletRequest req,
boolean onlySupported)
setDefaultDateMask
public static void setDefaultDateMask(String defaultDateMask)
getDefaultDateMask
public static String getDefaultDateMask()
setDateMask
public static void setDateMask(Locale loc,
String dateMask)
getDateMask
public static String getDateMask(Locale loc)
setDefaultTimeMask
public static void setDefaultTimeMask(String defaultTimeMask)
getDefaultTimeMask
public static String getDefaultTimeMask()
setTimeMask
public static void setTimeMask(Locale loc,
String timeMask)
getTimeMask
public static String getTimeMask(Locale loc)
getSimpleDateFormat
public static SimpleDateFormat getSimpleDateFormat(String mask)
getSimpleDateFormat
public static SimpleDateFormat getSimpleDateFormat(Locale loc)
getSimpleTimeFormat
public static SimpleDateFormat getSimpleTimeFormat(String mask)
getSimpleTimeFormat
public static SimpleDateFormat getSimpleTimeFormat(Locale loc)
Copyright © 2011. All Rights Reserved.