twine icon indicating copy to clipboard operation
twine copied to clipboard

feature request - ordered parameters

Open altagir opened this issue 6 years ago • 5 comments

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

altagir avatar Jul 09 '19 14:07 altagir

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.

scelis avatar Jul 09 '19 14:07 scelis

Maybe we should mention that in the README :-)

sebastianludwig avatar Jul 09 '19 15:07 sebastianludwig

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

altagir avatar Jul 09 '19 18:07 altagir

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. :)

scelis avatar Jul 09 '19 19:07 scelis

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

altagir avatar Jul 09 '19 19:07 altagir

Closing due to inactivity.

scelis avatar Aug 25 '22 22:08 scelis