Alignak-monitoring-contrib / alignak-app

Desktop application in system tray for Alignak users.
GNU Affero General Public License v3.0
6 stars 2 forks source link

Improve translation system #273

Open algorys opened 6 years ago

algorys commented 6 years ago

Currently, the texts to be translated are scattered in each file and often contain duplicates.

Each python file should have a corresponding python file in the locales folder with dictionaries containing the strings. This will facilitate translation updates later and avoid duplicates.

# Files for translations should look like this
# ./locales/actions.py
{
    'fr_FR': {
        'acknowledged': 'reconnu',
        'downtimed': 'arrêt programmé',
    }
    'en_US': {
        'acknowledged': 'acknowledge',
        'downtimed': 'downtime',
    }
}

# Then call by a function in each file
get_actionstext('fr_FR', 'acknowledged')