aboutsummaryrefslogtreecommitdiffstats
path: root/template
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2009-09-30 22:33:18 +0000
committermkanat%bugzilla.org <>2009-09-30 22:33:18 +0000
commitdbe356e60a0aed4b498001c603a86d0f648fa229 (patch)
tree0672186d1682858f1446449ab409d2aad9de1fae /template
parent3e880f740c0ae5b786791893e1f72f1c28221f64 (diff)
downloadbugs-dbe356e60a0aed4b498001c603a86d0f648fa229.tar
bugs-dbe356e60a0aed4b498001c603a86d0f648fa229.tar.gz
bugs-dbe356e60a0aed4b498001c603a86d0f648fa229.tar.bz2
bugs-dbe356e60a0aed4b498001c603a86d0f648fa229.tar.xz
bugs-dbe356e60a0aed4b498001c603a86d0f648fa229.zip
Bug 512623: Implement the basic infrastructure for localization of all custom and standard field values
Patch by Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=LpSolit
Diffstat (limited to 'template')
-rw-r--r--template/en/default/bug/field.html.tmpl3
-rw-r--r--template/en/default/global/field-descs.none.tmpl42
2 files changed, 26 insertions, 19 deletions
diff --git a/template/en/default/bug/field.html.tmpl b/template/en/default/bug/field.html.tmpl
index b5184cccf..26735950d 100644
--- a/template/en/default/bug/field.html.tmpl
+++ b/template/en/default/bug/field.html.tmpl
@@ -152,7 +152,8 @@
%]
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,
diff --git a/template/en/default/global/field-descs.none.tmpl b/template/en/default/global/field-descs.none.tmpl
index 25fdafef6..278800594 100644
--- a/template/en/default/global/field-descs.none.tmpl
+++ b/template/en/default/global/field-descs.none.tmpl
@@ -135,25 +135,31 @@
${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") %]