i18n: grep: mark parseopt strings for translation
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy committed
Aug 20, 2012 at 19:32 UTC
4b407bc50632a02523df550dd48e71d03e6e9dbd
1 file changed
+45
-45
builtin/grep.c
+45
-45
@@ -19,7 +19,7 @@
19
#include "dir.h"
20
21
static char const * const grep_usage[] = {
22
- "git grep [options] [-e] <pattern> [<rev>...] [[--] <path>...]",
22
+ N_("git grep [options] [-e] <pattern> [<rev>...] [[--] <path>...]"),
23
NULL
24
};
25
@@ -680,84 +680,84 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
680
681
struct option options[] = {
682
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")),
684
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),
686
OPT_BOOLEAN(0, "untracked", &untracked,
687
- "search in both tracked and untracked files"),
687
+ N_("search in both tracked and untracked files")),
688
OPT_SET_INT(0, "exclude-standard", &opt_exclude,
689
- "search also in ignored files", 1),
689
+ N_("search also in ignored files"), 1),
690
OPT_GROUP(""),
691
OPT_BOOLEAN('v', "invert-match", &opt.invert,
692
- "show non-matching lines"),
692
+ N_("show non-matching lines")),
693
OPT_BOOLEAN('i', "ignore-case", &opt.ignore_case,
694
- "case insensitive matching"),
694
+ N_("case insensitive matching")),
695
OPT_BOOLEAN('w', "word-regexp", &opt.word_regexp,
696
- "match patterns only at word boundaries"),
696
+ N_("match patterns only at word boundaries")),
697
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),
699
OPT_SET_INT('I', NULL, &opt.binary,
700
- "don't match patterns in binary files",
700
+ N_("don't match patterns in binary files"),
701
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,
704
NULL, 1 },
705
OPT_GROUP(""),
706
OPT_SET_INT('E', "extended-regexp", &pattern_type,
707
- "use extended POSIX regular expressions",
707
+ N_("use extended POSIX regular expressions"),
708
pattern_type_ere),
709
OPT_SET_INT('G', "basic-regexp", &pattern_type,
710
- "use basic POSIX regular expressions (default)",
710
+ N_("use basic POSIX regular expressions (default)"),
711
pattern_type_bre),
712
OPT_SET_INT('F', "fixed-strings", &pattern_type,
713
- "interpret patterns as fixed strings",
713
+ N_("interpret patterns as fixed strings"),
714
pattern_type_fixed),
715
OPT_SET_INT('P', "perl-regexp", &pattern_type,
716
- "use Perl-compatible regular expressions",
716
+ N_("use Perl-compatible regular expressions"),
717
pattern_type_pcre),
718
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),
722
OPT_NEGBIT(0, "full-name", &opt.relative,
723
- "show filenames relative to top directory", 1),
723
+ N_("show filenames relative to top directory"), 1),
724
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")),
726
OPT_BOOLEAN(0, "name-only", &opt.name_only,
727
- "synonym for --files-with-matches"),
727
+ N_("synonym for --files-with-matches")),
728
OPT_BOOLEAN('L', "files-without-match",
729
&opt.unmatch_name_only,
730
- "show only the names of files without match"),
730
+ N_("show only the names of files without match")),
731
OPT_BOOLEAN('z', "null", &opt.null_following_name,
732
- "print NUL after filenames"),
732
+ N_("print NUL after filenames")),
733
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")),
736
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")),
738
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")),
740
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"),
743
context_callback),
744
OPT_INTEGER('B', "before-context", &opt.pre_context,
745
- "show <n> context lines before matches"),
745
+ N_("show <n> context lines before matches")),
746
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"),
749
context_callback),
750
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")),
752
OPT_BOOLEAN('W', "function-context", &opt.funcbody,
753
- "show the surrounding function"),
753
+ N_("show the surrounding function")),
754
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 },
759
{ OPTION_CALLBACK, 0, "and", &opt, NULL,
760
- "combine patterns specified with -e",
760
+ N_("combine patterns specified with -e"),
761
PARSE_OPT_NOARG | PARSE_OPT_NONEG, and_callback },
762
OPT_BOOLEAN(0, "or", &dummy, ""),
763
{ OPTION_CALLBACK, 0, "not", &opt, NULL, "",
@@ -769,16 +769,16 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
769
PARSE_OPT_NOARG | PARSE_OPT_NONEG | PARSE_OPT_NODASH,
770
close_callback },
771
OPT__QUIET(&opt.status_only,
772
- "indicate hit with exit status without output"),
772
+ N_("indicate hit with exit status without output")),
773
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")),
775
OPT_GROUP(""),
776
{ 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"),
778
PARSE_OPT_OPTARG, NULL, (intptr_t)default_pager },
779
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"),
782
PARSE_OPT_HIDDEN | PARSE_OPT_NOARG, help_callback },
783
OPT_END()
784
};