File: dgettext.dia.ref

package info (click to toggle)
scilab 5.2.2-9
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 334,832 kB
  • ctags: 52,586
  • sloc: xml: 526,945; ansic: 223,590; fortran: 163,080; java: 56,934; cpp: 33,840; tcl: 27,936; sh: 20,397; makefile: 9,908; ml: 9,451; perl: 1,323; cs: 614; lisp: 30
file content (33 lines) | stat: -rw-r--r-- 2,578 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//===============================
// unit tests dgettext
// INRIA 2008
// @author Sylvestre LEDRU
//===============================
// Void call
if execstr('dgettext()','errcatch')==0 then bugmes();quit;end
// one input argument
str1="plop"; if execstr('dgettext(str1)','errcatch')==0 then bugmes();quit;end
// three input argument
str1="plop"; str2="plip"; str3="plup"; if execstr('gettext(str1, str2, str3)','errcatch')==0 then bugmes();quit;end
// Try to translate from en_US to en_US to domain/string which doesn't exist
lang="en_US"; setlanguage(lang); domain="fake_domain"; msg="Localization does not exist"; if dgettext(domain,msg) <> msg then bugmes();quit;end
// Try to translate from en_US to fr_FR to a domain/string which doesn't exist
lang="fr_FR"; setlanguage(lang); domain="fake_domain"; msg="Localization does not exist"; if dgettext(domain,msg) <> msg then bugmes();quit;end
// Check if it is working with a good domain & good msgid
lang="fr_FR"; setlanguage(lang); domain="scilab"; msg="Startup execution:"; if dgettext(domain,msg) <> "Initialisation:" then bugmes();quit;end
// Check if it is working with a bad domain & good msgid
lang="fr_FR"; setlanguage(lang); domain="fake_domain"; msg="Startup execution:"; if dgettext(domain,msg) == "Initialisation:" then bugmes();quit;end
// Check if it is working with a good domain & good msgid and alias
lang="fr"; setlanguage(lang); domain="scilab"; msg="Startup execution:"; if dgettext(domain,msg) <> "Initialisation:" then bugmes();quit;end
// Check if it is working with a bad domain & good msgid and alias
lang="fr"; setlanguage(lang); domain="fake_domain"; msg="Startup execution:"; if dgettext(domain,msg) == "Initialisation:" then bugmes();quit;end
// Check if it is working with a good domain & good msgid
lang="en_US"; setlanguage(lang); domain="scilab"; msg="Startup execution:"; if dgettext(domain,msg) <> msg then bugmes();quit;end
// Check if it is working with a bad domain & good msgid
lang="en_US"; setlanguage(lang); domain="fake_domain"; msg="Startup execution:"; if dgettext(domain,msg) <> msg then bugmes();quit;end
// Check if it is working with a good domain & good msgid and alias
lang="en"; setlanguage(lang); domain="scilab"; msg="Startup execution:"; if dgettext(domain,msg) <> msg then bugmes();quit;end
// Check if it is working with a bad domain & good msgid and alias
lang="en"; setlanguage(lang); domain="fake_domain"; msg="Startup execution:"; if dgettext(domain,msg) <> msg then bugmes();quit;end
// @TODO :
// Add test to use other domain which are working (ie not fake_domain)