Lightweight wrapper around LanguageSpec.
More...
#include <language.hpp>
|
static Language | from_spec (const std::string &language, const std::string &country=std::string(), const std::string &modifier=std::string()) |
| Create a language from language and country code: Example: Languge("de", "DE");. More...
|
|
static Language | from_name (const std::string &str) |
| Create a language from language and country code: Example: Languge("deutsch"); Example: Languge("de_DE");. More...
|
|
static Language | from_env (const std::string &env) |
| Create a language from an environment variable style string (e.g de_DE.UTF-8@modifier) More...
|
|
static int | match (const Language &lhs, const Language &rhs) |
| Compares two Languages, returns 0 on missmatch and a score between 1 and 9 on match, the higher the score the better the match. More...
|
|
Lightweight wrapper around LanguageSpec.
◆ Language() [1/2]
tinygettext::Language::Language |
( |
const LanguageSpec * |
language_spec | ) |
|
|
private |
◆ Language() [2/2]
tinygettext::Language::Language |
( |
| ) |
|
◆ from_env()
Language tinygettext::Language::from_env |
( |
const std::string & |
env | ) |
|
|
static |
Create a language from an environment variable style string (e.g de_DE.UTF-8@modifier)
◆ from_name()
Language tinygettext::Language::from_name |
( |
const std::string & |
str | ) |
|
|
static |
Create a language from language and country code: Example: Languge("deutsch"); Example: Languge("de_DE");.
◆ from_spec()
Language tinygettext::Language::from_spec |
( |
const std::string & |
language, |
|
|
const std::string & |
country = std::string() , |
|
|
const std::string & |
modifier = std::string() |
|
) |
| |
|
static |
Create a language from language and country code: Example: Languge("de", "DE");.
◆ get_country()
std::string tinygettext::Language::get_country |
( |
| ) |
const |
Returns the country code (i.e.
DE, AT, US)
◆ get_language()
std::string tinygettext::Language::get_language |
( |
| ) |
const |
Returns the language code (i.e.
de, en, fr)
◆ get_modifier()
std::string tinygettext::Language::get_modifier |
( |
| ) |
const |
Returns the modifier of the language (i.e.
latn or Latn for Serbian with non-cyrilic characters)
◆ get_name()
std::string tinygettext::Language::get_name |
( |
| ) |
const |
Returns the human readable name of the Language.
◆ match()
Compares two Languages, returns 0 on missmatch and a score between 1 and 9 on match, the higher the score the better the match.
◆ operator bool()
tinygettext::Language::operator bool |
( |
| ) |
const |
|
inlineexplicit |
◆ operator!=()
bool tinygettext::Language::operator!= |
( |
const Language & |
rhs | ) |
const |
◆ operator==()
bool tinygettext::Language::operator== |
( |
const Language & |
rhs | ) |
const |
◆ str()
std::string tinygettext::Language::str |
( |
| ) |
const |
Returns the Language as string in the form of an environment variable: {language}_{country}modifier}.
◆ Language_hash
◆ operator<
◆ language_spec
The documentation for this class was generated from the following files:
- /home/docker/jenkins/workspace/technical-docs/source/third_party/tinygettext/include/tinygettext/language.hpp
- /home/docker/jenkins/workspace/technical-docs/source/third_party/tinygettext/src/language.cpp