setlyze.locale — English text retrieval

Author:Serrano Pereira, Adam van Adrichem, Fedde Schaeffer
Release:1.0.1
Date:July 17, 2015

Module Contents

This module is for storing and retrieving messages used in SETLyze. The purpose is to have a standard place for storing these messages. This was basically meant for convenience so the developer doesn’t have to browse through SETLyze’s code base just to change a sentence.

This module wasn’t created for adding multi-language support, though it can be easily expanded to do so.

setlyze.locale.text(key, *args)[source]

Return the text string from the ENGLISH dictionary where key is key.

A simple example:

>>> import setlyze.locale
>>> setlyze.locale.text('analysis-spot-preference-descr')
'Determine if a species has preference for a specific area on SETL plates.'

Substitution is also supported:

>>> import setlyze.locale
>>> setlyze.locale.text('dummy', "windy with a slight chance of rain")
"And tomorrow's forecast is, windy with a slight chance of rain"