Ticket #4824 (closed Bug: fixed)

Opened 10 years ago

PTS does no longer install properly with plone 2.1.1

Reported by: Anonymous User Owned by:
Priority: minor Milestone: Past
Component: Internationalization Version:
Keywords: Cc:

Description

With Plone 2.1.1 Placeless Translation Service is no longer installed correctly in Zope Startup. I tested on linux and windows box. With Plone 2.1 it worked properly. The problem is not fixed with PlacelessTranslationService 1.2.3 and not through several restarts. The result is very bad because Plone no longer appears in the default browser language.

Attachments

GettextMessageCatalog.py Download (25.4 KB) - added by hannosch 10 years ago.
GettextMessageCatalog.py

Change History

comment:1 Changed 10 years ago by hannosch

Hi.

Could you please tell us some more details about your specific setup? How did you install Plone (Windows installer, core tarball?) and what versions are you using, especially Zope?

Is there any kind of error message in the console, log/error.log or after you started Zope in the Products section of the ZMI control panel?

Without further information we are not able to find the source of this problem ;)

comment:2 Changed 10 years ago by Anonymous User

Zope 2.8.3 (see above ;-), no installers, correct source setup of plone 2.1.1 tarball (same install as ever, working since ancient times), and same thing either with PTS 1.2.2 from this tarball or the newer 1.2.3

pathes seem to be mixed up due to unknown changes between plone 2.1 and 2.1.1 and magic (wrong!) zeros are inserted in the path - the correct software home is z2 and instance home is z2i0; it rather seems to be a problem with PTS

traceback:


2005-10-20T21:52:26 INFO PlacelessTranslationService Applying patch * Patching ZPublisher.Publish with the get_request patch! *


2005-10-20T21:52:39 WARNING PlacelessTranslationService Message Catalog has errors archetypes-bg.po Traceback (most recent call last):

File "/home/z2i0/Products/PlacelessTranslationService/PlacelessTranslationService.py", line 307, in _load_catalog_file

self.addCatalog(GettextMessageCatalog(id, pofile, language, domain))

File "/home/z2i0/Products/PlacelessTranslationService/GettextMessageCatalog.py", line 212, in init

self._mod_time = self._getModTime()

File "/home/z2i0/Products/PlacelessTranslationService/GettextMessageCatalog.py", line 405, in _getModTime

mtime = os.stat(self._getPoFile())[8]

OSError: [Errno 2] No such file or directory: '/home/z2/0/Products/Archetypes/i18n/archetypes-bg.po'


2005-10-20T21:52:39 ERROR Zope Couldn't install PlacelessTranslationService Traceback (most recent call last):

File "/home/z2/lib/python/OFS/Application.py", line 773, in install_product

initmethod(context)

File "/home/z2i0/Products/PlacelessTranslationService/init.py", line 161, in initialize

cp_ts._load_i18n_dir(os.path.join(prod[3], prod[1], 'i18n'))

File "/home/z2i0/Products/PlacelessTranslationService/PlacelessTranslationService.py", line 347, in _load_i18n_dir

self._load_catalog_file(name, basepath)

File "/home/z2i0/Products/PlacelessTranslationService/PlacelessTranslationService.py", line 321, in _load_catalog_file

self.addCatalog(BrokenMessageCatalog(id, pofile, exc))

File "/home/z2i0/Products/PlacelessTranslationService/GettextMessageCatalog.py", line 105, in init

self._mod_time = self._getModTime()

File "/home/z2i0/Products/PlacelessTranslationService/GettextMessageCatalog.py", line 113, in _getModTime

mtime = os.stat(self._getPoFile())[8]

OSError: [Errno 2] No such file or directory: '/home/z2/0/Products/Archetypes/i18n/archetypes-bg.po'


2005-10-20T21:52:40 INFO Zope New disk product detected, determining if we need to fix up any ZClasses.


2005-10-20T21:52:40 INFO Zope Ready to handle requests

Changed 10 years ago by hannosch

GettextMessageCatalog.py

comment:3 Changed 10 years ago by hannosch

I'm not able to reproduce this problem on my box, but I have made the relevant calls a bit more robust. So please try to replace the existing GettextMessageCatalog.py in your INSTANCE_HOME/Products/PlacelessTranslationService folder with the attached one and tell us if this works for you.

comment:4 Changed 10 years ago by blacktav

Note in the original posting, the path PTS generates is screwed. WIth me it bombs with

OSError: [Errno 2] No such file or directory: '/srv/zope/2.8.1/Products/ZWiki/i18n/zwiki-de.po'

when the path should be /srv/zope/zope-2.8.1/Products/ZWiki/i18n/zwiki-de.po

Modified GettextMessageCatalog.py allows Zope to start and translations appear OK but since I'm mono-lingual can't say for sure

comment:5 Changed 10 years ago by Anonymous User

The new GettextMessageCatalog.py obviously is a step in the right direction - the wrong path problem (OSError) went away. PTS is now initialized, but still missing its translations and Plone still does not give the browser language by default.

Traceback:

INFO PlacelessTranslationService Initialized: ['richdocument-plone-fr.po', 'richdocument-fr.po', 'richdocument-zh.po', 'richdocument-plone-zh.po'] from /home/z2i0/Products/RichDocument/i18n


2005-10-25T22:01:25 INFO PlacelessTranslationService Initialized: ['kupu-cs.po', 'kupu-da.po', 'kupu-de.po', 'kupu-el.po', 'kupu-eo.po', 'kupu-fi.po', 'kupu-fr.po', 'kupu-he.po', 'kupu-ja.po', 'kupu-nl.po', 'kupu-pt-br.po', 'kupu-pt.po', 'kupu-sr-Latn.po', 'kupu-sr.po', 'kupu-zh-cn.po', 'kupu-zh.po', 'kupuconfig-da.po', 'kupuconfig-fr.po', 'kupuconfig-ja.po'] from /home/z2i0/Products/kupu/i18n


2005-10-25T22:01:25 WARNING PlacelessTranslationService no translations found!


2005-10-25T22:01:26 INFO Zope Ready to handle requests

comment:6 Changed 10 years ago by paulr

Maybe I can shed some light on the issue of Plone translations not showing up: somewhere in the 2.1 to 2.1.1 migration, the single- and double locales got mixed up. In Plone 2.1, I had set "Dutch (nl-nl)" as the default. This doesn't work anymore, you have to set it to "Nederlands (nl)" (Note the translation into the language itself, Nederlands is the dutch word for Dutch)

This should probably be added to the migration notes.

comment:7 Changed 10 years ago by hannosch

The missing nl-nl as a fallback language is a different issue. I'll try to fix these in the next release.

Regarding the messed up path's: After our talk on IRC, I have written a small unit test that could shed some light on where the problem actually is. Could you get the latest version of PTS from SVN ( https://svn.plone.org/svn/collective/PlacelessTranslationService/trunk) and run 'python testPTS.py' in the tests folder?

Either try to catch me on IRC again or post the results here please. Could you also post the complete version overview from the ZMI control panel here, please?

I've meanwhile found a Suse 9.1 server set up Python/Zope/Plone 2.1 from source and everything works fine ;)

comment:8 Changed 10 years ago by hannosch

  • Status changed from new to closed
  • Resolution set to fixed

The problem should be resolved with PTS 1.2.4.

Note: See TracTickets for help on using tickets.