2. Checking messages#

The verification of the messages is carried out by a test case dedicated to this: supv002.

The aim is to ensure:

that the messages provided in the catalogs have the right format: they must be in*unicode to be able to handle non-ascii characters;

  • that they can be formatted correctly, in particular that the variables they contain have a consistent type;

  • that the messages are written in French!

For this last point, the text of the messages is systematically checked using the Aspell spell checker. It is based on its own dictionary to which we add the jargon specific to Code_Aster. That is to say:

  • a dictionary containing the list of all the keywords in the order catalog,

a dictionary adding a certain number of words in addition to the basic French dictionary (proper nouns like*Newton, English words but adopted in our jargon like*level-set*, etc.).

Care will be taken to limit the personal dictionary for*Code_Aster* to the strict minimum.

Note

aspell*only takes into account a personal dictionary. During the check, we automatically concatenate our two dictionaries to form a single one.*

Dictionaries are listed in $ ASTER_ROOT /share/codeaster under the names code_aster_cata.aspell.per and code_aster_dict.aspell.per respectively. Be careful to keep the correct encoding of these files.

2.1. Dictionary of catalog keywords#

We build this dictionary in the simplest way possible (we can update it from time to time according to the appearance of new keywords): we take all the keywords in uppercase letters from cata.py.

aspell does not accept « _ » in the middle of a word, or words that contain numbers. The dictionary can be produced as follows:

Import OS

Import re

cata=open (“cata.py”, “r”) .read ()

exp = re.compile (“([A-Z] [A-Z] +)”, re.M)

kw = list (set (exp.findall (cata)))

kw.sort ()

kw.insert (0, “personal_ws-1.1 fr 0 utf-8”)

open (“dict.aspell.per”, “w”) .write (os.linesep.join (kw))