1 // =============================================================================
2 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 // Copyright (C) 2008 - INRIA - Sylvestre LEDRU <sylvestre.ledru@inria.fr>
5 // This file is distributed under the same license as the Scilab package.
6 // =============================================================================
8 //===============================
10 //===============================
13 if execstr('dgettext()','errcatch')==0 then pause,end
16 str1="plop"; if execstr('dgettext(str1)','errcatch')==0 then pause,end
18 // three input argument
19 str1="plop"; str2="plip"; str3="plup"; if execstr('gettext(str1, str2, str3)','errcatch')==0 then pause,end
21 // Try to translate from en_US to en_US to domain/string which doesn't exist
22 lang="en_US"; setlanguage(lang); domain="fake_domain"; msg="Localization does not exist"; if dgettext(domain,msg) <> msg then pause, end
24 // Try to translate from en_US to fr_FR to a domain/string which doesn't exist
25 lang="fr_FR"; setlanguage(lang); domain="fake_domain"; msg="Localization does not exist"; if dgettext(domain,msg) <> msg then pause, end
28 // Check if it is working with a good domain & good msgid
29 lang="fr_FR"; setlanguage(lang); domain="scilab"; msg="Startup execution:"; if dgettext(domain,msg) <> "Initialisation:" then pause, end
31 // Check if it is working with a bad domain & good msgid
32 lang="fr_FR"; setlanguage(lang); domain="fake_domain"; msg="Startup execution:"; if dgettext(domain,msg) == "Initialisation:" then pause, end
34 // Check if it is working with a good domain & good msgid and alias
35 lang="fr"; setlanguage(lang); domain="scilab"; msg="Startup execution:"; if dgettext(domain,msg) <> "Initialisation:" then pause, end
37 // Check if it is working with a bad domain & good msgid and alias
38 lang="fr"; setlanguage(lang); domain="fake_domain"; msg="Startup execution:"; if dgettext(domain,msg) == "Initialisation:" then pause, end
41 // Check if it is working with a good domain & good msgid
42 lang="en_US"; setlanguage(lang); domain="scilab"; msg="Startup execution:"; if dgettext(domain,msg) <> msg then pause, end
44 // Check if it is working with a bad domain & good msgid
45 lang="en_US"; setlanguage(lang); domain="fake_domain"; msg="Startup execution:"; if dgettext(domain,msg) <> msg then pause, end
47 // Check if it is working with a good domain & good msgid and alias
48 lang="en"; setlanguage(lang); domain="scilab"; msg="Startup execution:"; if dgettext(domain,msg) <> msg then pause, end
50 // Check if it is working with a bad domain & good msgid and alias
51 lang="en"; setlanguage(lang); domain="fake_domain"; msg="Startup execution:"; if dgettext(domain,msg) <> msg then pause, end
54 // Add test to use other domain which are working (ie not fake_domain)