Line 57: |
Line 57: |
| | | |
| ==== The PO Files ==== | | ==== The PO Files ==== |
| + | The po files include the original english text as well as the specific translation.<syntaxhighlight lang="po"> |
| + | msgctxt "dom_FORM_TITLE" |
| + | msgid "Manage domains" |
| + | msgstr "Gestion des domaines" |
| + | |
| + | </syntaxhighlight> |
| | | |
| ==== The Lex Files ==== | | ==== The Lex Files ==== |
| + | The lex files only include the key string and the translated text.<syntaxhighlight lang="perl"> |
| + | 'dom_FORM_TITLE' => 'Gestion des domaines', |
| + | 'dom_FORM_DESCRIPTION' => ' Si vous créez un domaine, le serveur pourra recevoir des courriels et héberger un site Web pour ce domaine.', |
| + | 'dom_NO_VIRTUAL_DOMAINS' => 'Aucun domaine n\'a été créé dans le système.', |
| + | 'dom_CURRENT_DOMAINS' => 'Liste actuelle des domaines', |
| + | |
| + | </syntaxhighlight> |
| + | |
| + | ==== The pm files ==== |
| + | and the .pm files are each a loadable perl module.<syntaxhighlight lang="perl"> |
| + | package SrvMngr::I18N::Modules::Domains::fr; |
| + | use strict; |
| + | use warnings; |
| + | use utf8; |
| + | use Mojo::Base 'SrvMngr::I18N'; |
| + | |
| + | use SrvMngr::I18N::Modules::General::fr; |
| + | |
| + | my %lexicon = ( |
| + | 'dom_FORM_TITLE' => 'Gestion des domaines', |
| + | 'dom_FORM_DESCRIPTION' => ' Si vous créez un domaine, le serveur pourra recevoir des courriels et héberger un site Web pour ce domaine.', |
| + | 'dom_NO_VIRTUAL_DOMAINS' => 'Aucun domaine n\'a été créé dans le système.', |
| + | ...... |
| + | 'dom_ADD_DOMAIN' => 'Ajouter un domaine', |
| + | 'dom_DOMAINS_PAGE_CORPORATE_DNS' => 'Modifier les paramètres DNS de votre organisation', |
| + | ); |
| + | |
| + | our %Lexicon = ( |
| + | %{ SrvMngr::I18N::Modules::General::fr::Lexicon }, |
| + | %lexicon |
| + | ); |
| + | |
| + | |
| + | 1; |
| + | |
| + | </syntaxhighlight> |
| | | |
| ==== Panels ==== | | ==== Panels ==== |
| + | Within each Mojo controller file (usually <panelname>.pm held in /usr/share/smanager/lib/SrvMngr/Controller/). any strings to be translated are expressed using the lexicon routine "l". As here:<syntaxhighlight lang="perl"> |
| + | $notif = $c->l("bac_BACKUP_DESKTOP_TOO_BIG") |
| + | </syntaxhighlight>Simllarily in the template files (/usr/share/smanager/themes/default/templates/partials/)<syntaxhighlight lang="perl"> |
| + | <th class='sme-border'> |
| + | %=l 'dom_LABEL_NAMESERVERS' |
| + | </th> |
| + | |
| + | </syntaxhighlight> |
| | | |
| ==== The Navigation menu ==== | | ==== The Navigation menu ==== |
| | | |
| ==== Testing in a Chromium based Browser ==== | | ==== Testing in a Chromium based Browser ==== |