add translation of system messages

RESOLVED FIXED in Bugzilla 2.18

Status

()

Bugzilla
User Interface
P3
enhancement
RESOLVED FIXED
17 years ago
6 years ago

People

(Reporter: Jens Reimann, Assigned: gerv)

Tracking

2.14
Bugzilla 2.18

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

17 years ago
add translation support of system messages

e.g. labels like "Summary", "Quality Assurance", etc ... without changing the
CGI scripts.

The result is a per user/per system setting of the language and some translation
files.

an initial approach has already been made (for internal use). but I would like
to provide this feature others.
Priority: -- → P3
Target Milestone: --- → Bugzilla 2.20

Comment 1

16 years ago
We have another user on IRC with the same question, and I would like to know if
we have decided what to do on this. CCs added.
OK. There are a couple of approaches to this:

1) gettext(). 
2) A template-based solution where you have a structure like:

ThrowUserError("no_permissions");


sub ThrowUserError {
  $vars->{'error_tag'} = $_[0];
  # do template stuff


user-error.html.tmpl:

[% IF      error_tag = "no_permissions" %]
  Sorry, you don't have permissions for this operation.
[% ELSE IF error_tag = "cant_edit" %]
...
<for a lot of messages>

There has been some discussion on this in the newsgroups...

Gerv
Taking.

Gerv
Assignee: myk → gerv
Target Milestone: Bugzilla 2.20 → Bugzilla 2.18
Created attachment 92100 [details] [diff] [review]
Patch v.1

This patch adds the infrastructure for a migration to error tags instead of
text hard-coded in the CGIs. It's backwardly-compatible, so we can migrate all
the call sites over in a measured manner.

Anyone who is interested in doing a localised Bugzilla should be reviewing this
patch :-)

Gerv
Created attachment 92101 [details] [diff] [review]
Patch v.2

A few more tweaks.

Gerv
Attachment #92100 - Attachment is obsolete: true

Comment 6

16 years ago
r=burnus
Perl likes it, the error messages are shown and the code looks ok.
Fixed.

Checking in CGI.pl;
/cvsroot/mozilla/webtools/bugzilla/CGI.pl,v  <--  CGI.pl
new revision: 1.164; previous revision: 1.163
done
Checking in template/en/default/global/user-error.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/global/user-error.html.tmpl,v
 <--  user-error.html.tmpl
new revision: 1.5; previous revision: 1.4
done
Checking in template/en/default/global/code-error.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/global/code-error.html.tmpl,v
 <--  code-error.html.tmpl
new revision: 1.6; previous revision: 1.5
done

Gerv
Status: NEW → RESOLVED
Last Resolved: 16 years ago
Resolution: --- → FIXED
QA Contact: matty_is_a_geek → default-qa
You need to log in before you can comment on or make changes to this bug.