tree: 770720b3547be5b0ef6a4296b656dd28e0ce5b59 [path history] [tgz]
  1. intl_af.arb
  2. intl_am.arb
  3. intl_ar.arb
  4. intl_ar_EG.arb
  5. intl_ar_JO.arb
  6. intl_ar_MA.arb
  7. intl_ar_SA.arb
  8. intl_as.arb
  9. intl_az.arb
  10. intl_be.arb
  11. intl_bg.arb
  12. intl_bn.arb
  13. intl_bs.arb
  14. intl_ca.arb
  15. intl_cs.arb
  16. intl_da.arb
  17. intl_de.arb
  18. intl_de_AT.arb
  19. intl_de_CH.arb
  20. intl_el.arb
  21. intl_en.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.xml
  30. intl_en_ZA.arb
  31. intl_es.arb
  32. intl_es_419.arb
  33. intl_es_AR.arb
  34. intl_es_BO.arb
  35. intl_es_CL.arb
  36. intl_es_CO.arb
  37. intl_es_CR.arb
  38. intl_es_DO.arb
  39. intl_es_EC.arb
  40. intl_es_GT.arb
  41. intl_es_HN.arb
  42. intl_es_MX.arb
  43. intl_es_NI.arb
  44. intl_es_PA.arb
  45. intl_es_PE.arb
  46. intl_es_PR.arb
  47. intl_es_PY.arb
  48. intl_es_SV.arb
  49. intl_es_US.arb
  50. intl_es_UY.arb
  51. intl_es_VE.arb
  52. intl_et.arb
  53. intl_eu.arb
  54. intl_fa.arb
  55. intl_fi.arb
  56. intl_fil.arb
  57. intl_fr.arb
  58. intl_fr_CA.arb
  59. intl_fr_CH.arb
  60. intl_gl.arb
  61. intl_gsw.arb
  62. intl_gu.arb
  63. intl_he.arb
  64. intl_hi.arb
  65. intl_hr.arb
  66. intl_hu.arb
  67. intl_hy.arb
  68. intl_id.arb
  69. intl_is.arb
  70. intl_it.arb
  71. intl_ja.arb
  72. intl_ka.arb
  73. intl_kk.arb
  74. intl_km.arb
  75. intl_kn.arb
  76. intl_ko.arb
  77. intl_ky.arb
  78. intl_lo.arb
  79. intl_lt.arb
  80. intl_lv.arb
  81. intl_mk.arb
  82. intl_ml.arb
  83. intl_mn.arb
  84. intl_mr.arb
  85. intl_ms.arb
  86. intl_my.arb
  87. intl_nb.arb
  88. intl_ne.arb
  89. intl_nl.arb
  90. intl_or.arb
  91. intl_pa.arb
  92. intl_pl.arb
  93. intl_pt.arb
  94. intl_pt_BR.arb
  95. intl_pt_PT.arb
  96. intl_ro.arb
  97. intl_ru.arb
  98. intl_si.arb
  99. intl_sk.arb
  100. intl_sl.arb
  101. intl_sq.arb
  102. intl_sr.arb
  103. intl_sr_Latn.arb
  104. intl_sv.arb
  105. intl_sw.arb
  106. intl_ta.arb
  107. intl_te.arb
  108. intl_th.arb
  109. intl_tl.arb
  110. intl_tr.arb
  111. intl_uk.arb
  112. intl_ur.arb
  113. intl_uz.arb
  114. intl_vi.arb
  115. intl_zh.arb
  116. intl_zh_CN.arb
  117. intl_zh_HK.arb
  118. intl_zh_TW.arb
  119. intl_zu.arb
  120. README.md
lib/l10n/README.md

Localization

Creating New Locale Messages

When adding new strings to be localized, update intl_en.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.arb, it can be used in the app by regenerating the GalleryLocalizations delegate. 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.

Generating GalleryLocalizations

Running the application for the first time should generate a synthetic package containing the app's localizations through importing package:flutter_gen/gen_l10n/. The code is generated will be generated in .dart_tool/flutter_gen/gen_l10n/.

The generated localizations code is updated every time flutter run is called, and during hot reload and restart. This means that updates to existing arb files can be made and seen in real time during app development.

Generating GalleryLocalizations in the command line

From the root directory, run:

flutter gen-l10n \
    --template-arb-file=intl_en.arb \
    --output-localization-file=gallery_localizations.dart \
    --output-class=GalleryLocalizations

Generating the .xml source for the Google translation console

From the root directory, run dart tool/l10n_cli/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.

Note that the filename for intl_en_US.xml is used by the internal translation console and changing the filename may require manually updating already translated messages to point to the new file. Therefore, avoid doing so unless necessary.

Importing translations (for Flutter org members)

Once the translations are ready, use the internal tool (push_l10n) to push the updated intl_<locale>.arb files to this repo. For more information, see /third_party/dart/flutter_gallery/README.md.