Re: i18n messages aus Plone Product extrahieren

Jan Ulrich Hasecke <[email protected]>
Newsgroups gmane.comp.web.zope.german
Message-ID <[email protected]>
Hallo Thomas,

danke für die Hinweise. Ich hab im Moment leider zusätzlich das  
Problem, dass ich sich Plone auf meinem MacBook ausschließlich mit dem  
Installer installieren lässt.  Alles über paster ist kaputt.

Deshalb läuft auch i18ndude nicht richtig.

juh$ i18ndude rebuild-pot --pot locales/plone3_portlet.twitter.pot -- 
create plone3_portlet.twitter.example
Traceback (most recent call last):
   File "/usr/local/bin/i18ndude", line 5, in <module>
     from pkg_resources import load_entry_point
   File "/System/Library/Frameworks/Python.framework/Versions/2.5/ 
Extras/lib/python/pkg_resources.py", line 2555, in <module>
     working_set.require(__requires__)
   File "/System/Library/Frameworks/Python.framework/Versions/2.5/ 
Extras/lib/python/pkg_resources.py", line 620, in require
     needed = self.resolve(parse_requirements(requirements))
   File "/System/Library/Frameworks/Python.framework/Versions/2.5/ 
Extras/lib/python/pkg_resources.py", line 518, in resolve
     raise DistributionNotFound(req)  # XXX put more info here
pkg_resources.DistributionNotFound: zope.i18nmessageid>=3.3


Am 14.04.2009 um 21:02 schrieb Thomas Maßmann:

> Hallo Jan,
>
> das ganze geht mit i18ndude (Installation über easy_install) +  
> gettext ganz gut.
>
> Angenommen Dein Produkt heißt my.product (erstellt mit paster) und  
> Deine Domain auch. Dann musst Du im Ordner src/my/product/ einen  
> Ordner locales/de/LC_MESSAGES z.B. für deutsch anlegen (geht auch  
> über paster) und dann die folgenden Befehle ausführen:
>
> $ i18ndude rebuild-pot --pot locales/my.product.pot --create  
> my.product .
> $ touch locales/de/LC_MESSAGES/my.product.po //die Datei muss  
> existieren, sonst meckert i18ndude
> $ i18ndude sync --pot locales/my.product.pot locales/de/LC_MESSAGES/ 
> my.product.po
> $ msgfmt locales/de/LC_MESSAGES/my.product.po -o locales/de/ 
> LC_MESSAGES/my.product.mo --no-hash
>
> Letzteren Befehl brauchst Du nicht wenn Du Poedit benutzt, das  
> compiliert die .mo automatisch.
>
>
> In die configure.zcml muss dann noch folgender Eintrag hinein:
>
> <configure
>    xmlns="http://namespaces.zope.org/zope"
>    xmlns:five="http://namespaces.zope.org/five"
>    xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
>    xmlns:i18n="http://namespaces.zope.org/i18n"
>    i18n_domain="my.product">
> ...
>
>    <i18n:registerTranslations directory="locales" />
> ...
>
> Ich habe aber die Erfahrung gemacht, dass i18ndude Einträge wie  
> label_msgid ignoriert. Wenn Du hingegen in Deinem Schema folgendes  
> hast (wie es paster auch anlegt über addcontent)
>
>    atapi.StringField(
>        'my_field',
>        storage=atapi.AnnotationStorage(),
>        widget=atapi.StringWidget(
>            label=_(u"My Field Name"),
>            description=_(u"My Field Description"),
>        ),
>    ),
>
> dann geht das ganz gut. Fehlende msgids kannst Du ja immer noch per  
> Hand hinzufügen. Du musst aber aufpassen, dass Du das am besten in  
> ein extra .pot-File schreibst und ein merge ausführst, da i18ndude  
> sonst beim nächsten rebuild-pot Deine Einträge wieder entfernt.
>
> Viele Grüße
> Thomas
>
>
> Am 14.04.2009 um 20:35 schrieb Jan Ulrich Hasecke:
>
>> Irgendwie finde ich keinen Ansatz, um aus einem Plone3 Produkt die  
>> i18n message ids zu extrahieren und in ein pot oder locales file zu  
>> schreiben.
>>
>> juh
>>
>>
>> _______________________________________________
>> zope mailing list
>> [email protected]
>> https://mail.dzug.org/mailman/listinfo/zope
>
> EDV-Beratung Thomas Maßmann
> E-Mail: [email protected]
> WWW: it-spir.it
>
>
>
>
>
> _______________________________________________
> zope mailing list
> [email protected]
> https://mail.dzug.org/mailman/listinfo/zope



_______________________________________________
zope mailing list
[email protected]
https://mail.dzug.org/mailman/listinfo/zope
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.