-
Notifications
You must be signed in to change notification settings - Fork 749
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SwiftGen-L10n] Manage positional placeholders (like %2$@
)
#6
Comments
If I understand this correctly, it should be possible to have the same parameter multiple times, right?
Right now that generates a function with two parameters, but I would expect only one. Can you confirm that's a bug? If so I'll file a separate issue :) |
I'd also expect the resulting enum to have only one parameter in such a situation indeed! Good catch |
Wait the printf-std syntax is actually |
Yup, I got the syntax wrong! My bad. |
Well to be fair this syntax is a little RegEx-like and confusing ^^ what an ugly standard/convention in the first place, thank you C legacy ^^ |
As in some languages the various texts are not always in the same order, it's not that rare to have positional placeholders like
%2$@
in theLocalizable.strings
strings representing formats.We need to be able to handle them properly, by storing the associated type at the right position in the
[PlaceholderType]
array.Also check the official rules used by
printf
for that (like what about%3$@ %2$f %@
, does the last%@
use the parameter at index 3 because it's incrementing the position from the last positional character encountered (2+1)? or do it use the first parameter? What are the official rules already?)The text was updated successfully, but these errors were encountered: