-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
Decoding error with substitutions #34
Comments
Thanks for raising! This seems like the same as #26 where I was expecting I was using this value to help repurpose the substation names ( Anyway… A workaround for now is to manually add Hopefully I’ll have an actual fix this month though once I’m fully back into Xcode 😃 |
I’m also curious about how this JSON was formed.. was it from a migration? There are a few other strange pieces that I’ve not seen before.. the You can compare to the snapshot of what I made Xcode produce for the test suite: xcstrings-tool/Tests/XCStringsToolTests/__Fixtures__/Substitution.xcstrings Lines 1 to 54 in 0c77774
Depending on how your JSON was formed though, I might need to figure out how to support it |
The JSON here was manually written out, based on this answer to a similar question I came across on the dev forums: https://developer.apple.com/forums/thread/737329?answerId=764796022#764796022 It's a tricky problem to solve, it seems, where I want to pluralise the string based on the numeric argument, but I then don't want to use it at all in my localisation value, and instead want to use a second string argument (in this case, a formatted, number; I wish to render say If I add an explicit
|
Okay so I rearranged things a bit to be able to add the
|
Hmm yeah, this is an edge case that doesn't have a solution with my current approach... Currently, the implementation parses the placeholders from a flattened format string such as the following: "%@: There are %lld items remaining" In the above example, we see In order to be able to figure out the argument types like ☝️ when it comes to substitutions, I flatten them myself... For example, if we had In your case, This is in theory fixable though as we have the information that we need in the |
In my app I have some scenarios where I need to pluralise a string that needs to display not a number directly but a formatted value for it. I'm using substitutions for this, which seems to work just fine in Xcode by itself, but these don't seem to be parsed correctly by XCStrings-tool, and I get an error reading:
Here's the raw source for one of the keys that's causing this issue:
The text was updated successfully, but these errors were encountered: