Skip to content

robot.conf.languages

Languages

1
2
3
4
5
6
Languages(
    languages: (
        Iterable[LanguageLike] | LanguageLike | None
    ) = (),
    add_english: bool = True,
)

Stores languages and unifies translations.

Example::

1
2
3
4
5
languages = Languages('de', add_english=False)
print(languages.settings)
languages = Languages(['pt-BR', 'Finnish', 'MyLang.py'])
for lang in languages:
    print(lang.name, lang.code)

:param languages: Initial language or list of languages. Languages can be given as language codes or names, paths or names of language modules to load, or as :class:Language instances. :param add_english: If True, English is added automatically. :raises: :class:~robot.errors.DataError if a given language is not found.

:meth:add_language can be used to add languages after initialization.

Source code in src/robot/conf/languages.py
def __init__(self, languages: 'Iterable[LanguageLike]|LanguageLike|None' = (),
             add_english: bool = True):
    """
    :param languages: Initial language or list of languages.
        Languages can be given as language codes or names, paths or names of
        language modules to load, or as :class:`Language` instances.
    :param add_english: If True, English is added automatically.
    :raises: :class:`~robot.errors.DataError` if a given language is not found.

    :meth:`add_language` can be used to add languages after initialization.
    """
    self.languages: 'list[Language]' = []
    self.headers: 'dict[str, str]' = {}
    self.settings: 'dict[str, str]' = {}
    self.bdd_prefixes: 'set[str]' = set()
    self.true_strings: 'set[str]' = {'True', '1'}
    self.false_strings: 'set[str]' = {'False', '0', 'None', ''}
    for lang in self._get_languages(languages, add_english):
        self._add_language(lang)
    self._bdd_prefix_regexp = None

reset

1
2
3
4
reset(
    languages: Iterable[LanguageLike] = (),
    add_english: bool = True,
)

Resets the instance to the given languages.

Source code in src/robot/conf/languages.py
def reset(self, languages: Iterable[LanguageLike] = (), add_english: bool = True):
    """Resets the instance to the given languages."""
    self.__init__(languages, add_english)

add_language

add_language(lang: LanguageLike)

Add new language.

:param lang: Language to add. Can be a language code or name, name or path of a language module to load, or a :class:Language instance. :raises: :class:~robot.errors.DataError if the language is not found.

Language codes and names are passed to by :meth:Language.from_name. Language modules are imported and :class:Language subclasses in them loaded.

Source code in src/robot/conf/languages.py
def add_language(self, lang: LanguageLike):
    """Add new language.

    :param lang: Language to add. Can be a language code or name, name or
        path of a language module to load, or a :class:`Language` instance.
    :raises: :class:`~robot.errors.DataError` if the language is not found.

    Language codes and names are passed to by :meth:`Language.from_name`.
    Language modules are imported and :class:`Language` subclasses in them
    loaded.
    """
    if isinstance(lang, Language):
        languages = [lang]
    elif isinstance(lang, Path) or self._exists(Path(lang)):
        languages = self._import_language_module(Path(lang))
    else:
        try:
            languages = [Language.from_name(lang)]
        except ValueError as err1:
            try:
                languages = self._import_language_module(lang)
            except DataError as err2:
                raise DataError(f'{err1} {err2}') from None
    for lang in languages:
        self._add_language(lang)
    self._bdd_prefix_regexp = None

Language

Base class for language definitions.

New translations can be added by extending this class and setting class attributes listed below.

Language :attr:code is got based on the class name and :attr:name based on the docstring.

from_name classmethod

from_name(name) -> Language

Return language class based on given name.

Name can either be a language name (e.g. 'Finnish' or 'Brazilian Portuguese') or a language code (e.g. 'fi' or 'pt-BR'). Matching is case and space insensitive and the hyphen is ignored when matching language codes.

Raises ValueError if no matching language is found.

Source code in src/robot/conf/languages.py
@classmethod
def from_name(cls, name) -> 'Language':
    """Return language class based on given `name`.

    Name can either be a language name (e.g. 'Finnish' or 'Brazilian Portuguese')
    or a language code (e.g. 'fi' or 'pt-BR'). Matching is case and space
    insensitive and the hyphen is ignored when matching language codes.

    Raises `ValueError` if no matching language is found.
    """
    normalized = normalize(name, ignore='-')
    for lang in cls.__subclasses__():
        if normalized == normalize(lang.__name__):
            return lang()
        if lang.__doc__ and normalized == normalize(lang.__doc__.splitlines()[0]):
            return lang()
    raise ValueError(f"No language with name '{name}' found.")

code

code() -> str

Language code like 'fi' or 'pt-BR'.

Got based on the class name. If the class name is two characters (or less), the code is just the name in lower case. If it is longer, a hyphen is added and the remainder of the class name is upper-cased.

This special property can be accessed also directly from the class.

Source code in src/robot/conf/languages.py
@classproperty
def code(cls) -> str:
    """Language code like 'fi' or 'pt-BR'.

    Got based on the class name. If the class name is two characters (or less),
    the code is just the name in lower case. If it is longer, a hyphen is added
    and the remainder of the class name is upper-cased.

    This special property can be accessed also directly from the class.
    """
    if cls is Language:
        return cls.__dict__['code']
    code = cast(type, cls).__name__.lower()
    if len(code) < 3:
        return code
    return f'{code[:2]}-{code[2:].upper()}'

name

name() -> str

Language name like 'Finnish' or 'Brazilian Portuguese'.

Got from the first line of the class docstring.

This special property can be accessed also directly from the class.

Source code in src/robot/conf/languages.py
@classproperty
def name(cls) -> str:
    """Language name like 'Finnish' or 'Brazilian Portuguese'.

    Got from the first line of the class docstring.

    This special property can be accessed also directly from the class.
    """
    if cls is Language:
        return cls.__dict__['name']
    return cls.__doc__.splitlines()[0] if cls.__doc__ else ''

En

Bases: Language

English

from_name classmethod

from_name(name) -> Language

Return language class based on given name.

Name can either be a language name (e.g. 'Finnish' or 'Brazilian Portuguese') or a language code (e.g. 'fi' or 'pt-BR'). Matching is case and space insensitive and the hyphen is ignored when matching language codes.

Raises ValueError if no matching language is found.

Source code in src/robot/conf/languages.py
@classmethod
def from_name(cls, name) -> 'Language':
    """Return language class based on given `name`.

    Name can either be a language name (e.g. 'Finnish' or 'Brazilian Portuguese')
    or a language code (e.g. 'fi' or 'pt-BR'). Matching is case and space
    insensitive and the hyphen is ignored when matching language codes.

    Raises `ValueError` if no matching language is found.
    """
    normalized = normalize(name, ignore='-')
    for lang in cls.__subclasses__():
        if normalized == normalize(lang.__name__):
            return lang()
        if lang.__doc__ and normalized == normalize(lang.__doc__.splitlines()[0]):
            return lang()
    raise ValueError(f"No language with name '{name}' found.")

code

code() -> str

Language code like 'fi' or 'pt-BR'.

Got based on the class name. If the class name is two characters (or less), the code is just the name in lower case. If it is longer, a hyphen is added and the remainder of the class name is upper-cased.

This special property can be accessed also directly from the class.

Source code in src/robot/conf/languages.py
@classproperty
def code(cls) -> str:
    """Language code like 'fi' or 'pt-BR'.

    Got based on the class name. If the class name is two characters (or less),
    the code is just the name in lower case. If it is longer, a hyphen is added
    and the remainder of the class name is upper-cased.

    This special property can be accessed also directly from the class.
    """
    if cls is Language:
        return cls.__dict__['code']
    code = cast(type, cls).__name__.lower()
    if len(code) < 3:
        return code
    return f'{code[:2]}-{code[2:].upper()}'

name

name() -> str

Language name like 'Finnish' or 'Brazilian Portuguese'.

Got from the first line of the class docstring.

This special property can be accessed also directly from the class.

Source code in src/robot/conf/languages.py
@classproperty
def name(cls) -> str:
    """Language name like 'Finnish' or 'Brazilian Portuguese'.

    Got from the first line of the class docstring.

    This special property can be accessed also directly from the class.
    """
    if cls is Language:
        return cls.__dict__['name']
    return cls.__doc__.splitlines()[0] if cls.__doc__ else ''

Cs

Bases: Language

Czech

from_name classmethod

from_name(name) -> Language

Return language class based on given name.

Name can either be a language name (e.g. 'Finnish' or 'Brazilian Portuguese') or a language code (e.g. 'fi' or 'pt-BR'). Matching is case and space insensitive and the hyphen is ignored when matching language codes.

Raises ValueError if no matching language is found.

Source code in src/robot/conf/languages.py
@classmethod
def from_name(cls, name) -> 'Language':
    """Return language class based on given `name`.

    Name can either be a language name (e.g. 'Finnish' or 'Brazilian Portuguese')
    or a language code (e.g. 'fi' or 'pt-BR'). Matching is case and space
    insensitive and the hyphen is ignored when matching language codes.

    Raises `ValueError` if no matching language is found.
    """
    normalized = normalize(name, ignore='-')
    for lang in cls.__subclasses__():
        if normalized == normalize(lang.__name__):
            return lang()
        if lang.__doc__ and normalized == normalize(lang.__doc__.splitlines()[0]):
            return lang()
    raise ValueError(f"No language with name '{name}' found.")

code

code() -> str

Language code like 'fi' or 'pt-BR'.

Got based on the class name. If the class name is two characters (or less), the code is just the name in lower case. If it is longer, a hyphen is added and the remainder of the class name is upper-cased.

This special property can be accessed also directly from the class.

Source code in src/robot/conf/languages.py
@classproperty
def code(cls) -> str:
    """Language code like 'fi' or 'pt-BR'.

    Got based on the class name. If the class name is two characters (or less),
    the code is just the name in lower case. If it is longer, a hyphen is added
    and the remainder of the class name is upper-cased.

    This special property can be accessed also directly from the class.
    """
    if cls is Language:
        return cls.__dict__['code']
    code = cast(type, cls).__name__.lower()
    if len(code) < 3:
        return code
    return f'{code[:2]}-{code[2:].upper()}'

name

name() -> str

Language name like 'Finnish' or 'Brazilian Portuguese'.

Got from the first line of the class docstring.

This special property can be accessed also directly from the class.

Source code in src/robot/conf/languages.py
@classproperty
def name(cls) -> str:
    """Language name like 'Finnish' or 'Brazilian Portuguese'.

    Got from the first line of the class docstring.

    This special property can be accessed also directly from the class.
    """
    if cls is Language:
        return cls.__dict__['name']
    return cls.__doc__.splitlines()[0] if cls.__doc__ else ''

Nl

Bases: Language

Dutch

from_name classmethod

from_name(name) -> Language

Return language class based on given name.

Name can either be a language name (e.g. 'Finnish' or 'Brazilian Portuguese') or a language code (e.g. 'fi' or 'pt-BR'). Matching is case and space insensitive and the hyphen is ignored when matching language codes.

Raises ValueError if no matching language is found.

Source code in src/robot/conf/languages.py
@classmethod
def from_name(cls, name) -> 'Language':
    """Return language class based on given `name`.

    Name can either be a language name (e.g. 'Finnish' or 'Brazilian Portuguese')
    or a language code (e.g. 'fi' or 'pt-BR'). Matching is case and space
    insensitive and the hyphen is ignored when matching language codes.

    Raises `ValueError` if no matching language is found.
    """
    normalized = normalize(name, ignore='-')
    for lang in cls.__subclasses__():
        if normalized == normalize(lang.__name__):
            return lang()
        if lang.__doc__ and normalized == normalize(lang.__doc__.splitlines()[0]):
            return lang()
    raise ValueError(f"No language with name '{name}' found.")

code

code() -> str

Language code like 'fi' or 'pt-BR'.

Got based on the class name. If the class name is two characters (or less), the code is just the name in lower case. If it is longer, a hyphen is added and the remainder of the class name is upper-cased.

This special property can be accessed also directly from the class.

Source code in src/robot/conf/languages.py
@classproperty
def code(cls) -> str:
    """Language code like 'fi' or 'pt-BR'.

    Got based on the class name. If the class name is two characters (or less),
    the code is just the name in lower case. If it is longer, a hyphen is added
    and the remainder of the class name is upper-cased.

    This special property can be accessed also directly from the class.
    """
    if cls is Language:
        return cls.__dict__['code']
    code = cast(type, cls).__name__.lower()
    if len(code) < 3:
        return code
    return f'{code[:2]}-{code[2:].upper()}'

name

name() -> str

Language name like 'Finnish' or 'Brazilian Portuguese'.

Got from the first line of the class docstring.

This special property can be accessed also directly from the class.

Source code in src/robot/conf/languages.py
@classproperty
def name(cls) -> str:
    """Language name like 'Finnish' or 'Brazilian Portuguese'.

    Got from the first line of the class docstring.

    This special property can be accessed also directly from the class.
    """
    if cls is Language:
        return cls.__dict__['name']
    return cls.__doc__.splitlines()[0] if cls.__doc__ else ''

Bs

Bases: Language

Bosnian

from_name classmethod

from_name(name) -> Language

Return language class based on given name.

Name can either be a language name (e.g. 'Finnish' or 'Brazilian Portuguese') or a language code (e.g. 'fi' or 'pt-BR'). Matching is case and space insensitive and the hyphen is ignored when matching language codes.

Raises ValueError if no matching language is found.

Source code in src/robot/conf/languages.py
@classmethod
def from_name(cls, name) -> 'Language':
    """Return language class based on given `name`.

    Name can either be a language name (e.g. 'Finnish' or 'Brazilian Portuguese')
    or a language code (e.g. 'fi' or 'pt-BR'). Matching is case and space
    insensitive and the hyphen is ignored when matching language codes.

    Raises `ValueError` if no matching language is found.
    """
    normalized = normalize(name, ignore='-')
    for lang in cls.__subclasses__():
        if normalized == normalize(lang.__name__):
            return lang()
        if lang.__doc__ and normalized == normalize(lang.__doc__.splitlines()[0]):
            return lang()
    raise ValueError(f"No language with name '{name}' found.")

code

code() -> str

Language code like 'fi' or 'pt-BR'.

Got based on the class name. If the class name is two characters (or less), the code is just the name in lower case. If it is longer, a hyphen is added and the remainder of the class name is upper-cased.

This special property can be accessed also directly from the class.

Source code in src/robot/conf/languages.py
@classproperty
def code(cls) -> str:
    """Language code like 'fi' or 'pt-BR'.

    Got based on the class name. If the class name is two characters (or less),
    the code is just the name in lower case. If it is longer, a hyphen is added
    and the remainder of the class name is upper-cased.

    This special property can be accessed also directly from the class.
    """
    if cls is Language:
        return cls.__dict__['code']
    code = cast(type, cls).__name__.lower()
    if len(code) < 3:
        return code
    return f'{code[:2]}-{code[2:].upper()}'

name

name() -> str

Language name like 'Finnish' or 'Brazilian Portuguese'.

Got from the first line of the class docstring.

This special property can be accessed also directly from the class.

Source code in src/robot/conf/languages.py
@classproperty
def name(cls) -> str:
    """Language name like 'Finnish' or 'Brazilian Portuguese'.

    Got from the first line of the class docstring.

    This special property can be accessed also directly from the class.
    """
    if cls is Language:
        return cls.__dict__['name']
    return cls.__doc__.splitlines()[0] if cls.__doc__ else ''

Fi

Bases: Language

Finnish

from_name classmethod

from_name(name) -> Language

Return language class based on given name.

Name can either be a language name (e.g. 'Finnish' or 'Brazilian Portuguese') or a language code (e.g. 'fi' or 'pt-BR'). Matching is case and space insensitive and the hyphen is ignored when matching language codes.

Raises ValueError if no matching language is found.

Source code in src/robot/conf/languages.py
@classmethod
def from_name(cls, name) -> 'Language':
    """Return language class based on given `name`.

    Name can either be a language name (e.g. 'Finnish' or 'Brazilian Portuguese')
    or a language code (e.g. 'fi' or 'pt-BR'). Matching is case and space
    insensitive and the hyphen is ignored when matching language codes.

    Raises `ValueError` if no matching language is found.
    """
    normalized = normalize(name, ignore='-')
    for lang in cls.__subclasses__():
        if normalized == normalize(lang.__name__):
            return lang()
        if lang.__doc__ and normalized == normalize(lang.__doc__.splitlines()[0]):
            return lang()
    raise ValueError(f"No language with name '{name}' found.")

code

code() -> str

Language code like 'fi' or 'pt-BR'.

Got based on the class name. If the class name is two characters (or less), the code is just the name in lower case. If it is longer, a hyphen is added and the remainder of the class name is upper-cased.

This special property can be accessed also directly from the class.

Source code in src/robot/conf/languages.py
@classproperty
def code(cls) -> str:
    """Language code like 'fi' or 'pt-BR'.

    Got based on the class name. If the class name is two characters (or less),
    the code is just the name in lower case. If it is longer, a hyphen is added
    and the remainder of the class name is upper-cased.

    This special property can be accessed also directly from the class.
    """
    if cls is Language:
        return cls.__dict__['code']
    code = cast(type, cls).__name__.lower()
    if len(code) < 3:
        return code
    return f'{code[:2]}-{code[2:].upper()}'

name

name() -> str

Language name like 'Finnish' or 'Brazilian Portuguese'.

Got from the first line of the class docstring.

This special property can be accessed also directly from the class.

Source code in src/robot/conf/languages.py
@classproperty
def name(cls) -> str:
    """Language name like 'Finnish' or 'Brazilian Portuguese'.

    Got from the first line of the class docstring.

    This special property can be accessed also directly from the class.
    """
    if cls is Language:
        return cls.__dict__['name']
    return cls.__doc__.splitlines()[0] if cls.__doc__ else ''

Fr

Bases: Language

French

from_name classmethod

from_name(name) -> Language

Return language class based on given name.

Name can either be a language name (e.g. 'Finnish' or 'Brazilian Portuguese') or a language code (e.g. 'fi' or 'pt-BR'). Matching is case and space insensitive and the hyphen is ignored when matching language codes.

Raises ValueError if no matching language is found.

Source code in src/robot/conf/languages.py
@classmethod
def from_name(cls, name) -> 'Language':
    """Return language class based on given `name`.

    Name can either be a language name (e.g. 'Finnish' or 'Brazilian Portuguese')
    or a language code (e.g. 'fi' or 'pt-BR'). Matching is case and space
    insensitive and the hyphen is ignored when matching language codes.

    Raises `ValueError` if no matching language is found.
    """
    normalized = normalize(name, ignore='-')
    for lang in cls.__subclasses__():
        if normalized == normalize(lang.__name__):
            return lang()
        if lang.__doc__ and normalized == normalize(lang.__doc__.splitlines()[0]):
            return lang()
    raise ValueError(f"No language with name '{name}' found.")

code

code() -> str

Language code like 'fi' or 'pt-BR'.

Got based on the class name. If the class name is two characters (or less), the code is just the name in lower case. If it is longer, a hyphen is added and the remainder of the class name is upper-cased.

This special property can be accessed also directly from the class.

Source code in src/robot/conf/languages.py
@classproperty
def code(cls) -> str:
    """Language code like 'fi' or 'pt-BR'.

    Got based on the class name. If the class name is two characters (or less),
    the code is just the name in lower case. If it is longer, a hyphen is added
    and the remainder of the class name is upper-cased.

    This special property can be accessed also directly from the class.
    """
    if cls is Language:
        return cls.__dict__['code']
    code = cast(type, cls).__name__.lower()
    if len(code) < 3:
        return code
    return f'{code[:2]}-{code[2:].upper()}'

name

name() -> str

Language name like 'Finnish' or 'Brazilian Portuguese'.

Got from the first line of the class docstring.

This special property can be accessed also directly from the class.

Source code in src/robot/conf/languages.py
@classproperty
def name(cls) -> str:
    """Language name like 'Finnish' or 'Brazilian Portuguese'.

    Got from the first line of the class docstring.

    This special property can be accessed also directly from the class.
    """
    if cls is Language:
        return cls.__dict__['name']
    return cls.__doc__.splitlines()[0] if cls.__doc__ else ''

De

Bases: Language

German

from_name classmethod

from_name(name) -> Language

Return language class based on given name.

Name can either be a language name (e.g. 'Finnish' or 'Brazilian Portuguese') or a language code (e.g. 'fi' or 'pt-BR'). Matching is case and space insensitive and the hyphen is ignored when matching language codes.

Raises ValueError if no matching language is found.

Source code in src/robot/conf/languages.py
@classmethod
def from_name(cls, name) -> 'Language':
    """Return language class based on given `name`.

    Name can either be a language name (e.g. 'Finnish' or 'Brazilian Portuguese')
    or a language code (e.g. 'fi' or 'pt-BR'). Matching is case and space
    insensitive and the hyphen is ignored when matching language codes.

    Raises `ValueError` if no matching language is found.
    """
    normalized = normalize(name, ignore='-')
    for lang in cls.__subclasses__():
        if normalized == normalize(lang.__name__):
            return lang()
        if lang.__doc__ and normalized == normalize(lang.__doc__.splitlines()[0]):
            return lang()
    raise ValueError(f"No language with name '{name}' found.")

code

code() -> str

Language code like 'fi' or 'pt-BR'.

Got based on the class name. If the class name is two characters (or less), the code is just the name in lower case. If it is longer, a hyphen is added and the remainder of the class name is upper-cased.

This special property can be accessed also directly from the class.

Source code in src/robot/conf/languages.py
@classproperty
def code(cls) -> str:
    """Language code like 'fi' or 'pt-BR'.

    Got based on the class name. If the class name is two characters (or less),
    the code is just the name in lower case. If it is longer, a hyphen is added
    and the remainder of the class name is upper-cased.

    This special property can be accessed also directly from the class.
    """
    if cls is Language:
        return cls.__dict__['code']
    code = cast(type, cls).__name__.lower()
    if len(code) < 3:
        return code
    return f'{code[:2]}-{code[2:].upper()}'

name

name() -> str

Language name like 'Finnish' or 'Brazilian Portuguese'.

Got from the first line of the class docstring.

This special property can be accessed also directly from the class.

Source code in src/robot/conf/languages.py
@classproperty
def name(cls) -> str:
    """Language name like 'Finnish' or 'Brazilian Portuguese'.

    Got from the first line of the class docstring.

    This special property can be accessed also directly from the class.
    """
    if cls is Language:
        return cls.__dict__['name']
    return cls.__doc__.splitlines()[0] if cls.__doc__ else ''

PtBr

Bases: Language

Brazilian Portuguese

from_name classmethod

from_name(name) -> Language

Return language class based on given name.

Name can either be a language name (e.g. 'Finnish' or 'Brazilian Portuguese') or a language code (e.g. 'fi' or 'pt-BR'). Matching is case and space insensitive and the hyphen is ignored when matching language codes.

Raises ValueError if no matching language is found.

Source code in src/robot/conf/languages.py
@classmethod
def from_name(cls, name) -> 'Language':
    """Return language class based on given `name`.

    Name can either be a language name (e.g. 'Finnish' or 'Brazilian Portuguese')
    or a language code (e.g. 'fi' or 'pt-BR'). Matching is case and space
    insensitive and the hyphen is ignored when matching language codes.

    Raises `ValueError` if no matching language is found.
    """
    normalized = normalize(name, ignore='-')
    for lang in cls.__subclasses__():
        if normalized == normalize(lang.__name__):
            return lang()
        if lang.__doc__ and normalized == normalize(lang.__doc__.splitlines()[0]):
            return lang()
    raise ValueError(f"No language with name '{name}' found.")

code

code() -> str

Language code like 'fi' or 'pt-BR'.

Got based on the class name. If the class name is two characters (or less), the code is just the name in lower case. If it is longer, a hyphen is added and the remainder of the class name is upper-cased.

This special property can be accessed also directly from the class.

Source code in src/robot/conf/languages.py
@classproperty
def code(cls) -> str:
    """Language code like 'fi' or 'pt-BR'.

    Got based on the class name. If the class name is two characters (or less),
    the code is just the name in lower case. If it is longer, a hyphen is added
    and the remainder of the class name is upper-cased.

    This special property can be accessed also directly from the class.
    """
    if cls is Language:
        return cls.__dict__['code']
    code = cast(type, cls).__name__.lower()
    if len(code) < 3:
        return code
    return f'{code[:2]}-{code[2:].upper()}'

name

name() -> str

Language name like 'Finnish' or 'Brazilian Portuguese'.

Got from the first line of the class docstring.

This special property can be accessed also directly from the class.

Source code in src/robot/conf/languages.py
@classproperty
def name(cls) -> str:
    """Language name like 'Finnish' or 'Brazilian Portuguese'.

    Got from the first line of the class docstring.

    This special property can be accessed also directly from the class.
    """
    if cls is Language:
        return cls.__dict__['name']
    return cls.__doc__.splitlines()[0] if cls.__doc__ else ''

Pt

Bases: Language

Portuguese

from_name classmethod

from_name(name) -> Language

Return language class based on given name.

Name can either be a language name (e.g. 'Finnish' or 'Brazilian Portuguese') or a language code (e.g. 'fi' or 'pt-BR'). Matching is case and space insensitive and the hyphen is ignored when matching language codes.

Raises ValueError if no matching language is found.

Source code in src/robot/conf/languages.py
@classmethod
def from_name(cls, name) -> 'Language':
    """Return language class based on given `name`.

    Name can either be a language name (e.g. 'Finnish' or 'Brazilian Portuguese')
    or a language code (e.g. 'fi' or 'pt-BR'). Matching is case and space
    insensitive and the hyphen is ignored when matching language codes.

    Raises `ValueError` if no matching language is found.
    """
    normalized = normalize(name, ignore='-')
    for lang in cls.__subclasses__():
        if normalized == normalize(lang.__name__):
            return lang()
        if lang.__doc__ and normalized == normalize(lang.__doc__.splitlines()[0]):
            return lang()
    raise ValueError(f"No language with name '{name}' found.")

code

code() -> str

Language code like 'fi' or 'pt-BR'.

Got based on the class name. If the class name is two characters (or less), the code is just the name in lower case. If it is longer, a hyphen is added and the remainder of the class name is upper-cased.

This special property can be accessed also directly from the class.

Source code in src/robot/conf/languages.py
@classproperty
def code(cls) -> str:
    """Language code like 'fi' or 'pt-BR'.

    Got based on the class name. If the class name is two characters (or less),
    the code is just the name in lower case. If it is longer, a hyphen is added
    and the remainder of the class name is upper-cased.

    This special property can be accessed also directly from the class.
    """
    if cls is Language:
        return cls.__dict__['code']
    code = cast(type, cls).__name__.lower()
    if len(code) < 3:
        return code
    return f'{code[:2]}-{code[2:].upper()}'

name

name() -> str

Language name like 'Finnish' or 'Brazilian Portuguese'.

Got from the first line of the class docstring.

This special property can be accessed also directly from the class.

Source code in src/robot/conf/languages.py
@classproperty
def name(cls) -> str:
    """Language name like 'Finnish' or 'Brazilian Portuguese'.

    Got from the first line of the class docstring.

    This special property can be accessed also directly from the class.
    """
    if cls is Language:
        return cls.__dict__['name']
    return cls.__doc__.splitlines()[0] if cls.__doc__ else ''

Th

Bases: Language

Thai

from_name classmethod

from_name(name) -> Language

Return language class based on given name.

Name can either be a language name (e.g. 'Finnish' or 'Brazilian Portuguese') or a language code (e.g. 'fi' or 'pt-BR'). Matching is case and space insensitive and the hyphen is ignored when matching language codes.

Raises ValueError if no matching language is found.

Source code in src/robot/conf/languages.py
@classmethod
def from_name(cls, name) -> 'Language':
    """Return language class based on given `name`.

    Name can either be a language name (e.g. 'Finnish' or 'Brazilian Portuguese')
    or a language code (e.g. 'fi' or 'pt-BR'). Matching is case and space
    insensitive and the hyphen is ignored when matching language codes.

    Raises `ValueError` if no matching language is found.
    """
    normalized = normalize(name, ignore='-')
    for lang in cls.__subclasses__():
        if normalized == normalize(lang.__name__):
            return lang()
        if lang.__doc__ and normalized == normalize(lang.__doc__.splitlines()[0]):
            return lang()
    raise ValueError(f"No language with name '{name}' found.")

code

code() -> str

Language code like 'fi' or 'pt-BR'.

Got based on the class name. If the class name is two characters (or less), the code is just the name in lower case. If it is longer, a hyphen is added and the remainder of the class name is upper-cased.

This special property can be accessed also directly from the class.

Source code in src/robot/conf/languages.py
@classproperty
def code(cls) -> str:
    """Language code like 'fi' or 'pt-BR'.

    Got based on the class name. If the class name is two characters (or less),
    the code is just the name in lower case. If it is longer, a hyphen is added
    and the remainder of the class name is upper-cased.

    This special property can be accessed also directly from the class.
    """
    if cls is Language:
        return cls.__dict__['code']
    code = cast(type, cls).__name__.lower()
    if len(code) < 3:
        return code
    return f'{code[:2]}-{code[2:].upper()}'

name

name() -> str

Language name like 'Finnish' or 'Brazilian Portuguese'.

Got from the first line of the class docstring.

This special property can be accessed also directly from the class.

Source code in src/robot/conf/languages.py
@classproperty
def name(cls) -> str:
    """Language name like 'Finnish' or 'Brazilian Portuguese'.

    Got from the first line of the class docstring.

    This special property can be accessed also directly from the class.
    """
    if cls is Language:
        return cls.__dict__['name']
    return cls.__doc__.splitlines()[0] if cls.__doc__ else ''

Pl

Bases: Language

Polish

from_name classmethod

from_name(name) -> Language

Return language class based on given name.

Name can either be a language name (e.g. 'Finnish' or 'Brazilian Portuguese') or a language code (e.g. 'fi' or 'pt-BR'). Matching is case and space insensitive and the hyphen is ignored when matching language codes.

Raises ValueError if no matching language is found.

Source code in src/robot/conf/languages.py
@classmethod
def from_name(cls, name) -> 'Language':
    """Return language class based on given `name`.

    Name can either be a language name (e.g. 'Finnish' or 'Brazilian Portuguese')
    or a language code (e.g. 'fi' or 'pt-BR'). Matching is case and space
    insensitive and the hyphen is ignored when matching language codes.

    Raises `ValueError` if no matching language is found.
    """
    normalized = normalize(name, ignore='-')
    for lang in cls.__subclasses__():
        if normalized == normalize(lang.__name__):
            return lang()
        if lang.__doc__ and normalized == normalize(lang.__doc__.splitlines()[0]):
            return lang()
    raise ValueError(f"No language with name '{name}' found.")

code

code() -> str

Language code like 'fi' or 'pt-BR'.

Got based on the class name. If the class name is two characters (or less), the code is just the name in lower case. If it is longer, a hyphen is added and the remainder of the class name is upper-cased.

This special property can be accessed also directly from the class.

Source code in src/robot/conf/languages.py
@classproperty
def code(cls) -> str:
    """Language code like 'fi' or 'pt-BR'.

    Got based on the class name. If the class name is two characters (or less),
    the code is just the name in lower case. If it is longer, a hyphen is added
    and the remainder of the class name is upper-cased.

    This special property can be accessed also directly from the class.
    """
    if cls is Language:
        return cls.__dict__['code']
    code = cast(type, cls).__name__.lower()
    if len(code) < 3:
        return code
    return f'{code[:2]}-{code[2:].upper()}'

name

name() -> str

Language name like 'Finnish' or 'Brazilian Portuguese'.

Got from the first line of the class docstring.

This special property can be accessed also directly from the class.

Source code in src/robot/conf/languages.py
@classproperty
def name(cls) -> str:
    """Language name like 'Finnish' or 'Brazilian Portuguese'.

    Got from the first line of the class docstring.

    This special property can be accessed also directly from the class.
    """
    if cls is Language:
        return cls.__dict__['name']
    return cls.__doc__.splitlines()[0] if cls.__doc__ else ''

Uk

Bases: Language

Ukrainian

from_name classmethod

from_name(name) -> Language

Return language class based on given name.

Name can either be a language name (e.g. 'Finnish' or 'Brazilian Portuguese') or a language code (e.g. 'fi' or 'pt-BR'). Matching is case and space insensitive and the hyphen is ignored when matching language codes.

Raises ValueError if no matching language is found.

Source code in src/robot/conf/languages.py
@classmethod
def from_name(cls, name) -> 'Language':
    """Return language class based on given `name`.

    Name can either be a language name (e.g. 'Finnish' or 'Brazilian Portuguese')
    or a language code (e.g. 'fi' or 'pt-BR'). Matching is case and space
    insensitive and the hyphen is ignored when matching language codes.

    Raises `ValueError` if no matching language is found.
    """
    normalized = normalize(name, ignore='-')
    for lang in cls.__subclasses__():
        if normalized == normalize(lang.__name__):
            return lang()
        if lang.__doc__ and normalized == normalize(lang.__doc__.splitlines()[0]):
            return lang()
    raise ValueError(f"No language with name '{name}' found.")

code

code() -> str

Language code like 'fi' or 'pt-BR'.

Got based on the class name. If the class name is two characters (or less), the code is just the name in lower case. If it is longer, a hyphen is added and the remainder of the class name is upper-cased.

This special property can be accessed also directly from the class.

Source code in src/robot/conf/languages.py
@classproperty
def code(cls) -> str:
    """Language code like 'fi' or 'pt-BR'.

    Got based on the class name. If the class name is two characters (or less),
    the code is just the name in lower case. If it is longer, a hyphen is added
    and the remainder of the class name is upper-cased.

    This special property can be accessed also directly from the class.
    """
    if cls is Language:
        return cls.__dict__['code']
    code = cast(type, cls).__name__.lower()
    if len(code) < 3:
        return code
    return f'{code[:2]}-{code[2:].upper()}'

name

name() -> str

Language name like 'Finnish' or 'Brazilian Portuguese'.

Got from the first line of the class docstring.

This special property can be accessed also directly from the class.

Source code in src/robot/conf/languages.py
@classproperty
def name(cls) -> str:
    """Language name like 'Finnish' or 'Brazilian Portuguese'.

    Got from the first line of the class docstring.

    This special property can be accessed also directly from the class.
    """
    if cls is Language:
        return cls.__dict__['name']
    return cls.__doc__.splitlines()[0] if cls.__doc__ else ''

Es

Bases: Language

Spanish

from_name classmethod

from_name(name) -> Language

Return language class based on given name.

Name can either be a language name (e.g. 'Finnish' or 'Brazilian Portuguese') or a language code (e.g. 'fi' or 'pt-BR'). Matching is case and space insensitive and the hyphen is ignored when matching language codes.

Raises ValueError if no matching language is found.

Source code in src/robot/conf/languages.py
@classmethod
def from_name(cls, name) -> 'Language':
    """Return language class based on given `name`.

    Name can either be a language name (e.g. 'Finnish' or 'Brazilian Portuguese')
    or a language code (e.g. 'fi' or 'pt-BR'). Matching is case and space
    insensitive and the hyphen is ignored when matching language codes.

    Raises `ValueError` if no matching language is found.
    """
    normalized = normalize(name, ignore='-')
    for lang in cls.__subclasses__():
        if normalized == normalize(lang.__name__):
            return lang()
        if lang.__doc__ and normalized == normalize(lang.__doc__.splitlines()[0]):
            return lang()
    raise ValueError(f"No language with name '{name}' found.")

code

code() -> str

Language code like 'fi' or 'pt-BR'.

Got based on the class name. If the class name is two characters (or less), the code is just the name in lower case. If it is longer, a hyphen is added and the remainder of the class name is upper-cased.

This special property can be accessed also directly from the class.

Source code in src/robot/conf/languages.py
@classproperty
def code(cls) -> str:
    """Language code like 'fi' or 'pt-BR'.

    Got based on the class name. If the class name is two characters (or less),
    the code is just the name in lower case. If it is longer, a hyphen is added
    and the remainder of the class name is upper-cased.

    This special property can be accessed also directly from the class.
    """
    if cls is Language:
        return cls.__dict__['code']
    code = cast(type, cls).__name__.lower()
    if len(code) < 3:
        return code
    return f'{code[:2]}-{code[2:].upper()}'

name

name() -> str

Language name like 'Finnish' or 'Brazilian Portuguese'.

Got from the first line of the class docstring.

This special property can be accessed also directly from the class.

Source code in src/robot/conf/languages.py
@classproperty
def name(cls) -> str:
    """Language name like 'Finnish' or 'Brazilian Portuguese'.

    Got from the first line of the class docstring.

    This special property can be accessed also directly from the class.
    """
    if cls is Language:
        return cls.__dict__['name']
    return cls.__doc__.splitlines()[0] if cls.__doc__ else ''

Ru

Bases: Language

Russian

from_name classmethod

from_name(name) -> Language

Return language class based on given name.

Name can either be a language name (e.g. 'Finnish' or 'Brazilian Portuguese') or a language code (e.g. 'fi' or 'pt-BR'). Matching is case and space insensitive and the hyphen is ignored when matching language codes.

Raises ValueError if no matching language is found.

Source code in src/robot/conf/languages.py
@classmethod
def from_name(cls, name) -> 'Language':
    """Return language class based on given `name`.

    Name can either be a language name (e.g. 'Finnish' or 'Brazilian Portuguese')
    or a language code (e.g. 'fi' or 'pt-BR'). Matching is case and space
    insensitive and the hyphen is ignored when matching language codes.

    Raises `ValueError` if no matching language is found.
    """
    normalized = normalize(name, ignore='-')
    for lang in cls.__subclasses__():
        if normalized == normalize(lang.__name__):
            return lang()
        if lang.__doc__ and normalized == normalize(lang.__doc__.splitlines()[0]):
            return lang()
    raise ValueError(f"No language with name '{name}' found.")

code

code() -> str

Language code like 'fi' or 'pt-BR'.

Got based on the class name. If the class name is two characters (or less), the code is just the name in lower case. If it is longer, a hyphen is added and the remainder of the class name is upper-cased.

This special property can be accessed also directly from the class.

Source code in src/robot/conf/languages.py
@classproperty
def code(cls) -> str:
    """Language code like 'fi' or 'pt-BR'.

    Got based on the class name. If the class name is two characters (or less),
    the code is just the name in lower case. If it is longer, a hyphen is added
    and the remainder of the class name is upper-cased.

    This special property can be accessed also directly from the class.
    """
    if cls is Language:
        return cls.__dict__['code']
    code = cast(type, cls).__name__.lower()
    if len(code) < 3:
        return code
    return f'{code[:2]}-{code[2:].upper()}'

name

name() -> str

Language name like 'Finnish' or 'Brazilian Portuguese'.

Got from the first line of the class docstring.

This special property can be accessed also directly from the class.

Source code in src/robot/conf/languages.py
@classproperty
def name(cls) -> str:
    """Language name like 'Finnish' or 'Brazilian Portuguese'.

    Got from the first line of the class docstring.

    This special property can be accessed also directly from the class.
    """
    if cls is Language:
        return cls.__dict__['name']
    return cls.__doc__.splitlines()[0] if cls.__doc__ else ''

ZhCn

Bases: Language

Chinese Simplified

from_name classmethod

from_name(name) -> Language

Return language class based on given name.

Name can either be a language name (e.g. 'Finnish' or 'Brazilian Portuguese') or a language code (e.g. 'fi' or 'pt-BR'). Matching is case and space insensitive and the hyphen is ignored when matching language codes.

Raises ValueError if no matching language is found.

Source code in src/robot/conf/languages.py
@classmethod
def from_name(cls, name) -> 'Language':
    """Return language class based on given `name`.

    Name can either be a language name (e.g. 'Finnish' or 'Brazilian Portuguese')
    or a language code (e.g. 'fi' or 'pt-BR'). Matching is case and space
    insensitive and the hyphen is ignored when matching language codes.

    Raises `ValueError` if no matching language is found.
    """
    normalized = normalize(name, ignore='-')
    for lang in cls.__subclasses__():
        if normalized == normalize(lang.__name__):
            return lang()
        if lang.__doc__ and normalized == normalize(lang.__doc__.splitlines()[0]):
            return lang()
    raise ValueError(f"No language with name '{name}' found.")

code

code() -> str

Language code like 'fi' or 'pt-BR'.

Got based on the class name. If the class name is two characters (or less), the code is just the name in lower case. If it is longer, a hyphen is added and the remainder of the class name is upper-cased.

This special property can be accessed also directly from the class.

Source code in src/robot/conf/languages.py
@classproperty
def code(cls) -> str:
    """Language code like 'fi' or 'pt-BR'.

    Got based on the class name. If the class name is two characters (or less),
    the code is just the name in lower case. If it is longer, a hyphen is added
    and the remainder of the class name is upper-cased.

    This special property can be accessed also directly from the class.
    """
    if cls is Language:
        return cls.__dict__['code']
    code = cast(type, cls).__name__.lower()
    if len(code) < 3:
        return code
    return f'{code[:2]}-{code[2:].upper()}'

name

name() -> str

Language name like 'Finnish' or 'Brazilian Portuguese'.

Got from the first line of the class docstring.

This special property can be accessed also directly from the class.

Source code in src/robot/conf/languages.py
@classproperty
def name(cls) -> str:
    """Language name like 'Finnish' or 'Brazilian Portuguese'.

    Got from the first line of the class docstring.

    This special property can be accessed also directly from the class.
    """
    if cls is Language:
        return cls.__dict__['name']
    return cls.__doc__.splitlines()[0] if cls.__doc__ else ''

ZhTw

Bases: Language

Chinese Traditional

from_name classmethod

from_name(name) -> Language

Return language class based on given name.

Name can either be a language name (e.g. 'Finnish' or 'Brazilian Portuguese') or a language code (e.g. 'fi' or 'pt-BR'). Matching is case and space insensitive and the hyphen is ignored when matching language codes.

Raises ValueError if no matching language is found.

Source code in src/robot/conf/languages.py
@classmethod
def from_name(cls, name) -> 'Language':
    """Return language class based on given `name`.

    Name can either be a language name (e.g. 'Finnish' or 'Brazilian Portuguese')
    or a language code (e.g. 'fi' or 'pt-BR'). Matching is case and space
    insensitive and the hyphen is ignored when matching language codes.

    Raises `ValueError` if no matching language is found.
    """
    normalized = normalize(name, ignore='-')
    for lang in cls.__subclasses__():
        if normalized == normalize(lang.__name__):
            return lang()
        if lang.__doc__ and normalized == normalize(lang.__doc__.splitlines()[0]):
            return lang()
    raise ValueError(f"No language with name '{name}' found.")

code

code() -> str

Language code like 'fi' or 'pt-BR'.

Got based on the class name. If the class name is two characters (or less), the code is just the name in lower case. If it is longer, a hyphen is added and the remainder of the class name is upper-cased.

This special property can be accessed also directly from the class.

Source code in src/robot/conf/languages.py
@classproperty
def code(cls) -> str:
    """Language code like 'fi' or 'pt-BR'.

    Got based on the class name. If the class name is two characters (or less),
    the code is just the name in lower case. If it is longer, a hyphen is added
    and the remainder of the class name is upper-cased.

    This special property can be accessed also directly from the class.
    """
    if cls is Language:
        return cls.__dict__['code']
    code = cast(type, cls).__name__.lower()
    if len(code) < 3:
        return code
    return f'{code[:2]}-{code[2:].upper()}'

name

name() -> str

Language name like 'Finnish' or 'Brazilian Portuguese'.

Got from the first line of the class docstring.

This special property can be accessed also directly from the class.

Source code in src/robot/conf/languages.py
@classproperty
def name(cls) -> str:
    """Language name like 'Finnish' or 'Brazilian Portuguese'.

    Got from the first line of the class docstring.

    This special property can be accessed also directly from the class.
    """
    if cls is Language:
        return cls.__dict__['name']
    return cls.__doc__.splitlines()[0] if cls.__doc__ else ''

Tr

Bases: Language

Turkish

from_name classmethod

from_name(name) -> Language

Return language class based on given name.

Name can either be a language name (e.g. 'Finnish' or 'Brazilian Portuguese') or a language code (e.g. 'fi' or 'pt-BR'). Matching is case and space insensitive and the hyphen is ignored when matching language codes.

Raises ValueError if no matching language is found.

Source code in src/robot/conf/languages.py
@classmethod
def from_name(cls, name) -> 'Language':
    """Return language class based on given `name`.

    Name can either be a language name (e.g. 'Finnish' or 'Brazilian Portuguese')
    or a language code (e.g. 'fi' or 'pt-BR'). Matching is case and space
    insensitive and the hyphen is ignored when matching language codes.

    Raises `ValueError` if no matching language is found.
    """
    normalized = normalize(name, ignore='-')
    for lang in cls.__subclasses__():
        if normalized == normalize(lang.__name__):
            return lang()
        if lang.__doc__ and normalized == normalize(lang.__doc__.splitlines()[0]):
            return lang()
    raise ValueError(f"No language with name '{name}' found.")

code

code() -> str

Language code like 'fi' or 'pt-BR'.

Got based on the class name. If the class name is two characters (or less), the code is just the name in lower case. If it is longer, a hyphen is added and the remainder of the class name is upper-cased.

This special property can be accessed also directly from the class.

Source code in src/robot/conf/languages.py
@classproperty
def code(cls) -> str:
    """Language code like 'fi' or 'pt-BR'.

    Got based on the class name. If the class name is two characters (or less),
    the code is just the name in lower case. If it is longer, a hyphen is added
    and the remainder of the class name is upper-cased.

    This special property can be accessed also directly from the class.
    """
    if cls is Language:
        return cls.__dict__['code']
    code = cast(type, cls).__name__.lower()
    if len(code) < 3:
        return code
    return f'{code[:2]}-{code[2:].upper()}'

name

name() -> str

Language name like 'Finnish' or 'Brazilian Portuguese'.

Got from the first line of the class docstring.

This special property can be accessed also directly from the class.

Source code in src/robot/conf/languages.py
@classproperty
def name(cls) -> str:
    """Language name like 'Finnish' or 'Brazilian Portuguese'.

    Got from the first line of the class docstring.

    This special property can be accessed also directly from the class.
    """
    if cls is Language:
        return cls.__dict__['name']
    return cls.__doc__.splitlines()[0] if cls.__doc__ else ''

Sv

Bases: Language

Swedish

from_name classmethod

from_name(name) -> Language

Return language class based on given name.

Name can either be a language name (e.g. 'Finnish' or 'Brazilian Portuguese') or a language code (e.g. 'fi' or 'pt-BR'). Matching is case and space insensitive and the hyphen is ignored when matching language codes.

Raises ValueError if no matching language is found.

Source code in src/robot/conf/languages.py
@classmethod
def from_name(cls, name) -> 'Language':
    """Return language class based on given `name`.

    Name can either be a language name (e.g. 'Finnish' or 'Brazilian Portuguese')
    or a language code (e.g. 'fi' or 'pt-BR'). Matching is case and space
    insensitive and the hyphen is ignored when matching language codes.

    Raises `ValueError` if no matching language is found.
    """
    normalized = normalize(name, ignore='-')
    for lang in cls.__subclasses__():
        if normalized == normalize(lang.__name__):
            return lang()
        if lang.__doc__ and normalized == normalize(lang.__doc__.splitlines()[0]):
            return lang()
    raise ValueError(f"No language with name '{name}' found.")

code

code() -> str

Language code like 'fi' or 'pt-BR'.

Got based on the class name. If the class name is two characters (or less), the code is just the name in lower case. If it is longer, a hyphen is added and the remainder of the class name is upper-cased.

This special property can be accessed also directly from the class.

Source code in src/robot/conf/languages.py
@classproperty
def code(cls) -> str:
    """Language code like 'fi' or 'pt-BR'.

    Got based on the class name. If the class name is two characters (or less),
    the code is just the name in lower case. If it is longer, a hyphen is added
    and the remainder of the class name is upper-cased.

    This special property can be accessed also directly from the class.
    """
    if cls is Language:
        return cls.__dict__['code']
    code = cast(type, cls).__name__.lower()
    if len(code) < 3:
        return code
    return f'{code[:2]}-{code[2:].upper()}'

name

name() -> str

Language name like 'Finnish' or 'Brazilian Portuguese'.

Got from the first line of the class docstring.

This special property can be accessed also directly from the class.

Source code in src/robot/conf/languages.py
@classproperty
def name(cls) -> str:
    """Language name like 'Finnish' or 'Brazilian Portuguese'.

    Got from the first line of the class docstring.

    This special property can be accessed also directly from the class.
    """
    if cls is Language:
        return cls.__dict__['name']
    return cls.__doc__.splitlines()[0] if cls.__doc__ else ''

Bg

Bases: Language

Bulgarian

from_name classmethod

from_name(name) -> Language

Return language class based on given name.

Name can either be a language name (e.g. 'Finnish' or 'Brazilian Portuguese') or a language code (e.g. 'fi' or 'pt-BR'). Matching is case and space insensitive and the hyphen is ignored when matching language codes.

Raises ValueError if no matching language is found.

Source code in src/robot/conf/languages.py
@classmethod
def from_name(cls, name) -> 'Language':
    """Return language class based on given `name`.

    Name can either be a language name (e.g. 'Finnish' or 'Brazilian Portuguese')
    or a language code (e.g. 'fi' or 'pt-BR'). Matching is case and space
    insensitive and the hyphen is ignored when matching language codes.

    Raises `ValueError` if no matching language is found.
    """
    normalized = normalize(name, ignore='-')
    for lang in cls.__subclasses__():
        if normalized == normalize(lang.__name__):
            return lang()
        if lang.__doc__ and normalized == normalize(lang.__doc__.splitlines()[0]):
            return lang()
    raise ValueError(f"No language with name '{name}' found.")

code

code() -> str

Language code like 'fi' or 'pt-BR'.

Got based on the class name. If the class name is two characters (or less), the code is just the name in lower case. If it is longer, a hyphen is added and the remainder of the class name is upper-cased.

This special property can be accessed also directly from the class.

Source code in src/robot/conf/languages.py
@classproperty
def code(cls) -> str:
    """Language code like 'fi' or 'pt-BR'.

    Got based on the class name. If the class name is two characters (or less),
    the code is just the name in lower case. If it is longer, a hyphen is added
    and the remainder of the class name is upper-cased.

    This special property can be accessed also directly from the class.
    """
    if cls is Language:
        return cls.__dict__['code']
    code = cast(type, cls).__name__.lower()
    if len(code) < 3:
        return code
    return f'{code[:2]}-{code[2:].upper()}'

name

name() -> str

Language name like 'Finnish' or 'Brazilian Portuguese'.

Got from the first line of the class docstring.

This special property can be accessed also directly from the class.

Source code in src/robot/conf/languages.py
@classproperty
def name(cls) -> str:
    """Language name like 'Finnish' or 'Brazilian Portuguese'.

    Got from the first line of the class docstring.

    This special property can be accessed also directly from the class.
    """
    if cls is Language:
        return cls.__dict__['name']
    return cls.__doc__.splitlines()[0] if cls.__doc__ else ''

Ro

Bases: Language

Romanian

from_name classmethod

from_name(name) -> Language

Return language class based on given name.

Name can either be a language name (e.g. 'Finnish' or 'Brazilian Portuguese') or a language code (e.g. 'fi' or 'pt-BR'). Matching is case and space insensitive and the hyphen is ignored when matching language codes.

Raises ValueError if no matching language is found.

Source code in src/robot/conf/languages.py
@classmethod
def from_name(cls, name) -> 'Language':
    """Return language class based on given `name`.

    Name can either be a language name (e.g. 'Finnish' or 'Brazilian Portuguese')
    or a language code (e.g. 'fi' or 'pt-BR'). Matching is case and space
    insensitive and the hyphen is ignored when matching language codes.

    Raises `ValueError` if no matching language is found.
    """
    normalized = normalize(name, ignore='-')
    for lang in cls.__subclasses__():
        if normalized == normalize(lang.__name__):
            return lang()
        if lang.__doc__ and normalized == normalize(lang.__doc__.splitlines()[0]):
            return lang()
    raise ValueError(f"No language with name '{name}' found.")

code

code() -> str

Language code like 'fi' or 'pt-BR'.

Got based on the class name. If the class name is two characters (or less), the code is just the name in lower case. If it is longer, a hyphen is added and the remainder of the class name is upper-cased.

This special property can be accessed also directly from the class.

Source code in src/robot/conf/languages.py
@classproperty
def code(cls) -> str:
    """Language code like 'fi' or 'pt-BR'.

    Got based on the class name. If the class name is two characters (or less),
    the code is just the name in lower case. If it is longer, a hyphen is added
    and the remainder of the class name is upper-cased.

    This special property can be accessed also directly from the class.
    """
    if cls is Language:
        return cls.__dict__['code']
    code = cast(type, cls).__name__.lower()
    if len(code) < 3:
        return code
    return f'{code[:2]}-{code[2:].upper()}'

name

name() -> str

Language name like 'Finnish' or 'Brazilian Portuguese'.

Got from the first line of the class docstring.

This special property can be accessed also directly from the class.

Source code in src/robot/conf/languages.py
@classproperty
def name(cls) -> str:
    """Language name like 'Finnish' or 'Brazilian Portuguese'.

    Got from the first line of the class docstring.

    This special property can be accessed also directly from the class.
    """
    if cls is Language:
        return cls.__dict__['name']
    return cls.__doc__.splitlines()[0] if cls.__doc__ else ''

It

Bases: Language

Italian

from_name classmethod

from_name(name) -> Language

Return language class based on given name.

Name can either be a language name (e.g. 'Finnish' or 'Brazilian Portuguese') or a language code (e.g. 'fi' or 'pt-BR'). Matching is case and space insensitive and the hyphen is ignored when matching language codes.

Raises ValueError if no matching language is found.

Source code in src/robot/conf/languages.py
@classmethod
def from_name(cls, name) -> 'Language':
    """Return language class based on given `name`.

    Name can either be a language name (e.g. 'Finnish' or 'Brazilian Portuguese')
    or a language code (e.g. 'fi' or 'pt-BR'). Matching is case and space
    insensitive and the hyphen is ignored when matching language codes.

    Raises `ValueError` if no matching language is found.
    """
    normalized = normalize(name, ignore='-')
    for lang in cls.__subclasses__():
        if normalized == normalize(lang.__name__):
            return lang()
        if lang.__doc__ and normalized == normalize(lang.__doc__.splitlines()[0]):
            return lang()
    raise ValueError(f"No language with name '{name}' found.")

code

code() -> str

Language code like 'fi' or 'pt-BR'.

Got based on the class name. If the class name is two characters (or less), the code is just the name in lower case. If it is longer, a hyphen is added and the remainder of the class name is upper-cased.

This special property can be accessed also directly from the class.

Source code in src/robot/conf/languages.py
@classproperty
def code(cls) -> str:
    """Language code like 'fi' or 'pt-BR'.

    Got based on the class name. If the class name is two characters (or less),
    the code is just the name in lower case. If it is longer, a hyphen is added
    and the remainder of the class name is upper-cased.

    This special property can be accessed also directly from the class.
    """
    if cls is Language:
        return cls.__dict__['code']
    code = cast(type, cls).__name__.lower()
    if len(code) < 3:
        return code
    return f'{code[:2]}-{code[2:].upper()}'

name

name() -> str

Language name like 'Finnish' or 'Brazilian Portuguese'.

Got from the first line of the class docstring.

This special property can be accessed also directly from the class.

Source code in src/robot/conf/languages.py
@classproperty
def name(cls) -> str:
    """Language name like 'Finnish' or 'Brazilian Portuguese'.

    Got from the first line of the class docstring.

    This special property can be accessed also directly from the class.
    """
    if cls is Language:
        return cls.__dict__['name']
    return cls.__doc__.splitlines()[0] if cls.__doc__ else ''

Hi

Bases: Language

Hindi

from_name classmethod

from_name(name) -> Language

Return language class based on given name.

Name can either be a language name (e.g. 'Finnish' or 'Brazilian Portuguese') or a language code (e.g. 'fi' or 'pt-BR'). Matching is case and space insensitive and the hyphen is ignored when matching language codes.

Raises ValueError if no matching language is found.

Source code in src/robot/conf/languages.py
@classmethod
def from_name(cls, name) -> 'Language':
    """Return language class based on given `name`.

    Name can either be a language name (e.g. 'Finnish' or 'Brazilian Portuguese')
    or a language code (e.g. 'fi' or 'pt-BR'). Matching is case and space
    insensitive and the hyphen is ignored when matching language codes.

    Raises `ValueError` if no matching language is found.
    """
    normalized = normalize(name, ignore='-')
    for lang in cls.__subclasses__():
        if normalized == normalize(lang.__name__):
            return lang()
        if lang.__doc__ and normalized == normalize(lang.__doc__.splitlines()[0]):
            return lang()
    raise ValueError(f"No language with name '{name}' found.")

code

code() -> str

Language code like 'fi' or 'pt-BR'.

Got based on the class name. If the class name is two characters (or less), the code is just the name in lower case. If it is longer, a hyphen is added and the remainder of the class name is upper-cased.

This special property can be accessed also directly from the class.

Source code in src/robot/conf/languages.py
@classproperty
def code(cls) -> str:
    """Language code like 'fi' or 'pt-BR'.

    Got based on the class name. If the class name is two characters (or less),
    the code is just the name in lower case. If it is longer, a hyphen is added
    and the remainder of the class name is upper-cased.

    This special property can be accessed also directly from the class.
    """
    if cls is Language:
        return cls.__dict__['code']
    code = cast(type, cls).__name__.lower()
    if len(code) < 3:
        return code
    return f'{code[:2]}-{code[2:].upper()}'

name

name() -> str

Language name like 'Finnish' or 'Brazilian Portuguese'.

Got from the first line of the class docstring.

This special property can be accessed also directly from the class.

Source code in src/robot/conf/languages.py
@classproperty
def name(cls) -> str:
    """Language name like 'Finnish' or 'Brazilian Portuguese'.

    Got from the first line of the class docstring.

    This special property can be accessed also directly from the class.
    """
    if cls is Language:
        return cls.__dict__['name']
    return cls.__doc__.splitlines()[0] if cls.__doc__ else ''

Vi

Bases: Language

Vietnamese

New in Robot Framework 6.1.

from_name classmethod

from_name(name) -> Language

Return language class based on given name.

Name can either be a language name (e.g. 'Finnish' or 'Brazilian Portuguese') or a language code (e.g. 'fi' or 'pt-BR'). Matching is case and space insensitive and the hyphen is ignored when matching language codes.

Raises ValueError if no matching language is found.

Source code in src/robot/conf/languages.py
@classmethod
def from_name(cls, name) -> 'Language':
    """Return language class based on given `name`.

    Name can either be a language name (e.g. 'Finnish' or 'Brazilian Portuguese')
    or a language code (e.g. 'fi' or 'pt-BR'). Matching is case and space
    insensitive and the hyphen is ignored when matching language codes.

    Raises `ValueError` if no matching language is found.
    """
    normalized = normalize(name, ignore='-')
    for lang in cls.__subclasses__():
        if normalized == normalize(lang.__name__):
            return lang()
        if lang.__doc__ and normalized == normalize(lang.__doc__.splitlines()[0]):
            return lang()
    raise ValueError(f"No language with name '{name}' found.")

code

code() -> str

Language code like 'fi' or 'pt-BR'.

Got based on the class name. If the class name is two characters (or less), the code is just the name in lower case. If it is longer, a hyphen is added and the remainder of the class name is upper-cased.

This special property can be accessed also directly from the class.

Source code in src/robot/conf/languages.py
@classproperty
def code(cls) -> str:
    """Language code like 'fi' or 'pt-BR'.

    Got based on the class name. If the class name is two characters (or less),
    the code is just the name in lower case. If it is longer, a hyphen is added
    and the remainder of the class name is upper-cased.

    This special property can be accessed also directly from the class.
    """
    if cls is Language:
        return cls.__dict__['code']
    code = cast(type, cls).__name__.lower()
    if len(code) < 3:
        return code
    return f'{code[:2]}-{code[2:].upper()}'

name

name() -> str

Language name like 'Finnish' or 'Brazilian Portuguese'.

Got from the first line of the class docstring.

This special property can be accessed also directly from the class.

Source code in src/robot/conf/languages.py
@classproperty
def name(cls) -> str:
    """Language name like 'Finnish' or 'Brazilian Portuguese'.

    Got from the first line of the class docstring.

    This special property can be accessed also directly from the class.
    """
    if cls is Language:
        return cls.__dict__['name']
    return cls.__doc__.splitlines()[0] if cls.__doc__ else ''

Ja

Bases: Language

Japanese

New in Robot Framework 7.0.1.

from_name classmethod

from_name(name) -> Language

Return language class based on given name.

Name can either be a language name (e.g. 'Finnish' or 'Brazilian Portuguese') or a language code (e.g. 'fi' or 'pt-BR'). Matching is case and space insensitive and the hyphen is ignored when matching language codes.

Raises ValueError if no matching language is found.

Source code in src/robot/conf/languages.py
@classmethod
def from_name(cls, name) -> 'Language':
    """Return language class based on given `name`.

    Name can either be a language name (e.g. 'Finnish' or 'Brazilian Portuguese')
    or a language code (e.g. 'fi' or 'pt-BR'). Matching is case and space
    insensitive and the hyphen is ignored when matching language codes.

    Raises `ValueError` if no matching language is found.
    """
    normalized = normalize(name, ignore='-')
    for lang in cls.__subclasses__():
        if normalized == normalize(lang.__name__):
            return lang()
        if lang.__doc__ and normalized == normalize(lang.__doc__.splitlines()[0]):
            return lang()
    raise ValueError(f"No language with name '{name}' found.")

code

code() -> str

Language code like 'fi' or 'pt-BR'.

Got based on the class name. If the class name is two characters (or less), the code is just the name in lower case. If it is longer, a hyphen is added and the remainder of the class name is upper-cased.

This special property can be accessed also directly from the class.

Source code in src/robot/conf/languages.py
@classproperty
def code(cls) -> str:
    """Language code like 'fi' or 'pt-BR'.

    Got based on the class name. If the class name is two characters (or less),
    the code is just the name in lower case. If it is longer, a hyphen is added
    and the remainder of the class name is upper-cased.

    This special property can be accessed also directly from the class.
    """
    if cls is Language:
        return cls.__dict__['code']
    code = cast(type, cls).__name__.lower()
    if len(code) < 3:
        return code
    return f'{code[:2]}-{code[2:].upper()}'

name

name() -> str

Language name like 'Finnish' or 'Brazilian Portuguese'.

Got from the first line of the class docstring.

This special property can be accessed also directly from the class.

Source code in src/robot/conf/languages.py
@classproperty
def name(cls) -> str:
    """Language name like 'Finnish' or 'Brazilian Portuguese'.

    Got from the first line of the class docstring.

    This special property can be accessed also directly from the class.
    """
    if cls is Language:
        return cls.__dict__['name']
    return cls.__doc__.splitlines()[0] if cls.__doc__ else ''

Ko

Bases: Language

Korean

New in Robot Framework 7.1.

from_name classmethod

from_name(name) -> Language

Return language class based on given name.

Name can either be a language name (e.g. 'Finnish' or 'Brazilian Portuguese') or a language code (e.g. 'fi' or 'pt-BR'). Matching is case and space insensitive and the hyphen is ignored when matching language codes.

Raises ValueError if no matching language is found.

Source code in src/robot/conf/languages.py
@classmethod
def from_name(cls, name) -> 'Language':
    """Return language class based on given `name`.

    Name can either be a language name (e.g. 'Finnish' or 'Brazilian Portuguese')
    or a language code (e.g. 'fi' or 'pt-BR'). Matching is case and space
    insensitive and the hyphen is ignored when matching language codes.

    Raises `ValueError` if no matching language is found.
    """
    normalized = normalize(name, ignore='-')
    for lang in cls.__subclasses__():
        if normalized == normalize(lang.__name__):
            return lang()
        if lang.__doc__ and normalized == normalize(lang.__doc__.splitlines()[0]):
            return lang()
    raise ValueError(f"No language with name '{name}' found.")

code

code() -> str

Language code like 'fi' or 'pt-BR'.

Got based on the class name. If the class name is two characters (or less), the code is just the name in lower case. If it is longer, a hyphen is added and the remainder of the class name is upper-cased.

This special property can be accessed also directly from the class.

Source code in src/robot/conf/languages.py
@classproperty
def code(cls) -> str:
    """Language code like 'fi' or 'pt-BR'.

    Got based on the class name. If the class name is two characters (or less),
    the code is just the name in lower case. If it is longer, a hyphen is added
    and the remainder of the class name is upper-cased.

    This special property can be accessed also directly from the class.
    """
    if cls is Language:
        return cls.__dict__['code']
    code = cast(type, cls).__name__.lower()
    if len(code) < 3:
        return code
    return f'{code[:2]}-{code[2:].upper()}'

name

name() -> str

Language name like 'Finnish' or 'Brazilian Portuguese'.

Got from the first line of the class docstring.

This special property can be accessed also directly from the class.

Source code in src/robot/conf/languages.py
@classproperty
def name(cls) -> str:
    """Language name like 'Finnish' or 'Brazilian Portuguese'.

    Got from the first line of the class docstring.

    This special property can be accessed also directly from the class.
    """
    if cls is Language:
        return cls.__dict__['name']
    return cls.__doc__.splitlines()[0] if cls.__doc__ else ''