The package offers translations for the quill toolbar and editor, it will follow the locale that is defined in
your WidgetsApp
for example MaterialApp
which usually follows the system locally unless you set your own locale.
Currently, translations are available for these 43 locales:
ar
,bg
,bn
,ca
,cs
,da
,de
en
,en_US
,es
,fa
,fr
,he
hi
,id
,it
,ja
,ko
,km
,ku
ms
,ne
,nl
,no
,pl
,pt
pt_BR
,ro
,ro_RO
,ru
,sk
,sr
sv
,sw
,th
,tk
,tr
,uk
,ur
vi
,zh
,zh_CN
,zh_HK
The translation files are located in the l10n folder. Feel free to contribute your own translations.
You can take a look at the untranslated.json file, which is a generated file that tells you which keys with which locales haven't been translated so you can find the missing easily.
Add new local
-
Create a new file in l10n folder, with the following name
quill_${localName}.arb
for examplequill_de.arb
. See locale codes. -
Copy the Arb Template file and paste it into your new file, replace the values with your translations
-
Update the Supported Locales section on this page to update the supported translations for both the number and the list
Update existing local
-
Navigate to l10n folder
-
Find the existing local, let's say you want to update the Korean translations, it will be
quill_ko.arb
-
Use untranslated.json as a reference to find missing, update, or add what you want to translate.
We usually avoid updating the existing value of a key in the template file without updating the key or creating a new one. This will not update the untranslated.json correctly and will make it harder for contributors to find missing or incomplete.
Once you finish, run the following script:
dart ./scripts/regenerate_translations.dart
Or (if you can't run the script for some reason):
flutter gen-l10n
dart fix --apply ./lib/src/l10n/generated
dart format ./lib/src/l10n/generated
The script above will generate Dart files from the Arb files to test the changes and take effect, otherwise you won't notice a difference.
🔧 If you added or removed translations in the template file, make sure to update
_expectedTranslationKeysLength
variable in scripts/translations_check.dart
Otherwise you don't need to update it.
Then open a pull request so everyone can benefit from your translations!