]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 512623: Implement the basic infrastructure for localization of all custom and...
authormkanat%bugzilla.org <>
Wed, 30 Sep 2009 22:33:18 +0000 (22:33 +0000)
committermkanat%bugzilla.org <>
Wed, 30 Sep 2009 22:33:18 +0000 (22:33 +0000)
Patch by Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=LpSolit

template/en/default/bug/field.html.tmpl
template/en/default/global/field-descs.none.tmpl

index b5184cccf38b200795572b9d3990c04af671a93f..26735950dd582339ffa179e2fcc31889edc36756 100644 (file)
               %]
                 class="bz_hidden_option" disabled="disabled"
               [% END %]>
-              [%- legal_value.name FILTER html %]</option>
+              [%- display_value(field.name, legal_value.name) FILTER html ~%]
+            </option>
           [% END %]
         </select>
         [%# When you pass an empty multi-select in the web interface,
index 25fdafef67f2753280feab44b7790507a408231f..278800594627cf8227d02efd6097baf47c7d5768 100644 (file)
                    ${constants.FIELD_TYPE_BUG_ID}        => "$terms.Bug ID",
                 } %]
 
-[% status_descs = { "UNCONFIRMED" => "UNCONFIRMED",
-                    "NEW"         => "NEW",
-                    "ASSIGNED"    => "ASSIGNED",
-                    "REOPENED"    => "REOPENED",
-                    "RESOLVED"    => "RESOLVED",
-                    "VERIFIED"    => "VERIFIED",
-                    "CLOSED"      => "CLOSED" } %]
-
-[% MACRO get_status(status) GET status_descs.$status || status %]
+[%# You can use this hash to localize (translate) the values displayed
+  # for drop-down and multiple-select fields. Lines starting with "#"
+  # are comments.
+  #%]
+[% value_descs = {
+  "bug_status" => {
+    # "UNCONFIRMED" => "UNCO",
+    # "NEW"         => "NEWISH",
+  },
 
-[% resolution_descs = { "FIXED"      => "FIXED",
-                        "INVALID"    => "INVALID",
-                        "WONTFIX"    => "WONTFIX",
-                        "DUPLICATE"  => "DUPLICATE",
-                        "WORKSFORME" => "WORKSFORME",
-                        "MOVED"      => "MOVED",
-                        "---"        => "---",
-                        " "          => " " } %]
+  "resolution" => {
+    # "FIXED" => "NO LONGER AN ISSUE",
+    # "MOVED" => "BYE-BYE",
+  },
+} %]
 
-[% MACRO get_resolution(res) GET resolution_descs.$res || res %]
+[%# We use "FILTER none" here because only the caller can know how to
+  # filter the result appropriately. 
+  #%]
+[% MACRO display_value(field_name, value_name) BLOCK %][% FILTER trim %]
+  [% IF value_descs.${field_name}.${value_name}.defined %]
+    [% value_descs.${field_name}.${value_name} FILTER none %]
+  [% ELSE %]
+    [% value_name FILTER none %]
+  [% END %]
+[% END %][% END %]
 
 [% Hook.process("end") %]