From: Christian Van Wambeke Date: Tue, 9 Jan 2018 09:41:34 +0000 (+0100) Subject: add test_i18n.py X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ea66edced222f1b224c834faadace0d335a2f223;p=tools%2Fsat.git add test_i18n.py --- diff --git a/src/i18n/fr/LC_MESSAGES/salomeTools.mo b/src/i18n/fr/LC_MESSAGES/salomeTools.mo index 6729bce..f62038e 100644 Binary files a/src/i18n/fr/LC_MESSAGES/salomeTools.mo and b/src/i18n/fr/LC_MESSAGES/salomeTools.mo differ diff --git a/src/i18n/fr/LC_MESSAGES/salomeTools.po b/src/i18n/fr/LC_MESSAGES/salomeTools.po index 99b70ff..d16e170 100644 --- a/src/i18n/fr/LC_MESSAGES/salomeTools.po +++ b/src/i18n/fr/LC_MESSAGES/salomeTools.po @@ -13,6 +13,10 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +# test accentué +msgid "Georges says '%(1)s' for %(2)s." +msgstr "pour %(2)s Hervé dit '%(1)s'." + msgid "shows global help or help on a specific command." msgstr "affiche l'aide générale ou pour une commande spécifique." diff --git a/src/i18n/test_i18n.py b/src/i18n/test_i18n.py new file mode 100755 index 0000000..a9af31b --- /dev/null +++ b/src/i18n/test_i18n.py @@ -0,0 +1,42 @@ +#!/usr/bin/env python +#-*- coding:utf-8 -*- + +# %% LICENSE_SALOME_CEA_BEGIN +# Copyright (C) 2008-2018 CEA/DEN +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org or email : webmaster.salome@opencascade.com +# %% LICENSE_END + +import os +import gettext +import unittest + +verbose = False + +class TestCase(unittest.TestCase): + + def test_005(self): + # load resources for internationalization + gettext.install('salomeTools', os.path.realpath(os.path.dirname(__file__))) + res = _("Georges says '%(1)s' for %(2)s.") % {"1": "hello", "2": "test"} + if verbose: print(res) + self.assertEqual(res, "pour test Hervé dit 'hello'.") + +if __name__ == '__main__': + verbose = False + unittest.main() + pass