Closed Bug 297104 Opened 20 years ago Closed 18 years ago

Need a way to localize individual strings within perl code

Categories

(Bugzilla :: Bugzilla-General, enhancement)

2.19.3
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 3.0

People

(Reporter: mkanat, Assigned: mkanat)

References

(Blocks 1 open bug)

Details

(Keywords: intl, Whiteboard: [fixed by blocker])

Attachments

(1 file, 2 obsolete files)

Right now we have a few places inside Bugzilla where we have individual strings
that are hardcoded, such as the default description of a product group.

We need a way to localize these strings, or to allow Bugzilla admins to
customize them.

My proposal is to have a global/strings.txt.tmpl template, and a
Bugzilla::Template::get_string($string_name, %params) function.
Attached file choose-product.html.tmpl (obsolete) —
move chooseproduct from reports.cgi.
Attachment 185871 [details] [diff] and this are one set, sorry for inconvenience.
Comment on attachment 185871 [details] [diff] [review]
move chooseproduct to template

This is totally unrelated to this bug.
Attachment #185871 - Attachment is obsolete: true
Comment on attachment 185873 [details]
choose-product.html.tmpl

And this is also unrelated to this bug.
Attachment #185873 - Attachment is obsolete: true
(In reply to comment #0)
> My proposal is to have a global/strings.txt.tmpl template, and a
> Bugzilla::Template::get_string($string_name, %params) function.

That's what I have in mind too. We could use something similar to
global/messages.html.tmpl. Or even global/messages.html.tmpl itself!
*** Bug 305191 has been marked as a duplicate of this bug. ***
Blocks: 223880
Keywords: intl
*** Bug 347811 has been marked as a duplicate of this bug. ***
Assignee: general → batosti
what is the better way to do this? with the existent message.txt.tmpl or create a new template?

i make the get_string function and works fine with the message template.

the work now is find the existent strings and add to template or create a new template with this strings.
We should have a separate template. But note that we have to rethink the way we mark some comments in Bugzilla. For instance, having these "bug xxx has been marked as a duplicate of bug yyy" shouldn't be in a comment, because these comments are obsolete when the bug is reopened or marked as a dupe of another bug.

Don't waste your time about sanitycheck.cgi, I'm going to templatize it as part of bug 312197. I think the remaining places are in editproducts.cgi, when sending emails about removed votes. But in this case, we don't want to send emails in the language used by the admin, but we would like the one desired by the user getting the email. That's a problem we discussed in another bug (i.e. let the user choose the language in which he would like to get his emails). Maybe should we fix this "another bug" first?
Attached patch batosti_v0.5Splinter Review
work checkpoint with a few strings moved to the templates.
But if a comment is submmited to bug in the language of a user, the other users can't see the comment in your own language.
this comments can be filtered to show the message at the current user language?
Assignee: batosti → mkanat
Depends on: 352608
Whiteboard: [fixed by blocker]
Target Milestone: --- → Bugzilla 3.0
See get_text that now lives in Bugzilla::Util. It was created to localize strings during installation, but it should work fine for everything.
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: