-
Notifications
You must be signed in to change notification settings - Fork 739
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
Strings: structured-swift3/4
crash when a key ends with a .
#528
Comments
Can you share your strings file? |
Ok, I've found the problem. It was in this line
Before it was not generated at all. But some strings like this were generated like
but now we've got the problem. Thanks! P.S. problem that in the project we have a lot of this type of strings, because we are on migrating from it to swiftgen. And now some strings are used with old way, but some with new swiftgen way. |
Thanks for the feedback, that will help us zeroing on the source of the bug. So it's probably indeed because your key uses some non-ASCII characters that make Stencil segfault. Of course, your Might be that we did some changes in the So imho since it's crashing during the generation itself, it's more probable that it's a segfault in the code of the Stencil library itself. |
Oh wait, I found the reason. Nothing to do with non-ASCII characters. That's because the key ends with a Which actually makes kinda sense, because as you said in your initial report, that crash only occurs with |
Yeah, makes sense! |
structured-swift3
and structured-swift-4
don't work with swiftgen 6.0.0structured-swift3/4
crash when a key ends with a .
Let's keep the issue around until we can get it properly tested and fixed |
@AlexIzh side note: since you seem to be migrating from Localizable.strings having the translation as the key to Localizable.strings having structured keys (as you were trying to use the
This way your constants generated by SwiftGen won't be "polluted" by the old keys you haven't had time to rename yet. And then you can iterate over your code to move some keys batch by batch to the (And once you've migrated all the keys, you could always remove the empty That's just a suggestion, maybe it won't fit your migration process idk, but that's what we used on a legacy project when we had to do a similar migration 😉 PS: You might also be interested in adding SwiftLint rules to your project to show you warnings on your code about keys left to migrate 😉 |
Thanks, that sounds much better than what we have right now. I'll figure it out, don't know how it will work with server-side translation tools, like phraseapp. But anyway, this solution much more cleaner, thanks for that! |
FWIW, we use POEditor (+ the So if PhraseApp offers a similar feature, you could imagine tag translations that have been updated with a nicer key, and ask |
Example:
at the same time
flat-swift3
andflat-swift4
work like a charmThe text was updated successfully, but these errors were encountered: