Moving translation arguments to more flexible arguments #2426
lewri
started this conversation in
Research Room
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
CorsixTH/CorsixTH/Lua/string_extensions.lua
Lines 105 to 118 in 87858c2
Currently the majority of our strings use
%s
and%d
, where they can expect certain types. This can pose an issue to translators if they needed to swap order of arguments of strings without prior knowledge of how those arguments work. A translator can get around this by converting arguments to the newer%[1-9]%
format, which does not discriminate against type and targets the [n]th argument in a string.format call. Is it correct to assume translators have this knowledge?Within our translation files, we can see that translators almost exclusively find easiest to use what they are given in the original string (if we use
%s
they use%s
,%1%
they use%1%
etc. If we wanted to grant more flexibility across the board (and help prevent string format crashes) we could encourage switching to use%[1-9]%
in every place possible in our strings. Original strings may not be targetable due to copyright, but amended or new strings can be. Some additional notation may need adding to a translation file for basic guidance.Beta Was this translation helpful? Give feedback.
All reactions