### Navigation

- index
- modules
- next
- previous
- Home »
- Contents »
- InaSAFE’s API documentation »
- Package::safe »
- Package::safe.common »

# Module: safe.common.dynamic_translations

Lookup table mapping layer titles to translatable strings

Layer titles are kept in the associated keywords files. However, these files are not seen by the internationalisation system and can therefore not be translated.

To achieve this for selected titles, we maintain a lookup table of the form

{string: translatable_string}

where string e.g. comes from the keywords file or attribute names/values in datasets and translatable_string is the string that will appear as the translated at runtime.

e.g (using a neutral symbol) {‘title1’: tr(‘Jakarta 2007 flood’)}

or (using existing title) {‘Schools’: tr(‘Schools’)}

or (attribute value) {‘school’: tr(‘school’)}

With the underscore function, the specified string will be seen by the translation system and can appear in the supported languages as with other strings in SAFE.

Note, this module does not provide translations! Rather it provides mappings between strings expected at runtime to strings seen by the existing translation systems.

To use:

This module contains words and phrases that need to be translatable but would not normally be available in code for example, that originate from a dataset or external source.

Just put your translations here, and it will be available to the tr function but never import this module or the functions in it!

This module forms part of the InaSAFE tool.

### Navigation

- index
- modules
- next
- previous
- Home »
- Contents »
- InaSAFE’s API documentation »
- Package::safe »
- Package::safe.common »