custom product's i18n is not loaded

5 Messages Forum Options Options
Permalink
supasate
custom product's i18n is not loaded
Reply Threaded More
Print post
Permalink
(This post was updated on )
Hi,

I have a problem that i18n doesn't recognize my product's i18n folder.

I'm not sure that it's about my folder structure or not.

Here's my structure folder that's created by paster script.

nia
 |- bin
 |- bootstrap.py
 |- buildout.cfg
 |- develop-eggs
 |- downloads
 |- eggs
 |- parts
 |- products
 |- var
 |- src
     |- package.product
         |- package
             |- product
                  |- browser <- there're .pt files that use i18n:domain="package"
                  |- content
                  |- i18n <- package.pot and package-th.po are here

When I restart Zope server and reinstall product with linguaplone and change the language to th, there's nothing change.

I found there's no .mo file generated.

I use plone3.0.6 and .pt files, in the browser folder, will be called by Archetype product, however, I tested only words that are not related to Archetype (just a text, for example) and it didn't work.

How should I verify that i18n is loaded?? or how to make it loaded??

Thank you in advance

Supasate
Jean-Pascal Houde-2
Re: custom product's i18n is not loaded
Reply Threaded More
Print post
Permalink
Hi,

i18n dirs don't work in python packages (it only works for Products).
For packages you need to use a "locales" directory, which work a bit
differently.

There is a good tutorial in this blog post :
http://maurits.vanrees.org/weblog/archive/2007/09/i18n-locales-and-plone-3.0

Jean-Pascal

On 7 mai, 07:50, supasate <kaizerw...@...> wrote:
> Hi,
>
> I have a problem that i18n doesn't recognize my product's i18n folder.
>
> I'm not sure that it's about my folder structure or not.
>
> Here's my structure folder that's created by paster script.
> [...]

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Plone-i18n mailing list
Plone-i18n@...
https://lists.sourceforge.net/lists/listinfo/plone-i18n
supasate
Re: custom product's i18n is not loaded
Reply Threaded More
Print post
Permalink
Thank you for your answer.

It's working but there are some problems.

1. My archetype content is translated only in edit page, but in view page it is not translated.
2. The vocabulary words are not translated, so it caused a problem in the field validation process.

How to avoid these problems?

Supasate

Jean-Pascal Houde wrote:
Hi,

i18n dirs don't work in python packages (it only works for Products).
For packages you need to use a "locales" directory, which work a bit
differently.

There is a good tutorial in this blog post :
http://maurits.vanrees.org/weblog/archive/2007/09/i18n-locales-and-plone-3.0

Jean-Pascal

On 7 mai, 07:50, supasate <kaizerw...@hotmail.com> wrote:
> Hi,
>
> I have a problem that i18n doesn't recognize my product's i18n folder.
>
> I'm not sure that it's about my folder structure or not.
>
> Here's my structure folder that's created by paster script.
> [...]

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Plone-i18n mailing list
Plone-i18n@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plone-i18n
supasate
encoding problem
Reply Threaded More
Print post
Permalink
Now I can avoid these problems by changing i18n domain to plone.

However, for vocabulary, it still has a problem about encoding (UnicodeEncodeError).

I searched the list archives and follow many advices that change default encoding of python to utf-8. By following this instruction, the UnicodeEncodeError is gone, however, I got "Value ต่างชาติ is not allowed for vocabulary of element ${label}."  ต่างชาติ is a word in my language. I saw the word ต่างชาติ is correct and it's in my allowed vocabulary list.

For more details,
1. I created .po file using utf-8 encoding.
2. Results of using Vocabulary words with unicode _(u"word") and not unicode _("word") are not different.
3. enforceVocabulary=True

Thank you in advance.

Supasate



>It's working but there are some problems.

>1. My archetype content is translated only in edit page, but in view page it is not translated.
>2. The vocabulary words are not translated, so it caused a problem in the field validation process.

>How to avoid these problems?
Jean-Pascal Houde wrote:
Hi,

i18n dirs don't work in python packages (it only works for Products).
For packages you need to use a "locales" directory, which work a bit
differently.

There is a good tutorial in this blog post :
http://maurits.vanrees.org/weblog/archive/2007/09/i18n-locales-and-plone-3.0

Jean-Pascal

On 7 mai, 07:50, supasate <kaizerw...@hotmail.com> wrote:
> Hi,
>
> I have a problem that i18n doesn't recognize my product's i18n folder.
>
> I'm not sure that it's about my folder structure or not.
>
> Here's my structure folder that's created by paster script.
> [...]

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Plone-i18n mailing list
Plone-i18n@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plone-i18n

Jean-Pascal Houde-2
Re: encoding problem
Reply Threaded More
Print post
Permalink
Hi,
Changing the default encoding of python shouldn't be necessary, if you
have to
do it, it means that you have errors in your code (or in some code
you're using).
I would suggest to remove the default encoding setting and try to find
from where the error is coming. Leaving this setting can be bad since
you won't see errors you could make about encodings and your code may
not work where the default encoding is different.

Can you describe with more details what you are doing, what type of
vocabulary you're using,
and what is the traceback of the UnicodeDecodeError?

On May 8, 2:07 pm, supasate <kaizerw...@...> wrote:

> Now I can avoid these problems by changing i18n domain to plone.
>
> However, for vocabulary, it still has a problem about encoding
> (UnicodeEncodeError).
>
> I searched the list archives and follow many advices that change default
> encoding of python to utf-8. By following this instruction, the
> UnicodeEncodeError is gone, however, I got "Value ต่างชาติ is not allowed
> for vocabulary of element ${label}."  ต่างชาติ is a word in my language. I
> saw the word ต่างชาติ is correct and it's in my allowed vocabulary list.
>
> For more details,
> 1. I created .po file using utf-8 encoding.
> 2. Results of using Vocabulary words with unicode _(u"word") and not unicode
> _("word") are not different.
>
> Thank you in advance.
>
> Supasate
>
>

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Plone-i18n mailing list
Plone-i18n@...
https://lists.sourceforge.net/lists/listinfo/plone-i18n