9 require_once
'PU_testcase_dcp.php';
10 include_once
'WHAT/Lib.Http.php';
11 include_once
'FDL/enum_choice.php';
21 $this->assertEquals($expectedText, _($text));
29 $this->assertEquals($expectedText, sprintf(
n___($text, $textp, $num) , $num));
37 $this->assertEquals($expectedText,
___($text, $ctx));
45 $this->assertEquals($expectedText, sprintf(
n___($text, $textp, $num, $ctx) , $num));
53 $lay = new \Layout(
"", self::getAction());
54 $lay->template = $text;
55 $genText = $lay->gen();
57 $this->assertEquals($expectedText, $genText);
64 "<p>[TEXT:dcptest:Hello]</p>",
70 "<p>[TEXT(dcpctx1):dcptest:Test locale]</p>",
72 "<p>test avec contexte un</p>"
75 "<p>[TEXT(dcpctx2):dcptest:Test locale]</p>",
77 "<p>test avec contexte deux</p>"
83 $i18n = _(
"dcptest:Hello");
84 $i18n = _(
"dcptest:Good Bye");
85 $i18n =
n___(
"dcptest:%d symbol",
"dcptest:%d symbols", 45);
86 $i18n =
n___(
"%d symbol",
"%d symbols", 45,
"dcpctx1");
87 $i18n =
___(
"dcptest:Test locale");
88 $i18n =
___(
"dcptest:Test locale",
"dcpctx1");
89 $i18n =
___(
"dcptest:Test locale",
"dcpctx2");
105 "0 very complex symbols"
113 "34 very complex symbols"
122 "0 symbole très simple"
130 "1 symbole très simple"
138 "10 symboles très complexes"
170 "dcptest:Test locale",
176 "dcptest:No translation",
179 "dcptest:No translation"
182 "dcptest:Test locale",
185 "test avec contexte un"
188 "dcptest:Test locale",
191 "test avec contexte deux"
194 "dcptest:Test locale",
197 "test without context"
200 "dcptest:Test locale",
203 "test with first context"
206 "dcptest:Test locale",
209 "test with second context"
212 "dcptest:Test locale",
215 "dcptest:Test locale"
221 $i18n =
n___(
"dcptest:%d symbol",
"dcptest:%d symbols",1);
222 $i18n =
n___(
"dcptest:%.02f symbol",
"dcptest:%02f symbols",1);
226 "dcptest:%d symbols",
233 "dcptest:%d symbols",
239 "dcptest:%d symbols",
241 "-3 symboles complexes"
245 "dcptest:%d symbols",
252 "dcptest:%d symbols",
255 "3 symboles complexes"
258 "dcptest:%.02f symbol",
259 "dcptest:%.02f symbols",
262 "1.40 symbole simple"
265 "dcptest:%.02f symbol",
266 "dcptest:%.02f symbols",
269 "1.60 symbole simple"
272 "dcptest:%.02f symbol",
273 "dcptest:%.02f symbols",
275 "-0.60 symbole simple"
278 "dcptest:%.02f symbol",
279 "dcptest:%.02f symbols",
281 "-0.20 symbole simple"
284 "dcptest:%.02f symbol",
285 "dcptest:%.02f symbols",
287 "-1.20 symbole simple"
305 "dcptest:%.02f symbol",
306 "dcptest:%.02f symbols",
309 "2.50 symboles complexes"
312 "dcptest:%.02f symbol",
313 "dcptest:%.02f symbols",
316 "2.50 complex symbols"
319 "dcptest:%.02f symbol",
320 "dcptest:%.02f symbols",
323 "0.50 complex symbols"
326 "dcptest:%.02f symbol",
327 "dcptest:%.02f symbols",
349 "dcptest:%d symbols",
356 "dcptest:%d symbols",
363 "dcptest:%d symbols",
369 "dcptest:%d symbols",
if(!function_exists('pgettext')) ___($message, $context="")
n___($message, $message_plural, $num, $context="")
testContext($text, $ctx, $lang, $expectedText)
testTextlayout($text, $lang, $expectedText)
testUnderscore($text, $lang, $expectedText)
test3Underscore($text, $textp, $lang, $num, $expectedText)
testPluralContext($text, $textp, $ctx, $lang, $num, $expectedText)