kepler.scripts.translations module

The module contains functionality for handling the translations for the test data in the database.

class kepler.scripts.translations.TranslationIdMap

Bases: object

The utility class that is used to map translation ID strings to ID numbers. The class is used in database initialization.

get_id(translation_name)
kepler.scripts.translations.add_languages(db_session, lang_list)

The function adds languages to the database.

For example: add_language(session, [('en', 'English', 1), ('fi', 'suomi', 2)]).

Parameters:lang_list – A list of language info tuples.
Returns:The mapping of locale names to language objects.
kepler.scripts.translations.add_translation(db_session, lang, tr_name, translation)

The function adds a translation to the Translation database table.

Parameters:
  • lang – The language to which the translation is added.
  • tr_name – The string ID of the translation.
  • translation – The translation string added to the database.