scelis / twine

Twine is a command line tool for managing your strings and their translations.
Other
840 stars 151 forks source link

Empty language string auto filled in with default language #293

Closed KlaartjeDB closed 4 years ago

KlaartjeDB commented 4 years ago

First I want to thank you for this wonderful tool. Just a small issue I have right now. I'm using a couple of different languages in my master file that I build for both iOS and Android and this is going great. However whenever one of the languages is not filled in, it will automatically create the langue using the english string. I would rather have it keep empty so I can easily see which of the strings still need translations. Can you help here?

scelis commented 4 years ago

Hello! This is a duplicate of #292 -- I'm going to close this but please feel free to follow up there or here with additional information if this doesn't help and we can consider re-opening.

KlaartjeDB commented 4 years ago

Hey Scelis,

thanks for the help. This is however not helping as it's not generating any strings at all right now. I'm using this command: twine generate-localization-file ./localisations/$1_localisation.txt ./build/$1/Localizable-$2.strings --format apple --lang $2 --include untranslated without the --include untranslated it's working fine, but with it, it's saying

Nothing to generate! The resulting file would not contain any translations.

scelis commented 4 years ago

Ahhh, sorry. I understand what you are looking for, now. Would you mind including a sample twine file and command that exhibits this behavior? I believe the above command should work but I would be happy to look into it with a small reproducible test case.

KlaartjeDB commented 4 years ago

[privacy_statement_url] en = https://terms.conneq.tech/%1$@/privacy-statement/%2$@.html [powercut] en = %@'s Connect module is switched off. de = Das Connect-Modul von %@ ist ausgeschaltet. nl = %@ zijn Connect module uit staat. sv = %@'s batteri är avstängt. [lowbattery] en = %@'s Connect module is low on battery. de = Das Connect-Modul von %@ hat einen niedrigen Akkustand. nl = %@ zijn Connect module bijna leeg is. sv = %@'s uppkoppligsmodul har låg batterinivå

scelis commented 4 years ago

What command are you running?

twine generate-localization-file test.txt Localizable.strings --format apple --lang de --include untranslated

Running that gives me:

/**
 * Apple Strings File
 * Generated by Twine 1.0.6
 * Language: de
 */

"privacy_statement_url" = "https://terms.conneq.tech/%1$@/privacy-statement/%2$@.html";

Which matches my expectations of how --include untranslated should work

KlaartjeDB commented 4 years ago

I'm running twine generate-localization-file ./localisations/$1_localisation.txt ./build/$1/Localizable-$2.strings --format apple --lang $2 --include untranslated

where $1 and $2 are variables but they should be correct

KlaartjeDB commented 4 years ago

they work without the --include untranslated at least

scelis commented 4 years ago

I'm afraid it's hard to help without the exact command that ends up getting executed. Can you reproduce your issue with a vanilla twine command?

KlaartjeDB commented 4 years ago

Hi,

I did what you asked and made a test, I understand it now. I was looking for --include translated instead. Sorry for taking up so much of your time

scelis commented 4 years ago

Glad you got it to work!