4 # %% LICENSE_SALOME_CEA_BEGIN
5 # Copyright (C) 2008-2018 CEA/DEN
7 # This library is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU Lesser General Public
9 # License as published by the Free Software Foundation; either
10 # version 2.1 of the License, or (at your option) any later version.
12 # This library is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # Lesser General Public License for more details.
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with this library; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 # See http://www.salome-platform.org or email : webmaster.salome@opencascade.com
30 class TestCase(unittest.TestCase):
33 # first load resources for internationalization
34 gettext.install('salomeTools', os.path.realpath(os.path.dirname(__file__)))
37 res = _("Harvey writes '%(1)s' for %(2)s.") % {"1": "hello", "2": "test_005"}
38 if verbose: print(res)
39 self.assertEqual(res, "pour test_005 Hervé écrit 'hello'.")
42 res = _("Harvey writes '%(1)s' for %(2)s.") % {"1": _("hello"), "2": "test_010"}
43 if verbose: print(res)
44 self.assertEqual(res, "pour test_010 Hervé écrit 'bonjour'.")
47 # keep Ooops inexisting in salomeTools.po as no translation
48 res = _("Harvey writes '%(1)s' for %(2)s.") % {"1": _("Ooops"), "2": "test_020"}
49 if verbose: print(res)
50 self.assertEqual(res, "pour test_020 Hervé écrit 'Ooops'.")
52 if __name__ == '__main__':