Commit dbe356e6 authored by mkanat%bugzilla.org's avatar mkanat%bugzilla.org

Bug 512623: Implement the basic infrastructure for localization of all custom…

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
parent 3e880f74
...@@ -152,7 +152,8 @@ ...@@ -152,7 +152,8 @@
%] %]
class="bz_hidden_option" disabled="disabled" class="bz_hidden_option" disabled="disabled"
[% END %]> [% END %]>
[%- legal_value.name FILTER html %]</option> [%- display_value(field.name, legal_value.name) FILTER html ~%]
</option>
[% END %] [% END %]
</select> </select>
[%# When you pass an empty multi-select in the web interface, [%# When you pass an empty multi-select in the web interface,
......
...@@ -135,25 +135,31 @@ ...@@ -135,25 +135,31 @@
${constants.FIELD_TYPE_BUG_ID} => "$terms.Bug ID", ${constants.FIELD_TYPE_BUG_ID} => "$terms.Bug ID",
} %] } %]
[% status_descs = { "UNCONFIRMED" => "UNCONFIRMED", [%# You can use this hash to localize (translate) the values displayed
"NEW" => "NEW", # for drop-down and multiple-select fields. Lines starting with "#"
"ASSIGNED" => "ASSIGNED", # are comments.
"REOPENED" => "REOPENED", #%]
"RESOLVED" => "RESOLVED", [% value_descs = {
"VERIFIED" => "VERIFIED", "bug_status" => {
"CLOSED" => "CLOSED" } %] # "UNCONFIRMED" => "UNCO",
# "NEW" => "NEWISH",
[% MACRO get_status(status) GET status_descs.$status || status %] },
[% resolution_descs = { "FIXED" => "FIXED", "resolution" => {
"INVALID" => "INVALID", # "FIXED" => "NO LONGER AN ISSUE",
"WONTFIX" => "WONTFIX", # "MOVED" => "BYE-BYE",
"DUPLICATE" => "DUPLICATE", },
"WORKSFORME" => "WORKSFORME", } %]
"MOVED" => "MOVED",
"---" => "---",
" " => " " } %]
[% 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") %] [% Hook.process("end") %]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment