-
Notifications
You must be signed in to change notification settings - Fork 1.2k
prevent crash when localizing empty string #19459
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
base: master
Are you sure you want to change the base?
Conversation
|
The implementation is rather inefficient; building a list of strings and then concatenating that with This also checks up front if the string is NULL, which would be the only reason for This also corrects handling of built-in presets. These are all marked with the BUILTIN_PREFIX and marked for translation as a whole. There is no support for translating them per-segment, so we should not fall back to trying to do this when no translation is found (which would likely be because we are using the English locale; no harm done, because we won't find any EDIT: Ah, this now doesn't do the cleanup of irregular spacing around "|". So I guess we'll have to do the split-and-rejoin for builtins no matter what, even if a as-a-whole translation is found, just to support both "|" and " | " anyway, even if all original and translated strings did spacing consistently. We could skip
|
Missed that - it's easy to miss the _ |
|
Since we have two alternative paths, |
|
@ralfbrown have you had time and interest to look at my last proposal above? If so (or if not) what are your plans for this PR? Would you prefer me submitting a separate/competing one? As said, I haven't actually tested this against the original bug report so don't know if this will prevent a crash. Maybe the first lines should be: Obviously there's also benefit to hardening |
Ref #19431