scelis / twine

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

feature request - ordered parameters #284

Closed altagir closed 2 years ago

altagir commented 5 years ago

Hello Right now the field for parameter insertion is %@ Could it be possible to have ordered parameters like %1@ , %2@ order of parameters may not be the same in all languages Thanks

scelis commented 5 years ago

For ease of editing and simplicity, the developer language string in the twine file defaults to unordered parameters. However, each translation is more than welcome to change the order by using %1$@, %2$f, etc.

sebastianludwig commented 5 years ago

Maybe we should mention that in the README :-)

altagir commented 5 years ago

Thanks! Yes it would be nice to see it in README :)

Upon testing this translation : The file %@ could not be found %1$@ %2$@

works for iOS, however for android it produces :

The value "The file %@ could not be found %1$@ %2$@" contains numbered and non-numbered placeholders

I understand it cannot be mixed though, just surprised of difference between android and iOS

scelis commented 5 years ago

You can't mix and match numbered with non-numbered arguments. I believe that causes an error anywhere you would try it. You should use either The file %@ could not be found %@ %@ or The file %1$@ could not be found %2$@ %3$@ and it should properly work on both iOS and Android (the Android formatter will change every %@ to %s). If any of this does not seem to be working as described that would be a bug we should definitely fix. :)

altagir commented 5 years ago

No everything works fine, just tested it It makes perfect sense not to be able to match them But only Android warns about it, iOS generation doesn't

scelis commented 2 years ago

Closing due to inactivity.