Edgewall Software
Modify

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#11999 closed defect (fixed)

Errors from ca localization when running easy_install

Reported by: Ryan J Ollos Owned by: Jordi Mallach
Priority: normal Milestone: 1.0.6
Component: i18n Version:
Severity: normal Keywords:
Cc: Jordi Mallach Branch:
Release Notes:

Fixed catalog compilation errors from ca localization.

API Changes:
Internal Changes:

Description

The following errors are seen when installing Trac with easy_install. It is always discomforting to see errors on the screen when installing a package. It would be nice if we could tweak the localization to avoid the errors, or somehow silence them.

Downloading https://pypi.python.org/packages/source/T/Trac/Trac-1.0.5.zip#md5=17449de4359f71f3c40b894b70ea52d0
Processing Trac-1.0.5.zip
Running Trac-1.0.5/setup.py -q bdist_egg --dist-dir /tmp/easy_install-gR86do/Trac-1.0.5/egg-dist-tmp-QM_4P5
catalog 'trac/locale/fa/LC_MESSAGES/messages.po' is marked as fuzzy, skipping
error: trac/locale/ca/LC_MESSAGES/messages.po:668: unknown named placeholder u'resource'
error: trac/locale/ca/LC_MESSAGES/messages.po:704: unknown named placeholder u'subject'
error: trac/locale/ca/LC_MESSAGES/messages.po:709: unknown named placeholder u'subject'
error: trac/locale/ca/LC_MESSAGES/messages.po:736: unknown named placeholder u'page'
error: trac/locale/ca/LC_MESSAGES/messages.po:2722: unknown named placeholder u'revs'
error: trac/locale/ca/LC_MESSAGES/messages.po:2994: unknown named placeholder u'shortname'
error: trac/locale/ca/LC_MESSAGES/messages.po:4692: unknown named placeholder u'created'
error: trac/locale/ca/LC_MESSAGES/messages.po:4697: unknown named placeholder u'created'
error: trac/locale/ca/LC_MESSAGES/messages.po:5274: unknown named placeholder u'file'
error: trac/locale/ca/LC_MESSAGES/messages.po:5286: unknown named placeholder u'file'
error: trac/locale/ca/LC_MESSAGES/messages.po:5806: unknown named placeholder u'in_repo'
error: trac/locale/ca/LC_MESSAGES/messages.po:5811: unknown named placeholder u'in_repo'
error: trac/locale/ca/LC_MESSAGES/messages.po:6670: unknown named placeholder u'name'
error: trac/locale/ca/LC_MESSAGES/messages.po:6675: unknown named placeholder u'name'
error: trac/locale/ca/LC_MESSAGES/messages.po:6703: incompatible format for placeholder u'version': 'd' and 's' are not compatible
catalog 'trac/locale/vi/LC_MESSAGES/messages.po' is marked as fuzzy, skipping
Removing Trac 1.0.4 from easy-install.pth file
Adding Trac 1.0.5 to easy-install.pth file

Attachments (0)

Change History (10)

comment:1 by Jun Omae, 9 years ago

We could add a fuzzy marker to the first msgid "" to skip it.

  • trac/locale/ca/LC_MESSAGES/messages.po

    diff --git a/trac/locale/ca/LC_MESSAGES/messages.po b/trac/locale/ca/LC_MESSAGES/messages.po
    index 02b01da..7b80888 100644
    a b  
    44# Núria Montesinos, 2004.
    55# Jordi Mallach <jordi@sindominio.net>, 2004, 2009, 2010, 2011, 2013.
    66#
     7#, fuzzy
    78msgid ""
    89msgstr ""
    910"Project-Id-Version: trac 1.0-dev\n"

After the patch, compile_catalog -l ca command would skip to compile it.

$ make compile-ca
python setup.py  compile_catalog -l ca  compile_catalog_js -l ca  compile_catalog_tracini -l ca \
            generate_messages_js -l ca
running compile_catalog
catalog 'trac/locale/ca/LC_MESSAGES/messages.po' is marked as fuzzy, skipping
running compile_catalog_js
compiling catalog 'trac/locale/ca/LC_MESSAGES/messages-js.po' to 'trac/locale/ca/LC_MESSAGES/messages-js.mo'
running compile_catalog_tracini
compiling catalog 'trac/locale/ca/LC_MESSAGES/tracini.po' to 'trac/locale/ca/LC_MESSAGES/tracini.mo'
running generate_messages_js
generating messages javascript 'trac/locale/ca/LC_MESSAGES/messages-js.mo' to 'trac/htdocs/js/messages/ca.js'

comment:2 by Thijs Triemstra, 9 years ago

Also saw this problem during 1.0.5 upgrade.

error: trac/locale/ca/LC_MESSAGES/messages.po:668: unknown named placeholder u'resource'
    error: trac/locale/ca/LC_MESSAGES/messages.po:704: unknown named placeholder u'subject'
    error: trac/locale/ca/LC_MESSAGES/messages.po:709: unknown named placeholder u'subject'
    error: trac/locale/ca/LC_MESSAGES/messages.po:736: unknown named placeholder u'page'
    error: trac/locale/ca/LC_MESSAGES/messages.po:2722: unknown named placeholder u'revs'
    error: trac/locale/ca/LC_MESSAGES/messages.po:2994: unknown named placeholder u'shortname'
    error: trac/locale/ca/LC_MESSAGES/messages.po:4692: unknown named placeholder u'created'
    error: trac/locale/ca/LC_MESSAGES/messages.po:4697: unknown named placeholder u'created'
    error: trac/locale/ca/LC_MESSAGES/messages.po:5274: unknown named placeholder u'file'
    error: trac/locale/ca/LC_MESSAGES/messages.po:5286: unknown named placeholder u'file'
    error: trac/locale/ca/LC_MESSAGES/messages.po:5806: unknown named placeholder u'in_repo'
    error: trac/locale/ca/LC_MESSAGES/messages.po:5811: unknown named placeholder u'in_repo'
    error: trac/locale/ca/LC_MESSAGES/messages.po:6670: unknown named placeholder u'name'
    error: trac/locale/ca/LC_MESSAGES/messages.po:6675: unknown named placeholder u'name'
    error: trac/locale/ca/LC_MESSAGES/messages.po:6703: incompatible format for placeholder u'version': 'd' and 's' are not compatible
Version 0, edited 9 years ago by Thijs Triemstra (next)

comment:3 by Ryan J Ollos, 9 years ago

It looks like the issues may not exist in the catalog on Transifex, but I'll have to look closer to be sure. Maybe we could just pull down the latest catalog. More generally, we need to address the problem soon of syncing with the Transifex translations.

comment:4 by Ryan J Ollos, 9 years ago

Cc: Jordi Mallach added

Okay, let's mark as fuzzy unless someone can fix issues with the translation.

@jordi: would you be able to take a look?

comment:5 by Ryan J Ollos, 9 years ago

Milestone: next-stable-1.0.x1.0.6

comment:6 by Jordi Mallach, 9 years ago

Wow, I wonder how this started happening out of the blue. I'll have a look ASAP!

comment:7 by Jordi Mallach, 9 years ago

I am puzzled at this. The catalog in SVN did compile correctly.

Are you by any chance telling msgfmt to accept fuzzy entries? (-f switch) That would be terrible.

I also see some commits from cboos where po files are updated using -N. If this -N arg is being passed to msgmerge, I believe quite some translation work is being lost.

So, not diving into Babel internals, what could be happening is the mix of the two:

Message catalogs like mine, which may contain fuzzy strings if I didn't complete a translation up to 100% translated, are being compiled with msgfmt -f, which is basically telling gettext "treat fuzzy strings as valid ones". If those fuzzy strings have incompatible placeholders, you get the error messages above.

To mitigate this, fuzzy strings are being avoided by using -N, which really is terrible as we're discarding nearly-good translations that only lack whitespace change etc. just to avoid them being marked as fuzzy.

I'm sorry if the above is all nonsense, as I said I didn't dive into the compile_catalog functions in Babel, but if this is the case, the fix is easy: stop validating fuzzy strings (via msgfmt -f) and continue doing fuzzy matching in msgmerge as fuzzy strings are awesome (if not used in the compiled version).

In any case, I did a massive update of Catalan in the stable branch, just missing the longer messages I don't have time to look at now.

comment:8 by Ryan J Ollos, 9 years ago

Installation looks good now.

$ easy_install http://svn.edgewall.org/repos/trac/branches/1.0-stable
Downloading http://svn.edgewall.org/repos/trac/branches/1.0-stable
Doing subversion checkout from http://svn.edgewall.org/repos/trac/branches/1.0-stable to /var/folders/qf/y5yt86vn54j_sy7dv1f8hb3r0000gn/T/easy_install-bJPRLy/1.0-stable
Processing 1.0-stable
Writing /var/folders/qf/y5yt86vn54j_sy7dv1f8hb3r0000gn/T/easy_install-bJPRLy/1.0-stable/setup.cfg
Running setup.py -q bdist_egg --dist-dir /var/folders/qf/y5yt86vn54j_sy7dv1f8hb3r0000gn/T/easy_install-bJPRLy/1.0-stable/egg-dist-tmp-lbJmzp
catalog 'trac/locale/fa/LC_MESSAGES/messages.po' is marked as fuzzy, skipping
catalog 'trac/locale/vi/LC_MESSAGES/messages.po' is marked as fuzzy, skipping
Copying Trac-1.0.6.dev0-py2.7.egg to /Users/rjollos/Documents/Workspace/trac-dev/temp/lib/python2.7/site-packages
Adding Trac 1.0.6.dev0 to easy-install.pth file
Installing trac-admin script to /Users/rjollos/Documents/Workspace/trac-dev/temp/bin
Installing tracd script to /Users/rjollos/Documents/Workspace/trac-dev/temp/bin

Installed /Users/rjollos/Documents/Workspace/trac-dev/temp/lib/python2.7/site-packages/Trac-1.0.6.dev0-py2.7.egg
Processing dependencies for Trac==1.0.6.dev0
Finished processing dependencies for Trac==1.0.6.dev0
$ easy_install http://svn.edgewall.org/repos/trac/trunk
Downloading http://svn.edgewall.org/repos/trac/trunk
Doing subversion checkout from http://svn.edgewall.org/repos/trac/trunk to /var/folders/qf/y5yt86vn54j_sy7dv1f8hb3r0000gn/T/easy_install-RfKIGt/trunk
Processing trunk
Writing /var/folders/qf/y5yt86vn54j_sy7dv1f8hb3r0000gn/T/easy_install-RfKIGt/trunk/setup.cfg
Running setup.py -q bdist_egg --dist-dir /var/folders/qf/y5yt86vn54j_sy7dv1f8hb3r0000gn/T/easy_install-RfKIGt/trunk/egg-dist-tmp-I5XzQ1
catalog 'trac/locale/fa/LC_MESSAGES/messages.po' is marked as fuzzy, skipping
catalog 'trac/locale/vi/LC_MESSAGES/messages.po' is marked as fuzzy, skipping
dCopying Trac-1.1.5.dev0-py2.7.egg to /Users/rjollos/Documents/Workspace/trac-dev/temp/lib/python2.7/site-packages
Adding Trac 1.1.5.dev0 to easy-install.pth file
Installing trac-admin script to /Users/rjollos/Documents/Workspace/trac-dev/temp/bin
Installing tracd script to /Users/rjollos/Documents/Workspace/trac-dev/temp/bin

Installed /Users/rjollos/Documents/Workspace/trac-dev/temp/lib/python2.7/site-packages/Trac-1.1.5.dev0-py2.7.egg
Processing dependencies for Trac==1.1.5.dev0
Finished processing dependencies for Trac==1.1.5.dev0

Changesets in which translations were updated: [13955], [13956].

in reply to:  7 comment:9 by Ryan J Ollos, 9 years ago

Release Notes: modified (diff)
Resolution: fixed
Status: newclosed

Replying to jordi:

I'm sorry if the above is all nonsense, as I said I didn't dive into the compile_catalog functions in Babel, but if this is the case, the fix is easy: stop validating fuzzy strings (via msgfmt -f) and continue doing fuzzy matching in msgmerge as fuzzy strings are awesome (if not used in the compiled version).

I don't know enough about Trac's usage of Babel to determine what is going on. Thank you for the comments, and I'll try to revisit this when I have some time to dive deeper into the code.

comment:10 by Ryan J Ollos, 9 years ago

Owner: set to Jordi Mallach

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jordi Mallach.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jordi Mallach to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.