Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add locales folder #136

Merged
merged 5 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .meta.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,12 @@ additional-rules = [
"recursive-include src *.gif",
"recursive-include src *.js",
"recursive-include src *.metadata",
"recursive-include src *.po",
"recursive-include src *.pot",
"recursive-include src *.props",
"recursive-include src *.pt",
"recursive-include src *.rst",
"recursive-include src *.sh",
"recursive-include src *.stx",
"recursive-include src *.swf",
"recursive-include src *.txt",
Expand Down
3 changes: 2 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Products.CMFCore Changelog
3.4 (unreleased)
----------------

- Nothing changed yet.
- Add i18n translation support.
(`#135 <https://github.com/zopefoundation/Products.CMFCore/issues/135>`_)


3.3 (2024-01-23)
Expand Down
3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@ recursive-include src *.dtml
recursive-include src *.gif
recursive-include src *.js
recursive-include src *.metadata
recursive-include src *.po
recursive-include src *.pot
recursive-include src *.props
recursive-include src *.pt
recursive-include src *.rst
recursive-include src *.sh
recursive-include src *.stx
recursive-include src *.swf
recursive-include src *.txt
Expand Down
2 changes: 1 addition & 1 deletion src/Products/CMFCore/ActionInformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class Action(PropertyManager, SimpleItem):
""" Reference to an action.
"""

i18n_domain = 'cmf_default'
i18n_domain = 'cmf_core'
link_target = ''

security = ClassSecurityInfo()
Expand Down
2 changes: 1 addition & 1 deletion src/Products/CMFCore/browser/configure.zcml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:browser="http://namespaces.zope.org/browser"
i18n_domain="cmf_default">
i18n_domain="cmf_core">

<configure package="Products.GenericSetup.browser">

Expand Down
5 changes: 4 additions & 1 deletion src/Products/CMFCore/configure.zcml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<configure
xmlns="http://namespaces.zope.org/zope">
xmlns="http://namespaces.zope.org/zope"
xmlns:i18n="http://namespaces.zope.org/i18n">

<i18n:registerTranslations directory="locales" />

<include package="five.localsitemanager"/>

Expand Down
2 changes: 1 addition & 1 deletion src/Products/CMFCore/exportimport/configure.zcml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
i18n_domain="cmf_default">
i18n_domain="cmf_core">

<adapter
factory=".content.StructureFolderWalkingAdapter"
Expand Down
58 changes: 58 additions & 0 deletions src/Products/CMFCore/locales/cmf_core.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#--- PLEASE EDIT THE LINES BELOW CORRECTLY ---
#SOME DESCRIPTIVE TITLE.
#FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2024-04-12 15:35+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0\n"
"Language-Code: en\n"
"Language-Name: English\n"
"Preferred-Encodings: utf-8 latin1\n"
"Domain: cmf_core\n"

#: ../MembershipTool.py:557
msgid "A home folder for portal members."
msgstr ""

#: ../MembershipTool.py:575
msgid "Classic CMFCore home folder for portal members."
msgstr ""

#: ../WorkflowTool.py:285
msgid "Could not get info: ${name}"
msgstr ""

#: ../MembershipTool.py:556
msgid "Home Folder"
msgstr ""

#: ../WorkflowTool.py:270
msgid "No workflow provides '${name}' information."
msgstr ""

#: ../WorkflowTool.py:241
msgid "No workflow provides the '${action_id}' action."
msgstr ""

#: ../WorkflowTool.py:234
msgid "No workflows found."
msgstr ""

#: ../WorkflowTool.py:248
msgid "Requested workflow definition not found."
msgstr ""

#: ../RegistrationTool.py:144
msgid "The login name you selected is already in use or is not valid. Please choose another."
msgstr ""

#: ../PortalContent.py:56
msgid "This resource is locked via webDAV."
msgstr ""
55 changes: 55 additions & 0 deletions src/Products/CMFCore/locales/pt_BR/LC_MESSAGES/cmf_core.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2024-04-12 15:35+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0\n"
"Language-Code: en\n"
"Language-Name: English\n"
"Preferred-Encodings: utf-8 latin1\n"
"Domain: DOMAIN\n"

#: ../MembershipTool.py:557
msgid "A home folder for portal members."
msgstr "Uma pasta inicial para membros do portal."

#: ../MembershipTool.py:575
msgid "Classic CMFCore home folder for portal members."
msgstr "Pasta inicial Classic CMFCore para membros do portal."

#: ../WorkflowTool.py:285
msgid "Could not get info: ${name}"
msgstr "Não foi possível obter informação: ${name}"

#: ../MembershipTool.py:556
msgid "Home Folder"
msgstr "Pasta Inicial"

#: ../WorkflowTool.py:270
msgid "No workflow provides '${name}' information."
msgstr "Nenhum workflow fornece informações de '${name}'."

#: ../WorkflowTool.py:241
msgid "No workflow provides the '${action_id}' action."
msgstr "Nenhum workflow fornece a ação '${action_id}'."

#: ../WorkflowTool.py:234
msgid "No workflows found."
msgstr "Nenhum workflow encontrado."

#: ../WorkflowTool.py:248
msgid "Requested workflow definition not found."
msgstr "Definição de workflow requerida não encontrada."

#: ../RegistrationTool.py:144
msgid "The login name you selected is already in use or is not valid. Please choose another."
msgstr "O nome de usuário que você selecionou já está em uso ou não é válido. Por favor escolha outro."

#: ../PortalContent.py:56
msgid "This resource is locked via webDAV."
msgstr "Este recurso está bloqueado via webDAV."
12 changes: 12 additions & 0 deletions src/Products/CMFCore/locales/update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
# i18ndude should be available in current $PATH (eg by running
# ``export PATH=$PATH:$BUILDOUT_DIR/bin`` when i18ndude is located in your buildout's bin directory)
#
# For every language you want to translate into you need a
# locales/[language]/LC_MESSAGES/cmf_core.po
# (e.g. locales/de/LC_MESSAGES/cmf_core.po)

domain=cmf_core

i18ndude rebuild-pot --pot $domain.pot --create $domain ../
i18ndude sync --pot $domain.pot */LC_MESSAGES/$domain.po
2 changes: 1 addition & 1 deletion src/Products/CMFCore/permissions.zcml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<configure xmlns="http://namespaces.zope.org/zope"
xmlns:zcml="http://namespaces.zope.org/zcml"
i18n_domain="cmf_default">
i18n_domain="cmf_core">

<!-- CMF Core Permissions -->

Expand Down
2 changes: 1 addition & 1 deletion src/Products/CMFCore/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -910,4 +910,4 @@ def base64_decode(text):


security.declarePublic('Message') # NOQA: flake8: D001
Message = MessageFactory('cmf_default')
Message = MessageFactory('cmf_core')
Loading