From ea66edced222f1b224c834faadace0d335a2f223 Mon Sep 17 00:00:00 2001 From: Christian Van Wambeke Date: Tue, 9 Jan 2018 10:41:34 +0100 Subject: [PATCH] add test_i18n.py --- src/i18n/fr/LC_MESSAGES/salomeTools.mo | Bin 2138 -> 2217 bytes src/i18n/fr/LC_MESSAGES/salomeTools.po | 4 +++ src/i18n/test_i18n.py | 42 +++++++++++++++++++++++++ 3 files changed, 46 insertions(+) create mode 100755 src/i18n/test_i18n.py diff --git a/src/i18n/fr/LC_MESSAGES/salomeTools.mo b/src/i18n/fr/LC_MESSAGES/salomeTools.mo index 6729bced3d9719d0f332fbe28e59048c33bd70fb..f62038e7e82d0e333e0e6343be0798f27f7cbf2f 100644 GIT binary patch delta 526 zcmX}p%}N4M6u|N0G})&%8uVrA-Kb-sRJ2K31VIUDJwuU6R7^M(wDJK07ex;-5VWud zC|tG)qD3uwf;MexS^uk37tZ~iduA?k4)bPtk;Z$}ycX6dF-_bNaiSbxW8LEnKHxZh z;24^Q$OOhvpBFKS8@P%G7{goa!$(}gXDnc-M`Ti@AtjPo3OhK3O-!SQd3?eI{@@%Y zOc9qRwlK%J-P?WsiFyDlD55ZjdXP=j_Ybjx7k>Q}!+c-9N!EA}q|FtqpuX5d8*fnI z3#Rc4bz|}VZoP~}&PPaJokc1UVt^RzR79e_To=pFjb%R>K?af#!JwTr%+63U)II+1 z`d87jgs;57Wpcgh)N55&x!dQi%B1Z1tea7LPF&$_vc>Su?uL_`dFGs*WX@!Jsadk~opzo@q{#!aPv*&n#X=0QgrAtfIqu>g zW-(^_^%1tH>$r~{+{72G;TxXg0&|!RNhcgrmCYWFYb@d&p5ZIHIK>M7;w_gRI#QXs zyWxKyqZ#}M3%Eq{05>dMVgpV6fIIksZ5&~f`}NPp9JpZIW4yuw-eVEp(F`;R`b(@+ zyIT_TctJ}^l9nP~M@j`662YFwdtnCQ9g3f_@Gvi8tPHQHU#?g4YnV~n-7o8Dcw<}6 I@GEnFaQ7m 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 -- 2.39.2