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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 "}" | 55 "}" |
56 "}" | 56 "}" |
57 "female{" | 57 "female{" |
58 "{number,plural, " | 58 "{number,plural, " |
59 "=1{{names} était allée à la {place}}" | 59 "=1{{names} était allée à la {place}}" |
60 "other{{names} étaient allées à la {place}}" | 60 "other{{names} étaient allées à la {place}}" |
61 "}" | 61 "}" |
62 "}" | 62 "}" |
63 "}", | 63 "}", |
64 "outerPlural": "{n,plural, =0{rien}=1{un}other{quelques-uns}}", | 64 "outerPlural": "{n,plural, =0{rien}=1{un}other{quelques-uns}}", |
65 "outerGender": "{g,select, male{homme}female{femme}other{autre}}", | 65 "outerGender": "{g,select, male {homme} female {femme} other {autre}}", |
66 "pluralThatFailsParsing": "{noOfThings,plural, " | 66 "pluralThatFailsParsing": "{noOfThings,plural, " |
67 "=1{1 chose:}other{{noOfThings} choses:}}", | 67 "=1{1 chose:}other{{noOfThings} choses:}}", |
68 "nestedOuter": "{number,plural, other{" | 68 "nestedOuter": "{number,plural, other{" |
69 "{gen,select, male{{number} homme}other{{number} autre}}}}", | 69 "{gen,select, male{{number} homme}other{{number} autre}}}}", |
70 "outerSelect": "{currency,select, CDN{{amount} dollars Canadiens}" | 70 "outerSelect": "{currency,select, CDN{{amount} dollars Canadiens}" |
71 "other{{amount} certaine devise ou autre.}}}", | 71 "other{{amount} certaine devise ou autre.}}}", |
72 "nestedSelect": "{currency,select, CDN{{amount,plural, " | 72 "nestedSelect": "{currency,select, CDN{{amount,plural, " |
73 "=1{{amount} dollar Canadien}" | 73 "=1{{amount} dollar Canadien}" |
74 "other{{amount} dollars Canadiens}}}" | 74 "other{{amount} dollars Canadiens}}}" |
75 "other{N'importe quoi}" | 75 "other{N'importe quoi}" |
(...skipping 85 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 |