What is the canonical way (if there is any) of overriding some entries for translations in plone.app.locales?
I have a policy package, with a locales folder, and I tried to add an updated plonelocales.po there, but it seems the version on plone.app.locales always wins.
In a locales dir in buildout you still need the proper structure. I just saw a project with a file locales/plone.po which did not work. In your case for English it would need to be: locales/en/LC_MESSAGES/widgets.po.
Since this is TinyMCE, these translations may come from javascript. These translations are cached in the browser for a day, in localStorage. So open the developer tools of your browser, check if widgets-en is in localStorage and remove it.
"Current Content" and "Start Page" are in the plone domain (plone.po), but adding these to my overrides have no effect. (Other overrides in the same .po file does have an effect).
I assume they are also buried deep down in some compiled javascript - any tricks for these ones?
I'm trying to override a translation of z3c.form in my local package. I've downloaded a copy for z3c.form.po in my local package locales/it/LC_MESSAGES/z3c.form.po, keep the headers, removed all the translations but the one I want to change. I've also this in configure.zcml:
but I can't see my translation, the z3c.form wins. This is the header:
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
msgid ""
msgstr ""
"Project-Id-Version: Meaningless\n"
"POT-Creation-Date: Mon Sep 17 15:11:41 2012\n"
"PO-Revision-Date: 2012-11-18 23:26+0001\n"
"Last-Translator: Giorgio Borelli <giorgio@giorgioborelli.it>\n"
"Language-Team: Plone italian translation project <plone-italian-translation-discussion@lists.coactivate.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: zope/app/locales/extract.py\n"
"Plural-Forms: nplurals=2; plural=n!=1\n"
"Language-Code: it\n"
"Language-Name: Italiano\n"
"X-Is-Fallback-For: it-ch it-it\n"
"Language: it\n"
EDIT: I've tested with plone.po and it does not override the translation I've copied.
Try adding <include package="z3c.form" /> in your ZCML before you register your package's translations, to make sure they load in the right order. I'm not sure if this will solve it, but it might.
I forgot to add that I tried it too but didn't worked.
@erral do the overrides works for you in a plain 6.0.13 Plone installation? I tried with buildout.coredev, copying the custom z3c.form in src/plone.app.locales, then adding the zcml = plone.app.locales in buildout.cfg and it worked (no need to add <include package="Products.CMFPlone" /> in configure.zcml). But in a Plone 6.0.13 buildout installation with a custom product, no way.
The order of loading packages in ZCML is important:
Your ZCML needs to be included before the one from plone.app.locales. The first translation of a msgid wins. To manage this, you can include the ZCML in the buildout:
In your case, your translation should be included before z3c.form's.
It worked. What I was doing wrong is that I had an empty zcml = below in my buildout.cfg, overriding the one with my local product. This was then used in the instance base template. Following the docs carefully lead me to find the problem.
Sorry for the noise, and thanks all for the support.