OLD | NEW |
1 #!/usr/bin/env dart | 1 #!/usr/bin/env dart |
2 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 2 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
3 // for details. All rights reserved. Use of this source code is governed by a | 3 // for details. All rights reserved. Use of this source code is governed by a |
4 // BSD-style license that can be found in the LICENSE file. | 4 // BSD-style license that can be found in the LICENSE file. |
5 | 5 |
6 /** | 6 /** |
7 * This simulates a translation process, reading the messages generated | 7 * This simulates a translation process, reading the messages generated |
8 * from extract_message.dart for the files sample_with_messages.dart and | 8 * from extract_message.dart for the files sample_with_messages.dart and |
9 * part_of_sample_with_messages.dart and writing out hard-coded translations for | 9 * part_of_sample_with_messages.dart and writing out hard-coded translations for |
10 * German and French locales. | 10 * German and French locales. |
(...skipping 11 matching lines...) Expand all Loading... |
22 "message2": r"Un autre message avec un seul paramètre {x}", | 22 "message2": r"Un autre message avec un seul paramètre {x}", |
23 "alwaysTranslated": "Cette chaîne est toujours traduit", | 23 "alwaysTranslated": "Cette chaîne est toujours traduit", |
24 "message1": "Il s'agit d'un message", | 24 "message1": "Il s'agit d'un message", |
25 "leadingQuotes": "\"Soi-disant\"", | 25 "leadingQuotes": "\"Soi-disant\"", |
26 "trickyInterpolation": r"L'interpolation est délicate " | 26 "trickyInterpolation": r"L'interpolation est délicate " |
27 r"quand elle se termine une phrase comme {s}.", | 27 r"quand elle se termine une phrase comme {s}.", |
28 "message3": "Caractères qui doivent être échapper, par exemple barres \\ " | 28 "message3": "Caractères qui doivent être échapper, par exemple barres \\ " |
29 "dollars \${ (les accolades sont ok), et xml/html réservés <& et " | 29 "dollars \${ (les accolades sont ok), et xml/html réservés <& et " |
30 "des citations \" " | 30 "des citations \" " |
31 "avec quelques paramètres ainsi {a}, {b}, et {c}", | 31 "avec quelques paramètres ainsi {a}, {b}, et {c}", |
32 "method": "Cela vient d'une méthode", | 32 "YouveGotMessages_method": "Cela vient d'une méthode", |
33 "nonLambda": "Cette méthode n'est pas un lambda", | 33 "nonLambda": "Cette méthode n'est pas un lambda", |
34 "staticMessage": "Cela vient d'une méthode statique", | 34 "staticMessage": "Cela vient d'une méthode statique", |
35 "notAlwaysTranslated": "Ce manque certaines traductions", | 35 "notAlwaysTranslated": "Ce manque certaines traductions", |
36 "thisNameIsNotInTheOriginal": "Could this lead to something malicious?", | 36 "thisNameIsNotInTheOriginal": "Could this lead to something malicious?", |
37 "originalNotInBMP": "Anciens caractères grecs jeux du pendu: 𐅆𐅇.", | 37 "originalNotInBMP": "Anciens caractères grecs jeux du pendu: 𐅆𐅇.", |
38 "escapable": "Escapes: \n\r\f\b\t\v.", | 38 "escapable": "Escapes: \n\r\f\b\t\v.", |
39 "sameContentsDifferentName": "Bonjour tout le monde", | 39 "sameContentsDifferentName": "Bonjour tout le monde", |
40 "differentNameSameContents": "Bonjour tout le monde", | 40 "differentNameSameContents": "Bonjour tout le monde", |
41 "rentToBePaid": "loyer", | 41 "rentToBePaid": "loyer", |
42 "rentAsVerb": "louer", | 42 "rentAsVerb": "louer", |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 "multiLine": "Dieser String erstreckt sich über mehrere Zeilen erstrecken.", | 82 "multiLine": "Dieser String erstreckt sich über mehrere Zeilen erstrecken.", |
83 "message2": r"Eine weitere Meldung mit dem Parameter {x}", | 83 "message2": r"Eine weitere Meldung mit dem Parameter {x}", |
84 "alwaysTranslated": "Diese Zeichenkette wird immer übersetzt", | 84 "alwaysTranslated": "Diese Zeichenkette wird immer übersetzt", |
85 "message1": "Dies ist eine Nachricht", | 85 "message1": "Dies ist eine Nachricht", |
86 "leadingQuotes": "\"Sogenannt\"", | 86 "leadingQuotes": "\"Sogenannt\"", |
87 "trickyInterpolation": r"Interpolation ist schwierig, wenn es einen Satz " | 87 "trickyInterpolation": r"Interpolation ist schwierig, wenn es einen Satz " |
88 "wie dieser endet {s}.", | 88 "wie dieser endet {s}.", |
89 "message3": "Zeichen, die Flucht benötigen, zB Schrägstriche \\ Dollar " | 89 "message3": "Zeichen, die Flucht benötigen, zB Schrägstriche \\ Dollar " |
90 "\${ (geschweiften Klammern sind ok) und xml reservierte Zeichen <& und " | 90 "\${ (geschweiften Klammern sind ok) und xml reservierte Zeichen <& und " |
91 "Zitate \" Parameter {a}, {b} und {c}", | 91 "Zitate \" Parameter {a}, {b} und {c}", |
92 "method": "Dies ergibt sich aus einer Methode", | 92 "YouveGotMessages_method": "Dies ergibt sich aus einer Methode", |
93 "nonLambda": "Diese Methode ist nicht eine Lambda", | 93 "nonLambda": "Diese Methode ist nicht eine Lambda", |
94 "staticMessage": "Dies ergibt sich aus einer statischen Methode", | 94 "staticMessage": "Dies ergibt sich aus einer statischen Methode", |
95 "thisNameIsNotInTheOriginal": "Could this lead to something malicious?", | 95 "thisNameIsNotInTheOriginal": "Could this lead to something malicious?", |
96 "originalNotInBMP": "Antike griechische Galgenmännchen Zeichen: 𐅆𐅇", | 96 "originalNotInBMP": "Antike griechische Galgenmännchen Zeichen: 𐅆𐅇", |
97 "escapable": "Escapes: \n\r\f\b\t\v.", | 97 "escapable": "Escapes: \n\r\f\b\t\v.", |
98 "sameContentsDifferentName": "Hallo Welt", | 98 "sameContentsDifferentName": "Hallo Welt", |
99 "differentNameSameContents": "Hallo Welt", | 99 "differentNameSameContents": "Hallo Welt", |
100 "rentToBePaid": "Miete", | 100 "rentToBePaid": "Miete", |
101 "rentAsVerb": "mieten", | 101 "rentAsVerb": "mieten", |
102 "plurals": "{num,plural, =0{Ist Null Plural?}=1{Dies ist einmalig}" | 102 "plurals": "{num,plural, =0{Ist Null Plural?}=1{Dies ist einmalig}" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 parser.addOption("output-dir", | 161 parser.addOption("output-dir", |
162 defaultsTo: '.', callback: (value) => targetDir = value); | 162 defaultsTo: '.', callback: (value) => targetDir = value); |
163 parser.parse(args); | 163 parser.parse(args); |
164 | 164 |
165 var fileArgs = args.where((x) => x.contains('.arb')); | 165 var fileArgs = args.where((x) => x.contains('.arb')); |
166 | 166 |
167 var messages = JSON.decode(new File(fileArgs.first).readAsStringSync()); | 167 var messages = JSON.decode(new File(fileArgs.first).readAsStringSync()); |
168 translate(messages, "fr", french); | 168 translate(messages, "fr", french); |
169 translate(messages, "de_DE", german); | 169 translate(messages, "de_DE", german); |
170 } | 170 } |
OLD | NEW |