public class LanguageHelpers extends Object
Constructor and Description |
---|
LanguageHelpers() |
Modifier and Type | Method and Description |
---|---|
static String |
codeToName(String code)
Convert a 2- or 3-letter language code to its (English) name.
|
static Optional<String> |
countryCodeToContinent(String countryCode) |
static String |
countryCodeToName(String code)
Convert and ISO639-2 code to its (English) name.
|
static Optional<Description> |
getBestDescription(Described item,
Optional<Description> priorDescOpt,
String langCode)
Get the best description for a given language code.
|
static Optional<Description> |
getBestDescription(Described item,
String langCode) |
static String |
iso3166dashOneCodeToName(String code)
Convert an ISO 3166-1 country code to its (English) name.
|
static String |
iso639DashOneCode(String nameOrCode)
Take an ISO-639-2 code or a language name and try and map to a valid ISO639-1 code.
|
static String |
iso639DashTwoCode(String nameOrCode)
Take an ISO-639-1 code or a language name and try and map to a valid ISO639-2 code.
|
public static Optional<Description> getBestDescription(Described item, Optional<Description> priorDescOpt, String langCode)
item
- a described itempriorDescOpt
- if the object is hierarchical, the parent-level
descriptionlangCode
- a 3-letter language code.public static Optional<Description> getBestDescription(Described item, String langCode)
public static String iso639DashTwoCode(String nameOrCode)
nameOrCode
- a language code or name to convertpublic static String iso639DashOneCode(String nameOrCode)
nameOrCode
- a language code or name to convertpublic static String codeToName(String code)
If no name can be found the input code will be returned.
code
- a 2- or 3-letter ISO639 codepublic static String iso3166dashOneCodeToName(String code)
code
- the 2-letter country codeCopyright © 2018 The European Holocaust Research Infrastructure (EHRI). All rights reserved.