public class LocaleManager extends Object
| Modifier and Type | Field and Description |
|---|---|
static Locale |
FALLBACK_LOCALE |
| Modifier and Type | Method and Description |
|---|---|
static LocaleManager |
from(FileSystem fs,
String languagesPath,
String... textPaths) |
static LocaleManager |
from(com.google.common.collect.ImmutableSet<Locale> availableLocales,
Path... textPaths) |
static LocaleManager |
from(Path languagesPath,
Path... textPaths) |
static LocaleManager |
from(String languagesPath,
String... textPaths) |
String |
get(String key) |
Set<Locale> |
getAvailableLocales() |
Locale |
getLocale() |
static Locale |
getLocaleFromString(String localeString) |
static com.google.common.collect.ImmutableSet<Locale> |
loadAvailableLocales(Path path) |
void |
setLocale(Locale locale) |
boolean |
setLocale(String localeString) |
void |
setLocaleOrFallback(String localeString) |
String |
translate(String string,
Object... objects) |
String |
translate(TextContainer textContainer) |
String |
translateOnly(String prefix,
String string,
Object... objects) |
public static final Locale FALLBACK_LOCALE
public static LocaleManager from(String languagesPath, String... textPaths)
public static LocaleManager from(FileSystem fs, String languagesPath, String... textPaths)
public static LocaleManager from(Path languagesPath, Path... textPaths)
public static LocaleManager from(com.google.common.collect.ImmutableSet<Locale> availableLocales, Path... textPaths)
public static com.google.common.collect.ImmutableSet<Locale> loadAvailableLocales(Path path)
public void setLocaleOrFallback(String localeString)
public boolean setLocale(String localeString)
public String translate(TextContainer textContainer)
public Locale getLocale()
public void setLocale(Locale locale)
Copyright © 2020. All rights reserved.