JGeek00 / droid-hole

Pi-hole® client made with Flutter
Apache License 2.0
135 stars 11 forks source link

Translation of strings (German) #8

Closed 7wells closed 1 year ago

7wells commented 1 year ago

@JGeek00 I've forked your repo and have started with the translation locally. As German is sometimes a bit lengthy compared to English, I suggested here and there a bit briefer description (without losing content). Some terms (e.g. "clients", "servers", or "logs") I left untranslated (only capitalized the first letter as usual for nouns in German) as they are known well enough and have no real German translations - at least not that I know of. ;-)

There is a little typo in line 93 of lib/l10n/app_en.arb:

92 "couldntAddWhitelist": "Could not add domain to whitelist.",
93 "couldntAddBlacklist": "Could not add domain to whitelist.",

The translation string in line 93 should end with "blacklist.".

Similarly in lines 92 and 93 of lib/l10n/app_es.arb:

92 "couldntAddWhitelist": "No se ha podido añadir el dominio a lista negra.",
93 "couldntAddBlacklist": "No se ha podido añadir el dominio a lista blanca.",

The translation strings seem to be mixed up.

I corrected this already in my fork (Spanish, English, and German). ;-)

I wonder where the below strings are shown in the app, so I don't know how to adequately translate them (without knowing the context). I assume they have to do with the logs screen but cannot find anything like "from last" (neither in the filter, nor in the sorting setting), etc.. Can you please help me to better understand this? Thank you! :-)

96 "fromLast": "from last",
97 "hours": "hours",
98 "minutes": "minutes",
99 "between": "between",
100 "and": "and",
101 "now": "now",

For the time being, I keep the English original strings for the above.

Would you agree to translate "device" the same as "client", or do you see a difference?

110 "device": "Device",

To be continued... ;-)

EDIT/PS 1: Since Android Studio is still very new to me, could you please point me to some worthwhile reading, so I better understand what exactly I need to contribute to your project? So far, I have forked your repo, cloned it in Android, added the app_de.arb file and modified the English and Spanish string files as mentioned above. Then I used the 'commit' function put cannot see the German strings file in my forked repo. Do I need to push, too? I tried that but got the message that pushing was cancelled as it would make my email address public (which I habe forbidden in the GitHub privacy settings, and I want to keep it this way, if possible). So now I am a bit lost as how to proceed. Anyway, I will continue with the translation. If all fails, I can still send you the resulting file by other means, I guess, but I would love to learn the right way. :-)

PS2: Never mind, I got it after reading this helpful article and can now see the changes in my repo that I forked from you: https://github.com/7wells/droid-hole/commit/1c6c205c7eef0d1b8c469eaff2027e94cee274d8

JGeek00 commented 1 year ago

First of all, thanks for your interest in contributing with the project.

Yes, as I can see, these strings are wrong. Thanks for fixing it.

That strings are located on the logs tab, and they appear when you filter the logs but there are no logs to display with that filtering. That string is located on screens/logs.dart lines 388 and 391. Everywhere you see AppLocalizations.of(context)!.xxxxxx is a text that comes from the translations file. For example, if you see AppLocalizations.of(context)!.home will be replaced with the string corresponding for key 'home' on the translations file.

Yes, you can translate device as the same as client. In this case it has the same meaning.

As I can see from that commit, you haven't added the German translation to the supportedTranslations array. For adding the German translation you have to go to main.dart and, on line 183, add Locale('de', '') to the supportedLocales array, leaving it like this: supportedLocales: const [ Locale('en', ''), Locale('es', ''), Locale('de', '') ],