tree: 57aeab22afc209ed8c8d0a1da3b006dbac3ac63f [path history] [tgz]
  1. gallery_localizations.dart
  2. intl_af.arb
  3. intl_am.arb
  4. intl_ar.arb
  5. intl_ar_EG.arb
  6. intl_ar_JO.arb
  7. intl_ar_MA.arb
  8. intl_ar_SA.arb
  9. intl_as.arb
  10. intl_az.arb
  11. intl_be.arb
  12. intl_bg.arb
  13. intl_bn.arb
  14. intl_bs.arb
  15. intl_ca.arb
  16. intl_cs.arb
  17. intl_da.arb
  18. intl_de.arb
  19. intl_de_AT.arb
  20. intl_de_CH.arb
  21. intl_el.arb
  22. intl_en_AU.arb
  23. intl_en_CA.arb
  24. intl_en_GB.arb
  25. intl_en_IE.arb
  26. intl_en_IN.arb
  27. intl_en_NZ.arb
  28. intl_en_SG.arb
  29. intl_en_US.arb
  30. intl_en_US.xml
  31. intl_en_ZA.arb
  32. intl_es.arb
  33. intl_es_419.arb
  34. intl_es_AR.arb
  35. intl_es_BO.arb
  36. intl_es_CL.arb
  37. intl_es_CO.arb
  38. intl_es_CR.arb
  39. intl_es_DO.arb
  40. intl_es_EC.arb
  41. intl_es_GT.arb
  42. intl_es_HN.arb
  43. intl_es_MX.arb
  44. intl_es_NI.arb
  45. intl_es_PA.arb
  46. intl_es_PE.arb
  47. intl_es_PR.arb
  48. intl_es_PY.arb
  49. intl_es_SV.arb
  50. intl_es_US.arb
  51. intl_es_UY.arb
  52. intl_es_VE.arb
  53. intl_et.arb
  54. intl_eu.arb
  55. intl_fa.arb
  56. intl_fi.arb
  57. intl_fil.arb
  58. intl_fr.arb
  59. intl_fr_CA.arb
  60. intl_fr_CH.arb
  61. intl_gl.arb
  62. intl_gsw.arb
  63. intl_gu.arb
  64. intl_he.arb
  65. intl_hi.arb
  66. intl_hr.arb
  67. intl_hu.arb
  68. intl_hy.arb
  69. intl_id.arb
  70. intl_is.arb
  71. intl_it.arb
  72. intl_ja.arb
  73. intl_ka.arb
  74. intl_kk.arb
  75. intl_km.arb
  76. intl_kn.arb
  77. intl_ko.arb
  78. intl_ky.arb
  79. intl_lo.arb
  80. intl_lt.arb
  81. intl_lv.arb
  82. intl_mk.arb
  83. intl_ml.arb
  84. intl_mn.arb
  85. intl_mr.arb
  86. intl_ms.arb
  87. intl_my.arb
  88. intl_nb.arb
  89. intl_ne.arb
  90. intl_nl.arb
  91. intl_or.arb
  92. intl_pa.arb
  93. intl_pl.arb
  94. intl_pt.arb
  95. intl_pt_BR.arb
  96. intl_pt_PT.arb
  97. intl_ro.arb
  98. intl_ru.arb
  99. intl_si.arb
  100. intl_sk.arb
  101. intl_sl.arb
  102. intl_sq.arb
  103. intl_sr.arb
  104. intl_sr_Latn.arb
  105. intl_sv.arb
  106. intl_sw.arb
  107. intl_ta.arb
  108. intl_te.arb
  109. intl_th.arb
  110. intl_tl.arb
  111. intl_tr.arb
  112. intl_uk.arb
  113. intl_ur.arb
  114. intl_uz.arb
  115. intl_vi.arb
  116. intl_zh.arb
  117. intl_zh_CN.arb
  118. intl_zh_HK.arb
  119. intl_zh_TW.arb
  120. intl_zu.arb
  121. messages_af.dart
  122. messages_all.dart
  123. messages_am.dart
  124. messages_ar.dart
  125. messages_ar_EG.dart
  126. messages_ar_JO.dart
  127. messages_ar_MA.dart
  128. messages_ar_SA.dart
  129. messages_as.dart
  130. messages_az.dart
  131. messages_be.dart
  132. messages_bg.dart
  133. messages_bn.dart
  134. messages_bs.dart
  135. messages_ca.dart
  136. messages_cs.dart
  137. messages_da.dart
  138. messages_de.dart
  139. messages_de_AT.dart
  140. messages_de_CH.dart
  141. messages_el.dart
  142. messages_en_AU.dart
  143. messages_en_CA.dart
  144. messages_en_GB.dart
  145. messages_en_IE.dart
  146. messages_en_IN.dart
  147. messages_en_NZ.dart
  148. messages_en_SG.dart
  149. messages_en_US.dart
  150. messages_en_ZA.dart
  151. messages_es.dart
  152. messages_es_419.dart
  153. messages_es_AR.dart
  154. messages_es_BO.dart
  155. messages_es_CL.dart
  156. messages_es_CO.dart
  157. messages_es_CR.dart
  158. messages_es_DO.dart
  159. messages_es_EC.dart
  160. messages_es_GT.dart
  161. messages_es_HN.dart
  162. messages_es_MX.dart
  163. messages_es_NI.dart
  164. messages_es_PA.dart
  165. messages_es_PE.dart
  166. messages_es_PR.dart
  167. messages_es_PY.dart
  168. messages_es_SV.dart
  169. messages_es_US.dart
  170. messages_es_UY.dart
  171. messages_es_VE.dart
  172. messages_et.dart
  173. messages_eu.dart
  174. messages_fa.dart
  175. messages_fi.dart
  176. messages_fil.dart
  177. messages_fr.dart
  178. messages_fr_CA.dart
  179. messages_fr_CH.dart
  180. messages_gl.dart
  181. messages_gsw.dart
  182. messages_gu.dart
  183. messages_he.dart
  184. messages_hi.dart
  185. messages_hr.dart
  186. messages_hu.dart
  187. messages_hy.dart
  188. messages_id.dart
  189. messages_is.dart
  190. messages_it.dart
  191. messages_ja.dart
  192. messages_ka.dart
  193. messages_kk.dart
  194. messages_km.dart
  195. messages_kn.dart
  196. messages_ko.dart
  197. messages_ky.dart
  198. messages_lo.dart
  199. messages_lt.dart
  200. messages_lv.dart
  201. messages_messages.dart
  202. messages_mk.dart
  203. messages_ml.dart
  204. messages_mn.dart
  205. messages_mr.dart
  206. messages_ms.dart
  207. messages_my.dart
  208. messages_nb.dart
  209. messages_ne.dart
  210. messages_nl.dart
  211. messages_or.dart
  212. messages_pa.dart
  213. messages_pl.dart
  214. messages_pt.dart
  215. messages_pt_BR.dart
  216. messages_pt_PT.dart
  217. messages_ro.dart
  218. messages_ru.dart
  219. messages_si.dart
  220. messages_sk.dart
  221. messages_sl.dart
  222. messages_sq.dart
  223. messages_sr.dart
  224. messages_sr_Latn.dart
  225. messages_sv.dart
  226. messages_sw.dart
  227. messages_ta.dart
  228. messages_te.dart
  229. messages_th.dart
  230. messages_tl.dart
  231. messages_tr.dart
  232. messages_uk.dart
  233. messages_ur.dart
  234. messages_uz.dart
  235. messages_vi.dart
  236. messages_zh.dart
  237. messages_zh_CN.dart
  238. messages_zh_HK.dart
  239. messages_zh_TW.dart
  240. messages_zu.dart
  241. README.md
gallery/lib/l10n/README.md

Localization

Generating New Locale Messages

When adding new strings to be localized, update intl_en_US.arb, which is used by this project as the template. When creating new entries, they have to be in the following format:

  "dartGetterVariableName": "english translation of the message",
  "@dartGetterVariableName": {
    "description": "description that the localizations delegate will use."
  },

In this example, dartGetterVariableName should be the Dart method/property name that you will be using in your localizations delegate.

After adding the new message in intl_en_US.arb, it can be used in the app by regenerating the GalleryLocalizations delegate and the messages_*.dart files. This allows use of the English message through your localizations delegate in the application code immediately without having to wait for the translations to be completed.

How to Generate GalleryLocalizations with Grinder

From the samples/gallery/gallery/ directory:

  1. Make sure you have grinder installed by running flutter pub get.
  2. Then run flutter pub run grinder l10n to generate GalleryLocalizations.

For more details on what flutter pub run grinder l10n runs, you can read below under How to Generate GalleryLocalizations with l10n scripts. The current supported locales list is sorted alphabetically. This means that after running the script, you have to update gallery_localizations.dart and move the en_US locale to the top of the list.

How to Generate GalleryLocalizations with l10n scripts

To generate GalleryLocalizations, from samples/gallery/gallery/ run:

dart ${YOUR_FLUTTER_PATH}/dev/tools/localization/bin/gen_l10n.dart \
    --template-arb-file=intl_en_US.arb \
    --output-localization-file=gallery_localizations.dart \
    --output-class=GalleryLocalizations

From samples/gallery/gallery/, run dart ../l10n_cli/bin/main.dart, which will generate intl_en_US.xml. This will be used by the internal translation console to generate messages in the different locales.

Run the formatter to make the Flutter analyzer happy:

flutter format .

Generating New Locale Arb Files

Use the internal tool to create the intl_<locale>.arb files once the translations are ready.

Generating Flutter Localization Files

If new translations are ready and the intl_<locale>.arb files are already available, run the following commands to generate all necessary messages_<locale>.dart files and the localizations_delegate.dart file:

flutter pub run grinder l10n

which is equal to

dart ${YOUR_FLUTTER_PATH}/dev/tools/localization/bin/gen_l10n.dart \
    --template-arb-file=intl_en_US.arb \
    --output-localization-file=gallery_localizations.dart \
    --output-class=GalleryLocalizations

flutter format .

This ensures the generated .dart files updated with the latest translations.