slang-i18n / slang

Type-safe i18n for Dart and Flutter
https://pub.dev/packages/slang
MIT License
459 stars 39 forks source link

feat(file_utils): add support for CSV files #185

Closed nikaera closed 8 months ago

nikaera commented 8 months ago

I implemented the encodeContent function so that dart run slang analyze can be used even if csv is used for translation files. I changed the translation file of example project from json to csv and verified that it works 🛠️

key,en,de
mainScreen.title,An English Title,Ein deutscher Titel
mainScreen.counter.one,You pressed $n time.,Du hast einmal gedrückt.
mainScreen.counter.other,You pressed $n times.,Du hast $n mal gedrückt.
mainScreen.tapMe,Tap me,Drück mich
unknownScreen.title,Unknown Title,Unbekannter Titel
key,@@info,en,de
@@info,"Here are translations that exist in secondary locales but not in <en>.\n[--full enabled] Furthermore, translations not used in 'lib/' according to the 't.<path>' pattern are written into <en>.",,
unknownScreen.title,,Unknown Title,
nikaera commented 8 months ago

I fixed the dart format failure in CI and pushed again 🙏 https://github.com/slang-i18n/slang/actions/runs/7436546343/job/20235506409

nikaera commented 8 months ago

I corrected the wrong commit author and re-committed and force pushed... 🙇 🙏

Tienisto commented 8 months ago

Thank you!