Re: [Zope3-dev] selecting the translation domain in ZCML

2006-06-05 Thread Jean-Marc Orliaguet

Dieter Maurer wrote:

Jean-Marc Orliaguet wrote at 2006-5-30 22:13 +0200:
  

...
Dieter Maurer wrote:
...


In my view the translation domain is vital for translators --
as the domain guides the correct translations.
  

...
But it is the application that eventually sets the domain name to use, 
based on the context. Translators have no control over it, since they 
have no control over page templates or over python code.



You are right, of course: translators do not chose the domain
but are informed about it. However, this does not contradict
that the translation domain is specified in the .po file -- as
the translations in this file are only valid in the
translation domain for which they have been made...

  


It's a practical issue, I think. The way I'm organizing translations 
right now is that I'm creating a folder (named 'locales' for instance) 
with different languages 'en', 'fr' in it. So far no difference.


then inside the LC_MESSAGES folders I will place categories of translations:

- widgets.po
- portlets.po ...

see for example: 
http://svn.z3lab.org/trac/z3lab/browser/cpsskins/branches/paris-sprint-2006/standard/locales


this is instead of having one big .po file that contains everything. 
I've noticed that it's difficult to create and maintain sections inside 
a .po file. The categorization is done here on the filename. So not 
having a hardcoded filename - domain is an advantage.


also notice that few packages register translations in several domains.

Hence, the translators are only concerned with putting translations into 
folders ('business_terms', 'furniture', ...), no matter what the domain 
name will be called.



But why would you want a different domain name than that communicated
to the translators? Do you prefer meaningless over strong names?

  


put it the other way around: if you communicate a domain name to 
translators you have to inform them whenever the domain name changes.


I've just written a mergeTranslations directive, it's rather simple to use:
http://svn.z3lab.org/trac/z3lab/browser/cpsskins/branches/paris-sprint-2006/configuration/i18n/metaconfigure.py

the ZCML is:
cpsskins:mergeTranslations domain=cpsskins directory=locales /

I guess that 01_..., 02_... or some other filename scheme could be used 
to control the merge order in case some translations should override 
other translations.


Regards /JM
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] selecting the translation domain in ZCML

2006-06-03 Thread Dieter Maurer
Jean-Marc Orliaguet wrote at 2006-5-30 22:13 +0200:
 ...
Dieter Maurer wrote:
 ...
 In my view the translation domain is vital for translators --
 as the domain guides the correct translations.
 ...
But it is the application that eventually sets the domain name to use, 
based on the context. Translators have no control over it, since they 
have no control over page templates or over python code.

You are right, of course: translators do not chose the domain
but are informed about it. However, this does not contradict
that the translation domain is specified in the .po file -- as
the translations in this file are only valid in the
translation domain for which they have been made...

 ...
My view is that the translations can still be stored in different 
folders (one per translation context as you mentioned) and the domain 
can be set in ZCML during the configuration of the application for an 
entire folder, globally.

I do not disagree.

Hence, the translators are only concerned with putting translations into 
folders ('business_terms', 'furniture', ...), no matter what the domain 
name will be called.

But why would you want a different domain name than that communicated
to the translators? Do you prefer meaningless over strong names?



-- 
Dieter
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] selecting the translation domain in ZCML

2006-05-30 Thread Wichert Akkerman
Previously Jean-Marc Orliaguet wrote:
 this is OK for most use cases because packages manage their own domain, 
 but there is a case which I don't know how to solve, i.e.  when a 
 package is supposed to register translations into another package's 
 translation domain?.

A po file includes its domain in its header; I'm assuming zope is smart
enough to extract and use that. If not - please fix that :)

Wichert.

-- 
Wichert Akkerman [EMAIL PROTECTED]It is simple to make things.
http://www.wiggy.net/   It is hard to make things simple.
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] selecting the translation domain in ZCML

2006-05-30 Thread Jean-Marc Orliaguet

Jean-Marc Orliaguet wrote:

Wichert Akkerman wrote:

Previously Jean-Marc Orliaguet wrote:
 
this is OK for most use cases because packages manage their own 
domain, but there is a case which I don't know how to solve, i.e.  
when a package is supposed to register translations into another 
package's translation domain?.



A po file includes its domain in its header; I'm assuming zope is smart
enough to extract and use that. If not - please fix that :)

Wichert.

  


In fact, I tried that - it worked in Zope2, but not here. Every time a 
.po file is loaded a new translation domain is registered as a utility 
otherwise there is a domain name conflict.


I agree that would be the most elegant solution.

/JM



although -- while thinking about it, putting the domain name in .po 
files breaks the separation on concerns between translators and 
application developer. Translators shouldn't have to worry about 
translation domains. That's application specific.


Regards
/JM
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] selecting the translation domain in ZCML

2006-05-30 Thread Stephan Richter
On Tuesday 30 May 2006 05:25, Jean-Marc Orliaguet wrote:
 what is the solution? add an option in i18n:registerTranslations? such as:

  i18n:registerTranslations directory=locales domain=mydomain /

 and let the ZCML handler update existing catalogs?

There is no solution right now. I have come across that issue too. It needs to 
be addressed.

Regards,
Stephan
-- 
Stephan Richter
CBU Physics  Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] selecting the translation domain in ZCML

2006-05-30 Thread Dieter Maurer
Jean-Marc Orliaguet wrote at 2006-5-30 12:01 +0200:
 ...
although -- while thinking about it, putting the domain name in .po 
files breaks the separation on concerns between translators and 
application developer. Translators shouldn't have to worry about 
translation domains. That's application specific.

Are you sure? In my view the translation domain is vital for translators --
as the domain guides the correct translations.

For example, in German we have the word Bank.
It may mean bench or bank, depending on the translation domain.


-- 
Dieter
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] selecting the translation domain in ZCML

2006-05-30 Thread Jean-Marc Orliaguet

Dieter Maurer wrote:

Jean-Marc Orliaguet wrote at 2006-5-30 12:01 +0200:
  

...
although -- while thinking about it, putting the domain name in .po 
files breaks the separation on concerns between translators and 
application developer. Translators shouldn't have to worry about 
translation domains. That's application specific.



Are you sure? In my view the translation domain is vital for translators --
as the domain guides the correct translations.

For example, in German we have the word Bank.
It may mean bench or bank, depending on the translation domain.

  


But it is the application that eventually sets the domain name to use, 
based on the context. Translators have no control over it, since they 
have no control over page templates or over python code.


My view is that the translations can still be stored in different 
folders (one per translation context as you mentioned) and the domain 
can be set in ZCML during the configuration of the application for an 
entire folder, globally.


Hence, the translators are only concerned with putting translations into 
folders ('business_terms', 'furniture', ...), no matter what the domain 
name will be called.


In this way, changing a domain name or creating a new one is done once, 
instead of being done for each po files.


Regards
/JM
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com