OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library message_extraction_test; | 5 library message_extraction_test; |
6 | 6 |
7 import 'package:unittest/unittest.dart'; | 7 import 'package:unittest/unittest.dart'; |
8 import 'dart:io'; | 8 import 'dart:io'; |
9 import 'dart:async'; | 9 import 'dart:async'; |
10 import 'package:pathos/path.dart' as path; | 10 import 'package:pathos/path.dart' as path; |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 verify("This string extends across multiple lines."); | 152 verify("This string extends across multiple lines."); |
153 verify("1, b, [c, d]"); | 153 verify("1, b, [c, d]"); |
154 verify('"So-called"'); | 154 verify('"So-called"'); |
155 verify("Cette chaîne est toujours traduit"); | 155 verify("Cette chaîne est toujours traduit"); |
156 verify("Interpolation is tricky when it ends a sentence like this."); | 156 verify("Interpolation is tricky when it ends a sentence like this."); |
157 verify("This comes from a method"); | 157 verify("This comes from a method"); |
158 verify("This method is not a lambda"); | 158 verify("This method is not a lambda"); |
159 verify("This comes from a static method"); | 159 verify("This comes from a static method"); |
160 verify("This is missing some translations"); | 160 verify("This is missing some translations"); |
161 verify("Ancient Greek hangman characters: 𐅆𐅇."); | 161 verify("Ancient Greek hangman characters: 𐅆𐅇."); |
162 // verify("The thing is, well"); | |
163 // verify("One of the tricky things is the plural form"); | |
164 // verify("One of the tricky things is plural forms"); | |
165 verify("Escapable characters here: "); | 162 verify("Escapable characters here: "); |
166 | 163 |
| 164 verify('Is zero plural?'); |
| 165 verify('This is singular.'); |
| 166 verify('This is plural (2).'); |
| 167 verify('Alice went to her house'); |
| 168 verify('Bob went to his house'); |
| 169 verify('cat went to its litter box'); |
| 170 verify('Alice, Bob sont allés au magasin'); |
| 171 verify('Alice est allée au magasin'); |
| 172 verify('Personne n\'est allé au magasin'); |
| 173 verify('Bob, Bob sont allés au magasin'); |
| 174 verify('Alice, Alice sont allées au magasin'); |
| 175 |
167 var fr_lines = lines.skip(1).skipWhile( | 176 var fr_lines = lines.skip(1).skipWhile( |
168 (line) => !line.contains('----')).toList(); | 177 (line) => !line.contains('----')).toList(); |
169 lineIterator = fr_lines.iterator..moveNext(); | 178 lineIterator = fr_lines.iterator..moveNext(); |
170 verify("Printing messages for fr"); | 179 verify("Printing messages for fr"); |
171 verify("Il s'agit d'un message"); | 180 verify("Il s'agit d'un message"); |
172 verify("Un autre message avec un seul paramètre hello"); | 181 verify("Un autre message avec un seul paramètre hello"); |
173 verify( | 182 verify( |
174 "Caractères qui doivent être échapper, par exemple barres \\ " | 183 "Caractères qui doivent être échapper, par exemple barres \\ " |
175 "dollars \${ (les accolades sont ok), et xml/html réservés <& et " | 184 "dollars \${ (les accolades sont ok), et xml/html réservés <& et " |
176 "des citations \" " | 185 "des citations \" " |
177 "avec quelques paramètres ainsi 1, 2, et 3"); | 186 "avec quelques paramètres ainsi 1, 2, et 3"); |
178 verify("Cette message prend plusiers lignes."); | 187 verify("Cette message prend plusiers lignes."); |
179 verify("1, b, [c, d]"); | 188 verify("1, b, [c, d]"); |
180 verify('"Soi-disant"'); | 189 verify('"Soi-disant"'); |
181 verify("Cette chaîne est toujours traduit"); | 190 verify("Cette chaîne est toujours traduit"); |
182 verify( | 191 verify( |
183 "L'interpolation est délicate quand elle se termine une " | 192 "L'interpolation est délicate quand elle se termine une " |
184 "phrase comme this."); | 193 "phrase comme this."); |
185 verify("Cela vient d'une méthode"); | 194 verify("Cela vient d'une méthode"); |
186 verify("Cette méthode n'est pas un lambda"); | 195 verify("Cette méthode n'est pas un lambda"); |
187 verify("Cela vient d'une méthode statique"); | 196 verify("Cela vient d'une méthode statique"); |
188 verify("Ce manque certaines traductions"); | 197 verify("Ce manque certaines traductions"); |
189 verify("Anciens caractères grecs jeux du pendu: 𐅆𐅇."); | 198 verify("Anciens caractères grecs jeux du pendu: 𐅆𐅇."); |
190 // verify("La chose est, well"); | |
191 // verify("Une des choses difficiles est la forme plurielle"); | |
192 // verify("Une des choses difficiles est les formes plurielles"); | |
193 verify("Escapes: "); | 199 verify("Escapes: "); |
194 verify("\r\f\b\t\v."); | 200 verify("\r\f\b\t\v."); |
195 | 201 |
| 202 verify('Est-ce que nulle est pluriel?'); |
| 203 verify('C\'est singulier'); |
| 204 verify('C\'est pluriel (2).'); |
| 205 verify('Alice est allée à sa house'); |
| 206 verify('Bob est allé à sa house'); |
| 207 verify('cat est allé à sa litter box'); |
| 208 verify('Alice, Bob étaient allés à la magasin'); |
| 209 verify('Alice était allée à la magasin'); |
| 210 verify('Personne n\'avait allé à la magasin'); |
| 211 verify('Bob, Bob étaient allés à la magasin'); |
| 212 verify('Alice, Alice étaient allées à la magasin'); |
196 | 213 |
197 var de_lines = fr_lines.skip(1).skipWhile( | 214 var de_lines = fr_lines.skip(1).skipWhile( |
198 (line) => !line.contains('----')).toList(); | 215 (line) => !line.contains('----')).toList(); |
199 lineIterator = de_lines.iterator..moveNext(); | 216 lineIterator = de_lines.iterator..moveNext(); |
200 verify("Printing messages for de_DE"); | 217 verify("Printing messages for de_DE"); |
201 verify("Dies ist eine Nachricht"); | 218 verify("Dies ist eine Nachricht"); |
202 verify("Eine weitere Meldung mit dem Parameter hello"); | 219 verify("Eine weitere Meldung mit dem Parameter hello"); |
203 verify( | 220 verify( |
204 "Zeichen, die Flucht benötigen, zB Schrägstriche \\ Dollar " | 221 "Zeichen, die Flucht benötigen, zB Schrägstriche \\ Dollar " |
205 "\${ (geschweiften Klammern sind ok) und xml reservierte Zeichen <& und " | 222 "\${ (geschweiften Klammern sind ok) und xml reservierte Zeichen <& und " |
206 "Zitate \" Parameter 1, 2 und 3"); | 223 "Zitate \" Parameter 1, 2 und 3"); |
207 verify("Dieser String erstreckt sich über mehrere " | 224 verify("Dieser String erstreckt sich über mehrere " |
208 "Zeilen erstrecken."); | 225 "Zeilen erstrecken."); |
209 verify("1, b, [c, d]"); | 226 verify("1, b, [c, d]"); |
210 verify('"Sogenannt"'); | 227 verify('"Sogenannt"'); |
211 // This is correct, the message is forced to French, even in a German locale. | 228 // This is correct, the message is forced to French, even in a German locale. |
212 verify("Cette chaîne est toujours traduit"); | 229 verify("Cette chaîne est toujours traduit"); |
213 verify( | 230 verify( |
214 "Interpolation ist schwierig, wenn es einen Satz wie dieser endet this."); | 231 "Interpolation ist schwierig, wenn es einen Satz wie dieser endet this."); |
215 verify("Dies ergibt sich aus einer Methode"); | 232 verify("Dies ergibt sich aus einer Methode"); |
216 verify("Diese Methode ist nicht eine Lambda"); | 233 verify("Diese Methode ist nicht eine Lambda"); |
217 verify("Dies ergibt sich aus einer statischen Methode"); | 234 verify("Dies ergibt sich aus einer statischen Methode"); |
218 verify("This is missing some translations"); | 235 verify("This is missing some translations"); |
219 verify("Antike griechische Galgenmännchen Zeichen: 𐅆𐅇"); | 236 verify("Antike griechische Galgenmännchen Zeichen: 𐅆𐅇"); |
220 // verify("Die Sache ist, well"); | |
221 // expect("Einer der knifflige Dinge ist der Plural"); | |
222 // expect("Zu den kniffligen Dinge Pluralformen"); | |
223 verify("Escapes: "); | 237 verify("Escapes: "); |
224 verify("\r\f\b\t\v."); | 238 verify("\r\f\b\t\v."); |
| 239 |
| 240 verify('Ist Null Plural?'); |
| 241 verify('Dies ist einmalig'); |
| 242 verify('Dies ist Plural (2).'); |
| 243 verify('Alice ging zu ihrem house'); |
| 244 verify('Bob ging zu seinem house'); |
| 245 verify('cat ging zu seinem litter box'); |
| 246 verify('Alice, Bob gingen zum magasin'); |
| 247 verify('Alice ging in dem magasin'); |
| 248 verify('Niemand ging zu magasin'); |
| 249 verify('Bob, Bob gingen zum magasin'); |
| 250 verify('Alice, Alice gingen zum magasin'); |
225 } | 251 } |
OLD | NEW |