Re: Some I18N and PlacelessTranslationService questions
Itai Tavor wrote:
> Hi,
>
> Trying to get a i18n Plone site going, and I've hit some problems:
>
> - What's the best way to get the current language? (In a Python script
> and an action condition)
>
> - I got a working .po file for my domain (shows up in the Control Panel
> and tests ok), but i18NDisplayList(context.REQUEST, ('word',),
> domain='mydomain') returns NOT_TRANSLATED. Any idea how to find what
> the problem is?
>
> - Why does Products.PlacelessTranslationService.getLanguageName('en')
> result in:
>
> 2004-03-01T18:11:51 ERROR(200) SiteError
> http://10.0.1.10:8082/Accretech/portal_skins/public/scripts/test
> Traceback (most recent call last):
> File "/usr/local/zope/2.7.0/lib/python/ZPublisher/Publish.py", line
> 100, in publish
> request, bind=1)
> File "/usr/local/zope/2.7.0/lib/python/ZPublisher/mapply.py", line
> 88, in mapply
> if debug is not None: return debug(object,args,context)
> File "/usr/local/zope/2.7.0/lib/python/ZPublisher/Publish.py", line
> 40, in call_object
> result=apply(object,args) # Type s<cr> to step into published
> object.
> File
> "/Volumes/Shadow/Projects/Zope/Accretech/Products/CMFCore/
> FSPythonScript.py", line 104, in __call__
> return Script.__call__(self, *args, **kw)
> File
> "/usr/local/zope/2.7.0/lib/python/Shared/DC/Scripts/Bindings.py", line
> 306, in __call__
> return self._bindAndExec(args, kw, None)
> File
> "/usr/local/zope/2.7.0/lib/python/Shared/DC/Scripts/Bindings.py", line
> 343, in _bindAndExec
> return self._exec(bound_data, args, kw)
> File
> "/Volumes/Shadow/Projects/Zope/Accretech/Products/CMFCore/
> FSPythonScript.py", line 160, in _exec
> result = apply(f, args, kw)
> File "Script (Python)", line 23, in test
> File
> "/Volumes/Shadow/Projects/Zope/Accretech/Products/
> PlacelessTranslationService/PlacelessTranslationService.py", line 261,
> in getLanguageName
> cat = self._getOb(cname)
> File "/usr/local/zope/2.7.0/lib/python/OFS/ObjectManager.py", line
> 245, in _getOb
> raise AttributeError, id
> AttributeError: plone-en.po
>
>
> TIA, Itai
>
>
>
> -------------------------------------------------------
> SF.Net is sponsored by: Speed Start Your Linux Apps Now.
> Build and deploy apps & Web services for Linux with
> a free DVD software kit from IBM. Click Now!
> http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
Hi,
I only know it for Localizer:
l = context.portal_url.Localizer
# Get the selected language code, for example "en" for english
l_sel = l.get_selected_language()
-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click