Add an "_" builtin to call into gettext#7036
Merged
faho merged 3 commits intofish-shell:masterfrom May 29, 2020
Merged
Conversation
We already have gettext in C++ (if available), so it seems weird to fork off a command to start it from script. This is only for fish's own translations. There's no way to call into other catalogs, it just translates all arguments separately. This is faster by a factor of ~1000, which allows us to call translations much more, especially from scripts. E.g. making fish_greeting global by default would hurt cost-wise, given that my fish starts up in 8ms and just calling the current `_` function takes 2ms, and that would have two calls. Incidentally, this also makes us rely on a weirdly defined function less, so it: Fixes fish-shell#6804.
Let's see if that filename works out.
zanchey
reviewed
May 25, 2020
Member
zanchey
left a comment
There was a problem hiding this comment.
I thought I'd considered this in the past and decided against it, but I can't find any reason why; perhaps that was when fish handled changes in locale variables rather worse than it does now. So I think it's a good idea!
Member
Author
|
Merged. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
We already have gettext in C++ (if available), so it seems weird to
fork off a command to start it from script.
This is only for fish's own translations. There's no way to call into
other catalogs, it just translates all arguments separately.
This is faster by a factor of ~1000, which allows us to call
translations much more, especially from scripts.
E.g. making fish_greeting global by default would hurt cost-wise,
given that my fish starts up in 8ms and just calling the current
_function takes 2ms, and that would have two calls.
Incidentally, this also makes us rely on a weirdly defined function
less, so it:
Fixes #6804.
TODOs: