-
Notifications
You must be signed in to change notification settings - Fork 766
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
Bypass String(format:) to prevent escaping percentage symbols #848
Comments
func escapePercentIfNeeded(_ input: String) -> String { Let Me Know If I am Wrong Somewhere. |
@mokshitgogia this is wrong code and doesn't solve the issue. @mac-cain13 could you check it out? |
The issue is in StringResource+Integration:
I think when there are no arguments provided, String should initialise from format, otherwise keep old implementation. Am I missing something? |
Correct. This issue was introduced by #768 by @tomlokhorst. |
I've run into the very same problem as well. PS. Remember not to push modified files to the phrase back |
Now that strings are always formatted using
String(format:)
(even strings without arguments) we have to escape any percentage signs (%
) with%%
Our strings are hosted on phrase.com and also used in our Android project. This means I cannot go to the source and replace things like "get a 40% discount" with "get a 40%% discount", because that will have effects on other platforms as well.
Is there a possibility to opt out of this behavior, so that we don't have to escape the percentage symbol in strings that do not contain arguments?
The text was updated successfully, but these errors were encountered: