Skip to content

Commit 4b407bc

Browse files
pcloudsgitster
authored andcommitted
i18n: grep: mark parseopt strings for translation
Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 6705c16 commit 4b407bc

File tree

1 file changed

+45
-45
lines changed

1 file changed

+45
-45
lines changed

builtin/grep.c

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include "dir.h"
2020

2121
static char const * const grep_usage[] = {
22-
"git grep [options] [-e] <pattern> [<rev>...] [[--] <path>...]",
22+
N_("git grep [options] [-e] <pattern> [<rev>...] [[--] <path>...]"),
2323
NULL
2424
};
2525

@@ -680,84 +680,84 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
680680

681681
struct option options[] = {
682682
OPT_BOOLEAN(0, "cached", &cached,
683-
"search in index instead of in the work tree"),
683+
N_("search in index instead of in the work tree")),
684684
OPT_NEGBIT(0, "no-index", &use_index,
685-
"finds in contents not managed by git", 1),
685+
N_("finds in contents not managed by git"), 1),
686686
OPT_BOOLEAN(0, "untracked", &untracked,
687-
"search in both tracked and untracked files"),
687+
N_("search in both tracked and untracked files")),
688688
OPT_SET_INT(0, "exclude-standard", &opt_exclude,
689-
"search also in ignored files", 1),
689+
N_("search also in ignored files"), 1),
690690
OPT_GROUP(""),
691691
OPT_BOOLEAN('v', "invert-match", &opt.invert,
692-
"show non-matching lines"),
692+
N_("show non-matching lines")),
693693
OPT_BOOLEAN('i', "ignore-case", &opt.ignore_case,
694-
"case insensitive matching"),
694+
N_("case insensitive matching")),
695695
OPT_BOOLEAN('w', "word-regexp", &opt.word_regexp,
696-
"match patterns only at word boundaries"),
696+
N_("match patterns only at word boundaries")),
697697
OPT_SET_INT('a', "text", &opt.binary,
698-
"process binary files as text", GREP_BINARY_TEXT),
698+
N_("process binary files as text"), GREP_BINARY_TEXT),
699699
OPT_SET_INT('I', NULL, &opt.binary,
700-
"don't match patterns in binary files",
700+
N_("don't match patterns in binary files"),
701701
GREP_BINARY_NOMATCH),
702-
{ OPTION_INTEGER, 0, "max-depth", &opt.max_depth, "depth",
703-
"descend at most <depth> levels", PARSE_OPT_NONEG,
702+
{ OPTION_INTEGER, 0, "max-depth", &opt.max_depth, N_("depth"),
703+
N_("descend at most <depth> levels"), PARSE_OPT_NONEG,
704704
NULL, 1 },
705705
OPT_GROUP(""),
706706
OPT_SET_INT('E', "extended-regexp", &pattern_type,
707-
"use extended POSIX regular expressions",
707+
N_("use extended POSIX regular expressions"),
708708
pattern_type_ere),
709709
OPT_SET_INT('G', "basic-regexp", &pattern_type,
710-
"use basic POSIX regular expressions (default)",
710+
N_("use basic POSIX regular expressions (default)"),
711711
pattern_type_bre),
712712
OPT_SET_INT('F', "fixed-strings", &pattern_type,
713-
"interpret patterns as fixed strings",
713+
N_("interpret patterns as fixed strings"),
714714
pattern_type_fixed),
715715
OPT_SET_INT('P', "perl-regexp", &pattern_type,
716-
"use Perl-compatible regular expressions",
716+
N_("use Perl-compatible regular expressions"),
717717
pattern_type_pcre),
718718
OPT_GROUP(""),
719-
OPT_BOOLEAN('n', "line-number", &opt.linenum, "show line numbers"),
720-
OPT_NEGBIT('h', NULL, &opt.pathname, "don't show filenames", 1),
721-
OPT_BIT('H', NULL, &opt.pathname, "show filenames", 1),
719+
OPT_BOOLEAN('n', "line-number", &opt.linenum, N_("show line numbers")),
720+
OPT_NEGBIT('h', NULL, &opt.pathname, N_("don't show filenames"), 1),
721+
OPT_BIT('H', NULL, &opt.pathname, N_("show filenames"), 1),
722722
OPT_NEGBIT(0, "full-name", &opt.relative,
723-
"show filenames relative to top directory", 1),
723+
N_("show filenames relative to top directory"), 1),
724724
OPT_BOOLEAN('l', "files-with-matches", &opt.name_only,
725-
"show only filenames instead of matching lines"),
725+
N_("show only filenames instead of matching lines")),
726726
OPT_BOOLEAN(0, "name-only", &opt.name_only,
727-
"synonym for --files-with-matches"),
727+
N_("synonym for --files-with-matches")),
728728
OPT_BOOLEAN('L', "files-without-match",
729729
&opt.unmatch_name_only,
730-
"show only the names of files without match"),
730+
N_("show only the names of files without match")),
731731
OPT_BOOLEAN('z', "null", &opt.null_following_name,
732-
"print NUL after filenames"),
732+
N_("print NUL after filenames")),
733733
OPT_BOOLEAN('c', "count", &opt.count,
734-
"show the number of matches instead of matching lines"),
735-
OPT__COLOR(&opt.color, "highlight matches"),
734+
N_("show the number of matches instead of matching lines")),
735+
OPT__COLOR(&opt.color, N_("highlight matches")),
736736
OPT_BOOLEAN(0, "break", &opt.file_break,
737-
"print empty line between matches from different files"),
737+
N_("print empty line between matches from different files")),
738738
OPT_BOOLEAN(0, "heading", &opt.heading,
739-
"show filename only once above matches from same file"),
739+
N_("show filename only once above matches from same file")),
740740
OPT_GROUP(""),
741-
OPT_CALLBACK('C', "context", &opt, "n",
742-
"show <n> context lines before and after matches",
741+
OPT_CALLBACK('C', "context", &opt, N_("n"),
742+
N_("show <n> context lines before and after matches"),
743743
context_callback),
744744
OPT_INTEGER('B', "before-context", &opt.pre_context,
745-
"show <n> context lines before matches"),
745+
N_("show <n> context lines before matches")),
746746
OPT_INTEGER('A', "after-context", &opt.post_context,
747-
"show <n> context lines after matches"),
748-
OPT_NUMBER_CALLBACK(&opt, "shortcut for -C NUM",
747+
N_("show <n> context lines after matches")),
748+
OPT_NUMBER_CALLBACK(&opt, N_("shortcut for -C NUM"),
749749
context_callback),
750750
OPT_BOOLEAN('p', "show-function", &opt.funcname,
751-
"show a line with the function name before matches"),
751+
N_("show a line with the function name before matches")),
752752
OPT_BOOLEAN('W', "function-context", &opt.funcbody,
753-
"show the surrounding function"),
753+
N_("show the surrounding function")),
754754
OPT_GROUP(""),
755-
OPT_CALLBACK('f', NULL, &opt, "file",
756-
"read patterns from file", file_callback),
757-
{ OPTION_CALLBACK, 'e', NULL, &opt, "pattern",
758-
"match <pattern>", PARSE_OPT_NONEG, pattern_callback },
755+
OPT_CALLBACK('f', NULL, &opt, N_("file"),
756+
N_("read patterns from file"), file_callback),
757+
{ OPTION_CALLBACK, 'e', NULL, &opt, N_("pattern"),
758+
N_("match <pattern>"), PARSE_OPT_NONEG, pattern_callback },
759759
{ OPTION_CALLBACK, 0, "and", &opt, NULL,
760-
"combine patterns specified with -e",
760+
N_("combine patterns specified with -e"),
761761
PARSE_OPT_NOARG | PARSE_OPT_NONEG, and_callback },
762762
OPT_BOOLEAN(0, "or", &dummy, ""),
763763
{ OPTION_CALLBACK, 0, "not", &opt, NULL, "",
@@ -769,16 +769,16 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
769769
PARSE_OPT_NOARG | PARSE_OPT_NONEG | PARSE_OPT_NODASH,
770770
close_callback },
771771
OPT__QUIET(&opt.status_only,
772-
"indicate hit with exit status without output"),
772+
N_("indicate hit with exit status without output")),
773773
OPT_BOOLEAN(0, "all-match", &opt.all_match,
774-
"show only matches from files that match all patterns"),
774+
N_("show only matches from files that match all patterns")),
775775
OPT_GROUP(""),
776776
{ OPTION_STRING, 'O', "open-files-in-pager", &show_in_pager,
777-
"pager", "show matching files in the pager",
777+
N_("pager"), N_("show matching files in the pager"),
778778
PARSE_OPT_OPTARG, NULL, (intptr_t)default_pager },
779779
OPT_BOOLEAN(0, "ext-grep", &external_grep_allowed__ignored,
780-
"allow calling of grep(1) (ignored by this build)"),
781-
{ OPTION_CALLBACK, 0, "help-all", &options, NULL, "show usage",
780+
N_("allow calling of grep(1) (ignored by this build)")),
781+
{ OPTION_CALLBACK, 0, "help-all", &options, NULL, N_("show usage"),
782782
PARSE_OPT_HIDDEN | PARSE_OPT_NOARG, help_callback },
783783
OPT_END()
784784
};

0 commit comments

Comments
 (0)