mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-31 12:21:19 -03:00
Add quotes around gettext string
This should prevent occurrences of the search string from being found in other locations (e.g. in a comment). The whole approach of string extraction from Rust sources is sketchy, but this at least prevents producing garbage when the content of a string appears somewhere else unquoted.
This commit is contained in:
@@ -30,7 +30,7 @@ for str in $strs
|
||||
# grep -P needed for string escape to be compatible (PCRE-style),
|
||||
# -H gives the filename, -n the line number.
|
||||
# If you want to run this on non-GNU grep: Don't.
|
||||
echo "#:" (grep -PHn -r -- (string escape --style=regex -- $str) src/ |
|
||||
echo "#:" (grep -PHn -r -- \"(string escape --style=regex -- $str)\" src/ |
|
||||
head -n1 | string replace -r ':\s.*' '')
|
||||
echo "msgid \"$str\""
|
||||
echo 'msgstr ""'
|
||||
|
||||
Reference in New Issue
Block a user