summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2020-05-27 14:51:04 -0700
committerKevin McCarthy <kevin@8t8.us>2020-05-27 14:51:04 -0700
commit9723c62c88209b6e35e4a488388079f183c427af (patch)
tree696a870a7b5673cdeb263d85bc26767a920f3203 /doc
parent4aedee8504371f313be0e809358ef1735a9e7b71 (diff)
Allow tagging string config vars as L10N.
Translate them once in mutt_set_default(). Modify makedoc.pl to remove the N_() tag, and to also note the type as "string (localized)". The makedoc.pl already will ignore L10N comment so add a basic comment above each config var in init.h. I'm not tagging $crypt_protected_headers_subject because the spec now says this should be "...". I plan on implementing that change along with other fixes before the next release.
Diffstat (limited to 'doc')
-rw-r--r--doc/makedoc.pl20
1 files changed, 17 insertions, 3 deletions
diff --git a/doc/makedoc.pl b/doc/makedoc.pl
index 1ffbe621..b3a18b28 100644
--- a/doc/makedoc.pl
+++ b/doc/makedoc.pl
@@ -107,13 +107,15 @@ my %type2human = ("DT_NONE" => "-none-",
"DT_RX" => "regular expression",
"DT_MAGIC" => "folder magic",
"DT_ADDR" => "e-mail address",
- "DT_MBCHARTBL"=> "string");
+ "DT_MBCHARTBL"=> "string",
+ "DT_L10N_STR" => "string (localized)");
my %string_types = ("DT_STR" => 1,
"DT_RX" => 1,
"DT_ADDR" => 1,
"DT_PATH" => 1,
- "DT_MBCHARTBL" => 1);
+ "DT_MBCHARTBL" => 1,
+ "DT_L10N_STR" => 1);
my %quad2human = ("MUTT_YES" => "yes",
"MUTT_NO" => "no",
@@ -239,13 +241,25 @@ sub flush_doc($) {
sub handle_confline($) {
my ($line) = @_;
+ my $localized = 0;
my ($name, $type, $flags, $data, $val) = split(/\s*,\s*/, $line, 5);
$name =~ s/"//g;
- $type =~ s/\|.*//;
+ if ($type =~ /DT_L10N_STR/) {
+ $localized = 1;
+ $type = "DT_L10N_STR";
+ }
+ else {
+ $type =~ s/\|.*//;
+ }
$val =~ s/^{\s*\.[lp]\s*=\s*"?//;
$val =~ s/"?\s*}\s*},\s*$//;
+ if ($localized) {
+ $val =~ s/^N_\s*\("//;
+ $val =~ s/"\)$//;
+ }
+
# This is a hack to concatenate compile-time constants.
# (?<!..) is a zero-width negative lookbehind assertion, asserting
# the first quote isn't preceded by a backslash