Modify

Opened 5 years ago

Closed 4 years ago

Last modified 4 years ago

#6803 closed enhancement (fixed)

[patch] Add i18n/l10n support

Reported by: Janusz Dusza <janusz@…> Owned by: hasienda
Priority: normal Component: AccountManagerPlugin
Severity: major Keywords: i18n l10n
Cc: pacopablo, otaku42, rjollos 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 <janusz@…> 5 years ago.
Patch introducing l10n to AccountManager
acct_mgr_l10n.patch (18.5 KB) - added by g1itch 4 years ago.
l10n patch with AnnouncerPlugin as example
add_i18n.zip (6.7 KB) - added by hasienda 4 years ago.
basic config and message markup for i18n support - zipped to circumvent SPAM filter, sorry
add_msg.patch (27.5 KB) - added by hasienda 4 years ago.
template from 1st message extraction and German translations
add_ru.patch (20.9 KB) - added by g1itch 4 years ago.
Russian translation

Download all attachments as: .zip

Change History (28)

Changed 5 years ago by Janusz Dusza <janusz@…>

Patch introducing l10n to AccountManager

Changed 4 years ago by g1itch

l10n patch with AnnouncerPlugin as example

comment:1 Changed 4 years ago by g1itch

  • Summary changed from l10n support to [PATCH] l10n support

comment:2 follow-up: Changed 4 years ago by hasienda

  • Cc pacopablo otaku42 rjollos added
  • Keywords i18n added; patch removed
  • Priority changed from normal to high
  • Summary changed from [PATCH] l10n support to [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 4 years ago by hasienda

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

Changed 4 years ago by hasienda

template from 1st message extraction and German translations

comment:3 Changed 4 years ago by hasienda

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

comment:4 in reply to: ↑ 2 ; follow-up: Changed 4 years ago by 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.

comment:5 Changed 4 years ago by hasienda

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 ; follow-up: Changed 4 years ago by hasienda

  • Owner changed from mgood to hasienda
  • Status changed from new to assigned

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 ; follow-up: Changed 4 years ago by g1itch

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 4 years ago by hasienda

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 4 years ago by hasienda

(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 4 years ago by hasienda

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

comment:11 Changed 4 years ago by hasienda

(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 follow-up: Changed 4 years ago by hasienda

  • Priority changed from high to normal
  • Summary changed from [PATCH] Add i18n/l10n support to [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 ; follow-up: Changed 4 years ago by g1itch

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 4 years ago by hasienda

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 follow-up: Changed 4 years ago by 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?

comment:16 Changed 4 years ago by hasienda

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 4 years ago by hasienda

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 ; follow-up: Changed 4 years ago by 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.

Changed 4 years ago by g1itch

Russian translation

comment:19 follow-up: Changed 4 years ago by g1itch

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

comment:20 in reply to: ↑ 18 Changed 4 years ago by hasienda

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 4 years ago by hasienda

  • Resolution set to fixed
  • Status changed from assigned to closed

(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 4 years ago by hasienda

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 4 years ago by hasienda

(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.

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.