Closed slavap closed 1 year ago
Could you please confirm that I understand your request correctly?
Sometimes we just copy-paste *_en.arb file for other locales and you want to translate only entries which are not translated (equal in source & target file) by specifying a command argument?
Did you try to use the -k ok -k close
to translate only these entries or it is not suitable solution?
@sxtfv yes, let’s say after strings “extract” I have 50+ new keys in EN and DE arb files. They are not added manually, intl_utils just adds them to all arb files automatically (untranslated). List them all in -k is just impractical.
@slavap okay, I will add it
@slavap I just pushed an update (1.0.11) which adds a new command line argument --translate-equal
or -e
which enables requested feature
@sxtfv Thank you, it works, but I don't think it is good idea to count equal empty labels.
flutter_arb_translator:main.
08-21-2023 19:24:14 [ARBTranslator] TRC: Started translation from en to [de]
08-21-2023 19:24:14 [ARBTranslator] TRC: Total entries count: 21
08-21-2023 19:24:14 [ARBTranslator] TRC: Unmodified entries count: 15
08-21-2023 19:24:14 [ARBTranslator] TRC: To translate entries count: 6
==============================================================
findTitle
[en] [SRC]: ""
[de] [EDT]: "" -> ""
==============================================================
findTopMsg
[en] [SRC]: ""
[de] [EDT]: "" -> ""
==============================================================
findBottomMsg
[en] [SRC]: ""
[de] [EDT]: "" -> ""
==============================================================
invoiceDetails
[en] [SRC]: "Details"
[de] [EDT]: "Details" -> "Einzelheiten"
==============================================================
amountDue
[en] [SRC]: "Amount Due"
[de] [EDT]: "Amount Due" -> "Fälliger Betrag"
==============================================================
ok
[en] [SRC]: "OK"
[de] [EDT]: "OK" -> "OK"
@slavap sure, I didn't consider this. Will fix soon
@slavap fixed in 1.0.12, actually empty strings were not translated (the package did not send an API request to translate it) but were considered as edited. Now they are considered as unmodified
@sxtfv Thank you, it works great now.
Example: app_en.arb
and app_de.arb is actually the same, because many translation utils add a label to all arb files simultaneously, i.e. if refactoring chosen for "Hello world" string in the code, this string will be added to all existing arb files.
So it would be nice to have a parameter to enforce translation for labels with the same content as in source arb.
in this case "ok" and "close" labels should be sent for translation (if parameter specified), because they are the same in EN and DE arb files.