@@ -31,23 +31,23 @@ public function testLintCorrectTranslations()
3131 $ translator ->addResource ('array ' , [
3232 'hello_name ' => 'Hello {name}! ' ,
3333 'num_of_apples ' => <<<ICU
34- {apples, plural,
35- =0 {There are no apples}
36- =1 {There is one apple...}
37- other {There are # apples!}
38- }
39- ICU ,
34+ {apples, plural,
35+ =0 {There are no apples}
36+ =1 {There is one apple...}
37+ other {There are # apples!}
38+ }
39+ ICU ,
4040 ], 'en ' , 'messages+intl-icu ' );
4141 $ translator ->addResource ('array ' , ['hello ' => 'Bonjour ! ' ], 'fr ' , 'messages ' );
4242 $ translator ->addResource ('array ' , [
4343 'hello_name ' => 'Bonjour {name} ! ' ,
4444 'num_of_apples ' => <<<ICU
45- {apples, plural,
46- =0 {Il n'y a pas de pommes}
47- =1 {Il y a une pomme}
48- other {Il y a # pommes !}
49- }
50- ICU ,
45+ {apples, plural,
46+ =0 {Il n'y a pas de pommes}
47+ =1 {Il y a une pomme}
48+ other {Il y a # pommes !}
49+ }
50+ ICU ,
5151 ], 'fr ' , 'messages+intl-icu ' );
5252
5353 $ command = $ this ->createCommand ($ translator , ['en ' , 'fr ' ]);
@@ -71,24 +71,24 @@ public function testLintMalformedIcuTranslations()
7171 'hello_name ' => 'Hello {name}! ' ,
7272 // Missing "other" case
7373 'num_of_apples ' => <<<ICU
74- {apples, plural,
75- =0 {There are no apples}
76- =1 {There is one apple...}
77- }
78- ICU ,
74+ {apples, plural,
75+ =0 {There are no apples}
76+ =1 {There is one apple...}
77+ }
78+ ICU ,
7979 ], 'en ' , 'messages+intl-icu ' );
8080 $ translator ->addResource ('array ' , ['hello ' => 'Bonjour ! ' ], 'fr ' , 'messages ' );
8181 $ translator ->addResource ('array ' , [
8282 // Missing "}"
8383 'hello_name ' => 'Bonjour {name ! ' ,
8484 // "other" is translated
8585 'num_of_apples ' => <<<ICU
86- {apples, plural,
87- =0 {Il n'y a pas de pommes}
88- =1 {Il y a une pomme}
89- autre {Il y a # pommes !}
90- }
91- ICU ,
86+ {apples, plural,
87+ =0 {Il n'y a pas de pommes}
88+ =1 {Il y a une pomme}
89+ autre {Il y a # pommes !}
90+ }
91+ ICU ,
9292 ], 'fr ' , 'messages+intl-icu ' );
9393
9494 $ command = $ this ->createCommand ($ translator , ['en ' , 'fr ' ]);
@@ -98,53 +98,53 @@ public function testLintMalformedIcuTranslations()
9898
9999 $ display = $ this ->getNormalizedDisplay ($ commandTester );
100100 $ this ->assertStringContainsString (<<<EOF
101- -------- ---------- --------
102- Locale Domains Valid?
103- -------- ---------- --------
104- en messages No
105- fr messages No
106- -------- ---------- --------
107- EOF , $ display );
101+ -------- ---------- --------
102+ Locale Domains Valid?
103+ -------- ---------- --------
104+ en messages No
105+ fr messages No
106+ -------- ---------- --------
107+ EOF , $ display );
108108 $ this ->assertStringContainsString (\sprintf (<<<EOF
109- Errors for locale "en" and domain "messages"
110- --------------------------------------------
109+ Errors for locale "en" and domain "messages"
110+ --------------------------------------------
111111
112- Translation key "num_of_apples" is invalid:
112+ Translation key "num_of_apples" is invalid:
113113
114- [ERROR] Invalid message format (error #65807): %s: message formatter creation failed:
115- U_DEFAULT_KEYWORD_MISSING
116- EOF , \PHP_VERSION_ID >= 80500 ? 'MessageFormatter::__construct() ' : 'msgfmt_create ' ), $ display );
114+ [ERROR] Invalid message format (error #65807): %s: message formatter creation failed:
115+ U_DEFAULT_KEYWORD_MISSING
116+ EOF , \PHP_VERSION_ID >= 80500 ? 'MessageFormatter::__construct() ' : 'msgfmt_create ' ), $ display );
117117
118118 if (\PHP_VERSION_ID >= 80500 ) {
119119 $ this ->assertStringContainsString (<<<EOF
120- Errors for locale "fr" and domain "messages"
121- --------------------------------------------
120+ Errors for locale "fr" and domain "messages"
121+ --------------------------------------------
122122
123- Translation key "hello_name" is invalid:
123+ Translation key "hello_name" is invalid:
124124
125- [ERROR] Invalid message format (error #65799): MessageFormatter::__construct(): pattern syntax error (parse error at
126- offset 9, after "Bonjour {", before or at "name !"): U_PATTERN_SYNTAX_ERROR
125+ [ERROR] Invalid message format (error #65799): MessageFormatter::__construct(): pattern syntax error (parse error at
126+ offset 9, after "Bonjour {", before or at "name !"): U_PATTERN_SYNTAX_ERROR
127127
128- Translation key "num_of_apples" is invalid:
128+ Translation key "num_of_apples" is invalid:
129129
130- [ERROR] Invalid message format (error #65807): MessageFormatter::__construct(): message formatter creation failed:
131- U_DEFAULT_KEYWORD_MISSING
132- EOF , $ display );
130+ [ERROR] Invalid message format (error #65807): MessageFormatter::__construct(): message formatter creation failed:
131+ U_DEFAULT_KEYWORD_MISSING
132+ EOF , $ display );
133133 } else {
134134 $ this ->assertStringContainsString (<<<EOF
135- Errors for locale "fr" and domain "messages"
136- --------------------------------------------
135+ Errors for locale "fr" and domain "messages"
136+ --------------------------------------------
137137
138- Translation key "hello_name" is invalid:
138+ Translation key "hello_name" is invalid:
139139
140- [ERROR] Invalid message format (error #65799): pattern syntax error (parse error at offset 9, after "Bonjour {", before
141- or at "name !"): U_PATTERN_SYNTAX_ERROR
140+ [ERROR] Invalid message format (error #65799): pattern syntax error (parse error at offset 9, after "Bonjour {", before
141+ or at "name !"): U_PATTERN_SYNTAX_ERROR
142142
143- Translation key "num_of_apples" is invalid:
143+ Translation key "num_of_apples" is invalid:
144144
145- [ERROR] Invalid message format (error #65807): msgfmt_create: message formatter creation failed:
146- U_DEFAULT_KEYWORD_MISSING
147- EOF , $ display );
145+ [ERROR] Invalid message format (error #65807): msgfmt_create: message formatter creation failed:
146+ U_DEFAULT_KEYWORD_MISSING
147+ EOF , $ display );
148148 }
149149 }
150150
0 commit comments