[Openstack-i18n] Comments for translators in Horizon source codes

Akihiro Motoki amotoki at gmail.com
Wed Oct 1 11:44:59 UTC 2014


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 at 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 at suse.com> wrote on 2014/10/01 18:52:42:
>
>> Andreas Jaeger <aj at suse.com>
>> 2014/10/01 18:52
>>
>> To
>>
>> Yves-Gwenaël Bourhis <yves-gwenael.bourhis at cloudwatt.com>,
>> openstack-i18n at 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 at lists.openstack.org
>> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-i18n
>
>
> _______________________________________________
> Openstack-i18n mailing list
> Openstack-i18n at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-i18n
>



-- 
Akihiro Motoki <amotoki at gmail.com>



More information about the Openstack-i18n mailing list