public class LangTag extends Object
Modifier and Type | Field and Description |
---|---|
static int |
idxExtension
Index of all extensions
|
static int |
idxLanguage
Index of the language part
|
static int |
idxRegion
Index of the region part
|
static int |
idxScript
Index of the script part
|
static int |
idxVariant
Index of the variant part
|
Modifier and Type | Method and Description |
---|---|
static String |
canonical(String str)
Canonicalize with the rules of RFC 4646
|
static String |
canonical(String[] parts)
Canonicalize with the rules of RFC 4646
"In this format, all non-initial two-letter subtags are uppercase, all
non-initial four-letter subtags are titlecase, and all other subtags
are lowercase."
In addition, leave extensions unchanged.
|
static boolean |
check(String languageTag)
Validate - basic syntax check for a language tags: [a-zA-Z]+ ('-' [a-zA-Z0-9]+)*
|
static void |
main(String... args) |
static String[] |
parse(String languageTag)
Parse a langtag string and return it's parts in canonical case.
|
public static final int idxLanguage
public static final int idxScript
public static final int idxRegion
public static final int idxVariant
public static final int idxExtension
public static boolean check(String languageTag)
public static String[] parse(String languageTag)
public static String canonical(String[] parts)
public static void main(String... args)
Licenced under the Apache License, Version 2.0