Comments for translators in Horizon source codes
Hello, all It looks like Horizon developers write many comments in their codes to translators. According to https://docs.djangoproject.com/en/1.7/topics/i18n/translation/#comments-for-..., these comments should show up in the po files. Yet I checked English version po files and found no comments there. I think the problem may be caused by the po file generation method. Is there anybody who would like to look into this issue? Best regards Ying Chun Guo (Daisy)
Daisy, The wiki page is just a proposal for discussion. It is not applied to actual Horizon reviews. Input from I18N team for discussion would be appreciated. At now, there are only three translator notes in Horizon code. Before checking PO files, source codes need to be checked :) horizon/test/test_dashboards/dogs/puppies/tables.py: # Translators: test code, don't really have to translate horizon/test/test_dashboards/dogs/puppies/tables.py: # Translators: test code, don't really have to translate openstack_dashboard/dashboards/project/routers/views.py: # Translators: The usage is "<UUID of ext_net> (Not Found)" On Tue, Sep 30, 2014 at 4:10 PM, Ying Chun Guo <guoyingc@cn.ibm.com> wrote:
Hello, all
It looks like Horizon developers write many comments in their codes to translators. According to https://docs.djangoproject.com/en/1.7/topics/i18n/translation/#comments-for-..., these comments should show up in the po files.
Yet I checked English version po files and found no comments there. I think the problem may be caused by the po file generation method.
Is there anybody who would like to look into this issue?
Best regards Ying Chun Guo (Daisy)
_______________________________________________ Openstack-i18n mailing list Openstack-i18n@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-i18n
-- Akihiro Motoki <amotoki@gmail.com>
Le 30/09/2014 09:10, Ying Chun Guo a écrit :
Hello, all
It looks like Horizon developers write many comments in their codes to translators. According to https://docs.djangoproject.com/en/1.7/topics/i18n/translation/#comments-for-..., these comments should show up in the po files.
Yet I checked English version po files and found no comments there. I think the problem may be caused by the po file generation method.
Hi Daisy, In my translatable strings rule here: https://wiki.openstack.org/wiki/I18n/TranslatableStrings#Use_Comments_for_tr... I explain how to add the comments for them to work and give a link to a django bug I logged: https://code.djangoproject.com/ticket/22578 Hope it helps -- Yves-Gwenaël Bourhis
On 10/01/2014 11:01 AM, Yves-Gwenaël Bourhis wrote:
Le 30/09/2014 09:10, Ying Chun Guo a écrit :
Hello, all
It looks like Horizon developers write many comments in their codes to translators. According to https://docs.djangoproject.com/en/1.7/topics/i18n/translation/#comments-for-..., these comments should show up in the po files.
Yet I checked English version po files and found no comments there. I think the problem may be caused by the po file generation method.
Hi Daisy,
In my translatable strings rule here: https://wiki.openstack.org/wiki/I18n/TranslatableStrings#Use_Comments_for_tr...
Great!
I explain how to add the comments for them to work and give a link to a django bug I logged: https://code.djangoproject.com/ticket/22578
Just a question on the tools side: Does this work with our infrastructure? Will these comments end in the pot file when you run in horizon the following command: /run_tests.sh --makemessages -V And will we see those then also in transifex? Andreas -- Andreas Jaeger aj@{suse.com,opensuse.org} Twitter: jaegerandi SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn,Jennifer Guild,Felix Imendörffer,HRB16746 (AG Nürnberg) GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126
Hello, Andreas and Yves-Gwenaël Thank you for taking look at it. There is a bug reported about this issue: https://bugs.launchpad.net/horizon/+bug/1375607 While I'm doing translation today, I could see two comments to translators from the web UI of Transifex: api/neutron.py:993 api/neutron.py:1011 So I guess the comments which are not shown up might be caused by: the format of translation note is not correct. It MUST be just before a string. Need to check all translators comments carefully. Best regards Ying Chun Guo (Daisy) Andreas Jaeger <aj@suse.com> wrote on 2014/10/01 18:52:42:
Andreas Jaeger <aj@suse.com> 2014/10/01 18:52
To
Yves-Gwenaël Bourhis <yves-gwenael.bourhis@cloudwatt.com>, openstack-i18n@lists.openstack.org,
cc
Subject
Re: [Openstack-i18n] Comments for translators in Horizon source codes
On 10/01/2014 11:01 AM, Yves-Gwenaël Bourhis wrote:
Le 30/09/2014 09:10, Ying Chun Guo a écrit :
Hello, all
It looks like Horizon developers write many comments in their codes to translators. According to https://docs.djangoproject.com/en/1.7/topics/i18n/translation/ #comments-for-translators, these comments should show up in the po files.
Yet I checked English version po files and found no comments there. I think the problem may be caused by the po file generation method.
Hi Daisy,
In my translatable strings rule here: https://wiki.openstack.org/wiki/I18n/ TranslatableStrings#Use_Comments_for_translators_as_much_as_possible
Great!
I explain how to add the comments for them to work and give a link to a django bug I logged: https://code.djangoproject.com/ticket/22578
Just a question on the tools side:
Does this work with our infrastructure? Will these comments end in the pot file when you run in horizon the following command: /run_tests.sh --makemessages -V
And will we see those then also in transifex?
Andreas -- Andreas Jaeger aj@{suse.com,opensuse.org} Twitter: jaegerandi SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn,Jennifer Guild,Felix Imendörffer,HRB16746 (AG Nürnberg) GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126
_______________________________________________ Openstack-i18n mailing list Openstack-i18n@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-i18n
Hi, The following simple diff fixes the problem. We need to place translator note just before a string. If we use multi-line strings, we need to place notes after *gettext*. diff --git a/horizon/test/test_dashboards/dogs/puppies/tables.py b/horizon/test/test_dashboards/dogs/puppies/tables.py index 460bd91..d090bfe 100644 --- a/horizon/test/test_dashboards/dogs/puppies/tables.py +++ b/horizon/test/test_dashboards/dogs/puppies/tables.py @@ -26,8 +26,8 @@ class EagerPuppiesTable(tables.DataTable): class SellPuppy(tables.DeleteAction): @staticmethod def action_present(count): - # Translators: test code, don't really have to translate return ungettext_lazy( + # Translators: test code, don't really have to translate u"Sell Puppy", u"Sell Puppies", count @@ -35,8 +35,8 @@ class SellPuppy(tables.DeleteAction): @staticmethod def action_past(count): - # Translators: test code, don't really have to translate return ungettext_lazy( + # Translators: test code, don't really have to translate u"Sold Puppy", u"Sold Puppies", count On Wed, Oct 1, 2014 at 8:11 PM, Ying Chun Guo <guoyingc@cn.ibm.com> wrote:
Hello, Andreas and Yves-Gwenaël
Thank you for taking look at it. There is a bug reported about this issue: https://bugs.launchpad.net/horizon/+bug/1375607
While I'm doing translation today, I could see two comments to translators from the web UI of Transifex: api/neutron.py:993 api/neutron.py:1011
So I guess the comments which are not shown up might be caused by: the format of translation note is not correct. It MUST be just before a string. Need to check all translators comments carefully.
Best regards Ying Chun Guo (Daisy)
Andreas Jaeger <aj@suse.com> wrote on 2014/10/01 18:52:42:
Andreas Jaeger <aj@suse.com> 2014/10/01 18:52
To
Yves-Gwenaël Bourhis <yves-gwenael.bourhis@cloudwatt.com>, openstack-i18n@lists.openstack.org,
cc
Subject
Re: [Openstack-i18n] Comments for translators in Horizon source codes
On 10/01/2014 11:01 AM, Yves-Gwenaël Bourhis wrote:
Le 30/09/2014 09:10, Ying Chun Guo a écrit :
Hello, all
It looks like Horizon developers write many comments in their codes to translators. According to https://docs.djangoproject.com/en/1.7/topics/i18n/translation/ #comments-for-translators, these comments should show up in the po files.
Yet I checked English version po files and found no comments there. I think the problem may be caused by the po file generation method.
Hi Daisy,
In my translatable strings rule here: https://wiki.openstack.org/wiki/I18n/ TranslatableStrings#Use_Comments_for_translators_as_much_as_possible
Great!
I explain how to add the comments for them to work and give a link to a django bug I logged: https://code.djangoproject.com/ticket/22578
Just a question on the tools side:
Does this work with our infrastructure? Will these comments end in the pot file when you run in horizon the following command: /run_tests.sh --makemessages -V
And will we see those then also in transifex?
Andreas -- Andreas Jaeger aj@{suse.com,opensuse.org} Twitter: jaegerandi SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn,Jennifer Guild,Felix Imendörffer,HRB16746 (AG Nürnberg) GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126
_______________________________________________ Openstack-i18n mailing list Openstack-i18n@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-i18n
_______________________________________________ Openstack-i18n mailing list Openstack-i18n@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-i18n
-- Akihiro Motoki <amotoki@gmail.com>
Le 01/10/2014 12:52, Andreas Jaeger a écrit :
Just a question on the tools side:
Does this work with our infrastructure? Will these comments end in the pot file when you run in horizon the following command: /run_tests.sh --makemessages -V
I tested with "python manage.py makemessages -l fr" and this worked well, so it should work with /run_tests.sh --makemessages -V since this command launches manage.py makemessages for horizon, horizon javascript and openstack_dashboard.
And will we see those then also in transifex?
If they appear in the po file yes, they will be visible in transifex. -- Yves-Gwenaël Bourhis
Even now we can have translator notes if the notes are placed at a correct location. The problem is the limitation on a location is tight and developers easily make a mistake. In my side, translator notes exists in the POT file [2] after the fix [1] is applied, so I am not sure the problem https://code.djangoproject.com/ticket/22578 exists. [1] https://review.openstack.org/#/c/125329/1/horizon/test/test_dashboards/dogs/... [2] http://paste.openstack.org/show/117439/ On Wed, Oct 1, 2014 at 7:52 PM, Andreas Jaeger <aj@suse.com> wrote:
On 10/01/2014 11:01 AM, Yves-Gwenaël Bourhis wrote:
Le 30/09/2014 09:10, Ying Chun Guo a écrit :
Hello, all
It looks like Horizon developers write many comments in their codes to translators. According to https://docs.djangoproject.com/en/1.7/topics/i18n/translation/#comments-for-..., these comments should show up in the po files.
Yet I checked English version po files and found no comments there. I think the problem may be caused by the po file generation method.
Hi Daisy,
In my translatable strings rule here: https://wiki.openstack.org/wiki/I18n/TranslatableStrings#Use_Comments_for_tr...
Great!
I explain how to add the comments for them to work and give a link to a django bug I logged: https://code.djangoproject.com/ticket/22578
Just a question on the tools side:
Does this work with our infrastructure? Will these comments end in the pot file when you run in horizon the following command: /run_tests.sh --makemessages -V
And will we see those then also in transifex?
Andreas -- Andreas Jaeger aj@{suse.com,opensuse.org} Twitter: jaegerandi SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn,Jennifer Guild,Felix Imendörffer,HRB16746 (AG Nürnberg) GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126
_______________________________________________ Openstack-i18n mailing list Openstack-i18n@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-i18n
-- Akihiro Motoki <amotoki@gmail.com>
participants (4)
-
Akihiro Motoki
-
Andreas Jaeger
-
Ying Chun Guo
-
Yves-Gwenaël Bourhis