Modify

Opened 15 years ago

Closed 14 years ago

Last modified 14 years ago

#6803 closed enhancement (fixed)

[patch] Add i18n/l10n support

Reported by: Janusz Dusza Owned by: Steffen Hoffmann
Priority: normal Component: AccountManagerPlugin
Severity: major Keywords: i18n l10n
Cc: John Hampton, Michael Renzmann, Ryan J Ollos Trac Release: 0.12

Description

With the completion of Trac #7497 there is now possible to support localization in this nice hack by registering translations in separate domain. I've created a patch that does just that (at least with my working copy of AccountManagerPlugin ;-)). The templates should be updated with i18n:domain Genshi attributes for this to work properly.

I'm eager to work further on this subject so please review this piece of diff and let me know if it's good for something.

Attachments (5)

AccountManagerPlugin_l10n.patch (19.0 KB) - added by Janusz Dusza 15 years ago.
Patch introducing l10n to AccountManager
acct_mgr_l10n.patch (18.5 KB) - added by Dmitri 15 years ago.
l10n patch with AnnouncerPlugin as example
add_i18n.zip (6.7 KB) - added by Steffen Hoffmann 14 years ago.
basic config and message markup for i18n support - zipped to circumvent SPAM filter, sorry
add_msg.patch (27.5 KB) - added by Steffen Hoffmann 14 years ago.
template from 1st message extraction and German translations
add_ru.patch (20.9 KB) - added by Dmitri 14 years ago.
Russian translation

Download all attachments as: .zip

Change History (28)

Changed 15 years ago by Janusz Dusza

Patch introducing l10n to AccountManager

Changed 15 years ago by Dmitri

Attachment: acct_mgr_l10n.patch added

l10n patch with AnnouncerPlugin as example

comment:1 Changed 15 years ago by Dmitri

Summary: l10n support[PATCH] l10n support

comment:2 Changed 14 years ago by Steffen Hoffmann

Cc: John Hampton Michael Renzmann Ryan J Ollos added; anonymous removed
Keywords: i18n added; patch removed
Priority: normalhigh
Summary: [PATCH] l10n support[PATCH] Add i18n/l10n support

Oh man, just coming here to announce my patches for i18n support to find it was done before.

However I'll add my version here and then compare to yours. Let's join and see, where we can profit by creating the best possible version. And you might want to contribute Polish translations as well, right? So we should be able to push this even with so many other issues around here. IMHO localization is very important since Trac 0.12 is getting more and more adopted.

Ticket owner is still the old maintainer. Feels not too good for the progress to be expected here. I'm willing to commit myself and support this as another piece of the Trac plugin l10n project after agreement from maintainer, and if SVN permission was granted to me as well. Anyone hearing here?

Changed 14 years ago by Steffen Hoffmann

Attachment: add_i18n.zip added

basic config and message markup for i18n support - zipped to circumvent SPAM filter, sorry

Changed 14 years ago by Steffen Hoffmann

Attachment: add_msg.patch added

template from 1st message extraction and German translations

comment:3 Changed 14 years ago by Steffen Hoffmann

Meanwhile I've incorporated and adapted the patch from #5789 now, will post updated patches later.

comment:4 in reply to:  2 ; Changed 14 years ago by Dmitri

Replying to hasienda:

Ticket owner is still the old maintainer. Feels not too good for the progress to be expected here. I'm willing to commit myself and support this as another piece of the Trac plugin l10n project after agreement from maintainer, and if SVN permission was granted to me as well. Anyone hearing here?

Me to! I want to have russian localization for this plugin (in repository :). Thank you for templates. It would be great if you can promote this changes.

comment:5 Changed 14 years ago by Steffen Hoffmann

I've sent a call for help to the th-users mailing-list.

A quick look at the result with German localization is available now as well.

comment:6 in reply to:  4 ; Changed 14 years ago by Steffen Hoffmann

Owner: changed from Matt Good to Steffen Hoffmann
Status: newassigned

Replying to g1itch:

Replying to hasienda:

Ticket owner is still the old maintainer. Feels not too good for the progress to be expected here. I'm willing to commit myself and support this as another piece of the Trac plugin l10n project after agreement from maintainer, and if SVN permission was granted to me as well. Anyone hearing here?

Me to! I want to have russian localization for this plugin (in repository :). Thank you for templates. It would be great if you can promote this changes.

Great! I've taken maintainership now and will certainly release code with i18n support including all available translations. Your contribution is highly appreciated.

There are some msgid changes due to recent/upcoming code modifications. So most probably I'll wait after committing to trunk. I'd love to get updated translations from you as your time permits.

comment:7 in reply to:  6 ; Changed 14 years ago by Dmitri

Replying to hasienda:

There are some msgid changes due to recent/upcoming code modifications. So most probably I'll wait after committing to trunk. I'd love to get updated translations from you as your time permits.

Maybe you want to commit the code and updated messages.pot? Then I will update my translation.

BTW: there is a problem with password reset:

2010-10-05 17:20:44,048 Trac[main] ERROR: Internal Server Error: 
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/trac/web/main.py", line 513, in _dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.6/site-packages/trac/web/main.py", line 235, in dispatch
    resp = chosen_handler.process_request(req)
  File "/usr/lib/python2.6/site-packages/trac/prefs/web_ui.py", line 77, in process_request
    template, data = chosen_provider.render_preference_panel(req, panel_id)
  File "/usr/lib/python2.6/site-packages/acct_mgr/web_ui.py", line 139, in render_preference_panel
    data = {'account': self._do_account(req)}
  File "/usr/lib/python2.6/site-packages/acct_mgr/web_ui.py", line 205, in _do_account
    tag.b(_("Please change your password now.")))))
  File "/usr/lib/python2.6/site-packages/trac/util/translation.py", line 281, in <lambda>
    return lambda *args, **kw: _functions[symbol](domain, *args, **kw)
TypeError: dtgettext() takes exactly 3 arguments (4 given)

comment:8 in reply to:  7 Changed 14 years ago by Steffen Hoffmann

Replying to g1itch:

Maybe you want to commit the code and updated messages.pot? Then I will update my translation.

Yes, as I proposed. Glad you're interested. Looking forward to push the code out, but there's half a dozen more important changes preceding this one, so it'll still take some days to accomplish it.

BTW: there is a problem with password reset: ![...]

Right, seen this as well, but this is what my current patch stack (based in Mercurial Queue) is for:

The changesets, from what I make the patches attached here, are not finished at all before actually committing them. As I see such a problem I review and correct the changeset, until it doesn't show the problem anymore.

So the patches are already quite different now and this issue should have been gone. But thanks for spotting this, and I'm really glad to know, there is at least one more person testing my changes that fast. This is much better than getting feedback months later or not at all.

comment:9 Changed 14 years ago by Steffen Hoffmann

(In [9321]) AccountManagerPlugin: Remove obsolete method, refs #4040 and #6803.

send method could be removed and the one inherited from the parent class used instead. Thanks to nueces for suggesting this code cleanup.

While initially adding markup for i18n support in changeset [9318] I missed some recently added strings. This is corrected now and catalogs are updated as well.

comment:10 Changed 14 years ago by Steffen Hoffmann

(In [9333]) AccountManagerPlugin: Add i18n replacement modules, if Babel import fails, refs #6803.

comment:11 Changed 14 years ago by Steffen Hoffmann

(In [9336]) AccountManagerPlugin: Correct i18n replacement modules, refs #6803.

Changeset [9333] had to be re-done due to some obvious ugly mistakes. Thanks to Thomas Moschny for the immediate hint.

comment:12 Changed 14 years ago by Steffen Hoffmann

Priority: highnormal
Summary: [PATCH] Add i18n/l10n support[patch] Add i18n/l10n support

I'm still waiting for the Russian catalog update before closing this ticket, but lower priority, as most required work has been done and we already have a working solution according to my own tests with the German translations.

comment:13 in reply to:  12 ; Changed 14 years ago by Dmitri

Replying to hasienda:

I'm still waiting for the Russian catalog update before closing this ticket,

Excuse me: I so slow :)

comment:14 in reply to:  13 Changed 14 years ago by Steffen Hoffmann

Replying to g1itch:

Replying to hasienda:

I'm still waiting for the Russian catalog update before closing this ticket,

Excuse me: I so slow :)

Do you think, I've done all my work in a single afternoon? ;-)

After all now you share your work even with these, who are very well capable of doing it on their own, so never mind. I'll hurry up and will put it out ASAP.

Many thanks for your support.

If you'd like to do something more as your time permits, please have a look at your translation teams at Transifex:

http://www.transifex.net/projects/p/Trac_Plugin-L10N/teams/

This way I try to push joint translation effort for a growing number of Trac plugins, and your contributions there would be welcomed at any time.

comment:15 Changed 14 years ago by Steffen Hoffmann

Reviewing the translation I wonder, if you've left #, fuzzy markers on purpose or by accident. I'll remove them, if I don't see anything doubtful about them, ok?

comment:16 Changed 14 years ago by Steffen Hoffmann

Review-follow-up:

missing translation for following msgid's:

#: acct_mgr/notification.py:55
msgid "The email and username do not match a known account."

suspicious translations (according to my Russian knowledge from school and common sense):

#: acct_mgr/web_ui.py:293
msgid "Email is required"
msgstr "Требуется Email"

#: acct_mgr/templates/register.html:71
msgid "Email:"
msgstr "Адрес:"

#: acct_mgr/templates/admin_users.html:82
msgid "Email"
msgstr "Адрес"

Both should read like «электронный адрес», correct?

#: acct_mgr/templates/reset_password.html:55
msgid "Email Address:"
msgstr "Почтовый адрес:"

Oh, same here? At least this is not the post address as I do read the Russian text here.

Is it possible for you to provide these translations too? I'll try to get 'em another way, if your time doesn't permit to do it soon. So just tell me, please :-)

comment:17 Changed 14 years ago by Steffen Hoffmann

BTW, have a look at the changeset, when it'll be committed, as you'll see there, that in general you don't need to stick to the original line formatting of the msgid's.

I've already tested this a lot and verified multiple times, that this is really not needed for final message presentation. Do line breaks on your own just for the PO file and omit any \n found in the original msgid. Display of msgtxt's in the web UI will still be done correctly.

comment:18 in reply to:  15 ; Changed 14 years ago by Dmitri

Replying to hasienda:

Reviewing the translation I wonder, if you've left #, fuzzy markers on purpose or by accident. I'll remove them, if I don't see anything doubtful about them, ok?

I left fuzzy marks for strings, which can be more precise. Maybe it's a bad practice.

Changed 14 years ago by Dmitri

Attachment: add_ru.patch added

Russian translation

comment:19 Changed 14 years ago by Dmitri

Look, I have fixed formatting, 'fuzzy' and 'Email'.

comment:20 in reply to:  18 Changed 14 years ago by Steffen Hoffmann

Replying to g1itch:

Replying to hasienda:

Reviewing the translation I wonder, if you've left #, fuzzy markers on purpose or by accident. I'll remove them, if I don't see anything doubtful about them, ok?

I left fuzzy marks for strings, which can be more precise. Maybe it's a bad practice.

No, this is as intended AFAIK. Sadly 'fuzzy' translations are left out in regular (automatic) compilation. So they are missing instead of just telling fellow translators where to look, if they are searching a starting point. Not your fault.

comment:21 Changed 14 years ago by Steffen Hoffmann

Resolution: fixed
Status: assignedclosed

(In [9346]) AccountManagerPlugin: Add Russian translations, closes #6803.

These were contributed and updated by Dmitri Bogomolov. And I've corrected German translations as well. Closing the aforementioned ticket is not the final word in this special case. i18n is an ongoing effort and will need some more attention, whenever messages for the plugin are added or changed. And I really hope to get much more translations via our 'Trac plugin l10n' project at Transifex.

comment:22 in reply to:  19 Changed 14 years ago by Steffen Hoffmann

Replying to g1itch:

Look, I have fixed formatting, 'fuzzy' and 'Email'.

Done. Changes were almost identical to my own guesses, only some missing dots at end of sentence.

Would you like to keep any hints on your old fuzzy markers now? I've done a diff before, containing just these msgid's, that I could post i.e. into the Russian translator team area at Transifex for review. But I'm fine with the state of translation for now and will only take further action, if you really want it. I'll push updated translations to the repository for the Transifex project within the next few minutes too, so Russian should be visible at the AccountManagerPlugin wiki page in the chart for available languages really soon.

Thank you again for your contribution. Hope many more will follow.

comment:23 Changed 14 years ago by Steffen Hoffmann

(In [9347]) AccountManagerPlugin: Improve error handling when writing to password files, closes #4040 and #5247, refs #6803.

Some messages without i18n markup were found while examining the code, so corresponding additions and updates to message catalogs are included as well.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Steffen Hoffmann.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.