scelis / twine

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

Create default translations (res/value) folder when formatting for Android #225

Closed cody1024d closed 5 years ago

cody1024d commented 7 years ago

As of now, based on this cmd line:

'if hash twine 2>/dev/null; then twine generate-all-localization-files ../../../Twine/twine.txt ./src/main/res/ -r --format android; fi'

a default folder, values is not being generated. This becomes isn't necessarily an issue, but I could see this as a feature improvement. I can add an additional script line to copy over the values-en/strings.xml file, to ensure I have default translations, but could see Twine doing this for me as a nice enhancement?

scelis commented 6 years ago

Hello. Thanks for the feedback!

I could see doing something similar to what Twine does for the iOS Base localization directory where we use the "developer language" for strings created there.

However, as I do not do Android development myself, and because there is a simple workaround allowing you to write strings there with an additional twine command, I would like to leave this open for a bit to gather feedback from other Android developers to see if this feature would be desirable or useful for others.

cody1024d commented 6 years ago

@scelis

What is the additional twine command? Perhaps I missed that. Right now, I'm shelling out to the command line to copy the values-en/strings.xml (in my case I want english as the default translation) into the values folder.

scelis commented 6 years ago

@cody1024d You should be able to do it by running:

twine generate-localization-file strings.txt values/strings.xml --lang en --format android

cody1024d commented 6 years ago

Ahh, that does make sense, duh! Thanks @scelis

gingo commented 6 years ago

@scelis we want to import all translations from Twine and create all values-xy strings automatically. Unfortunately current Twine version generates also default language folder (usually values-en). Correct behavior is to generate developer language to values folder, as requested by @cody1024d.

Current version requires to move file from values-en to values manually.

scelis commented 5 years ago

Addressed in #276