RemafoX icon indicating copy to clipboard operation
RemafoX copied to clipboard

[Feat] do not assign empty string to missing translations

Open wleivsco opened this issue 1 year ago • 3 comments

Problem Statement

For example, I have an English string "button_title" = "ok", but no translated string in Spanish

When I run the Normalizer, the app automatically puts a string "button_title" = "" in the Spanish .strings file. This is a problem, because the app will load the empty string onto the UI instead of using a fallback english text.

Suggested Solution

Add an additional option in Normalizer to not add new strings in other languages.

wleivsco avatar Apr 20 '23 15:04 wleivsco

@wleivsco Thank you for requesting this feature.

If I understand you correctly, what you want is that RemafoX doesn't automatically add keys that exist in your source language, e.g. button_title in English, to the Spanish file and instead you want to simply ignore any differences in the set of keys that exist between different languages so that you can manually decide which keys you want to have in which language.

This is exactly what the "Harmonize with Source" option in the Normalizer configuration is for. If you turn it off, RemafoX will no longer do a comparison of keys between the source language and other languages and it should behave exactly like you described:

Bildschirmfoto 2023-04-20 um 23 31 51

Please let me know if this is what you were looking for.

By the way, if you configured the build script in Xcode, you should get warnings when building your app right within Xcode that point out the lines with empty translations: Bildschirmfoto 2023-04-20 um 23 42 57

So if "accidentally forgetting to translate" to a specific language is your main concern, then fixing all warnings could help solve that. That's how the options "Harmonize with Source" and "Check for empty Values" were designed to work together to help you prevent empty Strings: Bildschirmfoto 2023-04-20 um 23 38 24

But, of course, your development workflow may not work like that and you might want to disable "Harmonize with Source".

I hope this helps!

Jeehut avatar Apr 20 '23 21:04 Jeehut

Hi, I do want to keep "Harmonize with Source" checked because I do want to remove any strings from Spanish .strings file that are no longer in English. I just don't want to add new ones.

wleivsco avatar Apr 20 '23 21:04 wleivsco

@wleivsco I understand now, so you want me to split the behavior of "Harmonize with Source" to an additive and destructive part and make them separately configurable. Sounds reasonable. I'll see what I can do in the next release.

Thank you for the clarification. 👍

Jeehut avatar Apr 21 '23 05:04 Jeehut