Maurits van Rees | 4 Sep 23:26
Picon
Favicon

locales and default language that is not English

Hi,

I came across some unexpected behaviour where zope.i18n was
translating a bit too enthusiastically, even when no translations were
actually wanted.

The situation
-------------

I have a package xm.theme.  The templates and python files are all in
English of course.  It has locales for Dutch.

I am using that package on a Plone 3.1 site.  That site has Dutch as
default language and English as a second allowed language.  No
LinguaPlone.  portal_languages is set to take the browser language
preference into account.

I visit the site with a browser that only wants Dutch.  The complete
UI is shown in Dutch.  So translations are working fine in that case.

I then visit the site with a browser that only wants English.  Now
most of the site UI is in English.  But the msgids in the xm.theme
domain remain shown in Dutch.

The problem
-----------

The problem here is that the xm.theme translationdomain from zope.i18n
only has a catalog for the Dutch language (and some test catalog).
The language negotiator (the code that decides what the target
(Continue reading)

Franco Pellegrini | 12 Sep 22:06
Favicon

How does the whole translation machinery works ?

Hello list, this is my first mail here, so first, hello to everybody,
My name is Franco, i'm from Argentina and i've been working with Plone
for almost 2 years now.

Last friday, i found this [0] ticket, and started to work on it.
The first issue, was easy, just some translation missing for that,
which i added and commited.

Then i started to look at the other issue, the one for the workflow
transitions drop down.
When you leave the mouse cursor over the transition's name, a
description box appears, but this text appears in english, no matter
in which language the site is.

I'm guessing here, that the problem is in the translation machinery,
so i started to search how translation works, and i couldn't find any
documentation about it.

What i guess is that some python code gets executed, which after
searching for translation, it returns the html to be rendered... but i
cannot find where or how.

So, i would really appreciate if someone could give me some pointers
on where to find this, or where can i find more info about it.

regards,
Franco

[0] - https://dev.plone.org/plone/ticket/8137

(Continue reading)

Jean Jordaan | 15 Sep 07:13
Picon

Re: How does the whole translation machinery works ?

Hi Franco

> What i guess is that some python code gets executed, which after
> searching for translation, it returns the html to be rendered...

When a string is to be translated, it needs to be looked up. That is
done as follows in a page template:

  <a ... i18n:translate="label_skiptocontent">Skip to content.</a>

In that case, label_skiptocontent is the msgid which is used to
replace the content of the tag. At the moment when the template is
rendered, the lookup and substitution is done.

In Python code, it is done like this:

  PloneMessageFactory(u'View')

PloneMessageFactory is normally imported as _, so that it's shorter to write:

from Products.CMFPlone import PloneMessageFactory as _
[...]
            'name': _(u'View'),

In that case, View is the msgid which is used to look up the
translation. To see where it's used:

$ grep -r "\<_(" Products/

--

-- 
(Continue reading)

Steve Spicklemire | 15 Sep 19:41
Gravatar

Re: i18ndude problem..

OK.. I finally figured this one out:

somewhere along the way i18ndude stopped working on page templates  
with a .zpt extension.

For some reason.. when I started doing page templates I used that  
extension for my filesystem code.

I just added '.zpt' to the list in the i18ndude source and it worked.

-steve

On Aug 24, 2008, at 6:59 AM, Maurits van Rees wrote:

> Hanno Schlichting, on 2008-08-23:
>> Steve Spicklemire wrote:
>>> Now I try:
>>>
>>> steve$ i18ndude rebuild-pot --pot foo.pot --create FOO foo.pt
>>>
>>> and I get:
>>>
>>>> No entries for domain "FOO".
>>>> Type i18ndude<Enter> to see the help.
>>>
>>>
>>> I must be doing something pretty dumb. Any ideas?
>>
>> No idea, try without that strange looking UPPERCASE?
>>
(Continue reading)

Steve Spicklemire | 15 Sep 19:47
Gravatar

toLocalizedTime

Hi Folks,

I've got a template that does:

<td tal:content="python:here.toLocalizedTime(item.get('beginDate'))"  
width="100">3/4/2003</td>

which works great in english:

Aug 30, 2008

But in spanish it comes out:

30/08/2008

Is there a FAQ or document that tells me what I need to do to get a  
spanish date like the english date above?

thanks!
-steve

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
dkellner | 21 Sep 19:56
Picon

Re: Appending to plone domain in non-Product packages


Hi Anton,

did you find any solution for this? If not, anybody else here who has got an
answer?

Greetings,
Dominik

Anton Stonor-2 wrote:
> 
> Hi there (probably hannosch),
> 
> The short version of this question is this:
> 
> I want to translate the "Add My type" / "Edit My type" at the Archetypes
> base_edit (that picks it from edit_macros) form.
> 
> How do I do that?
> 
> 
> The longer version:
> 
> It looks like the translated type names is expected to be in the "plone"
> domain. In the old days, one could add an additional po-file with plone
> domain in the i18n dir of the product. Placeless Translation Service would
> merge the multiple po files.
> 
> However, Placeless Translation Service does not look into the i18n
> directory
(Continue reading)

Martin Stadler | 22 Sep 12:22
Picon

Re: Appending to plone domain in non-Product packages

As far as I know starting with version 3.1 Plone scans non-product  
packages for i18n directories.

Martin

Am 21.09.2008 um 19:56 schrieb dkellner:

>
> Hi Anton,
>
> did you find any solution for this? If not, anybody else here who  
> has got an
> answer?
>
> Greetings,
> Dominik
>
>
> Anton Stonor-2 wrote:
>>
>> Hi there (probably hannosch),
>>
>> The short version of this question is this:
>>
>> I want to translate the "Add My type" / "Edit My type" at the  
>> Archetypes
>> base_edit (that picks it from edit_macros) form.
>>
>> How do I do that?
>>
(Continue reading)

Hanno Schlichting | 22 Sep 13:15
Picon
Gravatar

Re: Appending to plone domain in non-Product packages

Martin Stadler wrote:
> As far as I know starting with version 3.1 Plone scans non-product  
> packages for i18n directories.

You need Plone >= 3.1.3 or use PlacelessTranslationService 1.4.12 or
newer to be exact.

PTS 1.4.12 should work with any Plone 3.x version, so you should be able
to overwrite the version shipped with the Plone version you use.

The full changelog of PTS is at
http://pypi.python.org/pypi/Products.PlacelessTranslationService.
Product tarballs can be found at http://plone.org/products/pts.

Hanno

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
Evgeni Golov | 22 Sep 15:04
Favicon
Gravatar

Re: LinguaPlone and portal_actions

Hi,

I stumbled over exactly the same bug in LinguaPlone 2.1.1 on Plone
3.1.5.1 :(

On Wed, 16 Jul 2008 19:57:15 +0000 (UTC) Maurits van Rees wrote:

> Those pages are not content but they are page templates.  So to Plone
> they are just a different way of viewing the front page.  So
> LinguaPlone simply thinks you are viewing the front page in German and
> when clicking the English flag it redirects you to the English version
> of the front page.
> 
> Looks like a LinguaPlone bug.

In browser/selector.py, LinguaPlone creates the links to the translated
objects by looking at the "context" (if you dig into the source, you'll
see the full magic around that), however, context for a ZPT is not the
same as context for a regular document, so we get bad links here :(

Inside a ZPT I can get it's absolute url with "template.absolute_url
()", but that does not work in selector.py and I have no idea how to
fix it :(

Ideas anyone?

Regards
Evgeni

-------------------------------------------------------------------------
(Continue reading)

Olivier Stas | 23 Sep 18:16
Favicon

New specific folders does not translate with i18n machinery

Hello to everyone,

New to Plone for 6 months, I have to internationalize custom products of 
a Plone-based application. Plone version is 2.5.5.
Nearly everything works fine now with i18n : new extended content types 
with widgets, actions, page templates, messages EXCEPT new "folderish" - 
extensions of existing ATContentType  created with invokeFactory 
function. Specific domains have been created as well as corresponding 
"po" files. Per products there are 2 "po" files per language, one with 
the specific domain and one with plone as domain.
As these new specific folders are the first navigation level it's 
important that titles appears correctly, means i18n machinery apply.
Does anyone have an idea of what I could have missed, what I've to check ?

Many thanks for your help, Olivier

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

Gmane