[Grok-dev] Internationalisation, is the howto current?

Tim Cook timothywayne.cook at gmail.com
Thu Mar 26 12:05:30 EDT 2009

On Thu, 2009-03-26 at 16:27 +0100, Vincent Fretin wrote:
> I don't know very well how to use zope.i18n.translate.

Use bin/i18nextract  it will place your .pot file in the locales

> You should have locales/en/LC_MESSAGES/MyDomain.po with
> msgid "my_msgid"
> msgstr "something"

Actually your default language directory should not have a .po file at
all. It will be LOCALES/en for English This tells the system to fall
back to the text in the code. At least if you used:

from zope.i18nmessageid import MessageFactory
_ = MessageFactory('<translate_domain_name>')

Then in your interfaces or other places you did this:

    title=_(u"RM Attribute Name"),
    description=_(u"Reference model attribute within the enclosed type
representedby a CObject."),
    description=_(u"Indicates whether the target object exists or
<sorry for the wrapped descriptions>

so your message factory is named '_' (by convention) 


Timothy Cook, MSc
Health Informatics Research & Development Services
LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook 
Skype ID == timothy.cook 
*You may get my Public GPG key from  popular keyservers or   *
*from this link http://timothywayne.cook.googlepages.com/home*
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://mail.zope.org/pipermail/grok-dev/attachments/20090326/c04943f4/attachment.bin 

More information about the Grok-dev mailing list