Permalink
Browse files

Merge pull request #4 from macagua/master

Added improvements about i18n support
  • Loading branch information...
2 parents fc372e8 + 957787e commit 4b26acb590cce671ca2bc4d12d436f56e38a2c16 @gyst gyst committed Nov 21, 2012
View
@@ -1,3 +1,12 @@
+Changelog
+=========
+
+0.4.2 (unreleased)
+------------------
+
+* Added Spanish translation. [macagua]
+* Added improvements about i18n support. [macagua]
+
0.4.1 (2012-10-09)
------------------
View
@@ -1 +1,3 @@
Guido Stevens, Author
+
+Leonardo J. Caballero G.
@@ -1,8 +1,8 @@
-<ul id="plonesocialsuite-navigation">
- <li><a tal:attributes="href string:${view/portal_url}/@@stream">
+<ul id="plonesocialsuite-navigation" i18n:domain="plonesocial.suite">
+ <li><a tal:attributes="href string:${view/portal_url}/@@stream" i18n:translate="">
network updates</a></li>
- <li><a tal:attributes="href string:${view/portal_url}/@@stream/explore">
+ <li><a tal:attributes="href string:${view/portal_url}/@@stream/explore" i18n:translate="">
explore</a></li>
- <li><a tal:attributes="href string:${view/portal_url}/@@profile">
+ <li><a tal:attributes="href string:${view/portal_url}/@@profile" i18n:translate="">
my profile</a></li>
</ul>
@@ -5,6 +5,7 @@
i18n_domain="plonesocial.suite">
<five:registerPackage package="." initialize=".initialize" />
+ <i18n:registerTranslations directory="locales" />
<include package=".browser" />
<include file="profiles.zcml" />
@@ -0,0 +1,52 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"POT-Creation-Date: 2012-11-21 04:32+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"
+
+#: ./profiles/default/portlets.xml
+msgid "Activity Stream"
+msgstr ""
+
+#: ./configure.zcml:
+msgid "Creates fake user profiles and microblog posts"
+msgstr ""
+
+#: ./configure.zcml:
+msgid "Installs the suite of all plonesocial packages"
+msgstr ""
+
+#: ./profiles/default/portlets.xml
+msgid "Microblog"
+msgstr ""
+
+#: ./configure.zcml:
+msgid "PloneSocial Suite"
+msgstr ""
+
+#: ./configure.zcml:
+msgid "PloneSocial Suite (Demo)"
+msgstr ""
+
+#: ./browser/navigation.pt:4
+msgid "explore"
+msgstr ""
+
+#: ./browser/navigation.pt:6
+msgid "my profile"
+msgstr ""
+
+#: ./browser/navigation.pt:2
+msgid "network updates"
+msgstr ""
+
@@ -0,0 +1,55 @@
+# Leonardo J. Caballero G. <leonardocaballero@gmail.com>, 2012.
+msgid ""
+msgstr ""
+"Project-Id-Version: plonesocial.suite\n"
+"POT-Creation-Date: 2012-11-21 04:32+0000\n"
+"PO-Revision-Date: 2012-11-21 00:06-0430\n"
+"Last-Translator: Leonardo J. Caballero G. <leonardocaballero@gmail.com>\n"
+"Language-Team: Leonardo J. Caballero G.\n"
+"Language: es\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"X-Generator: Virtaal 0.7.1\n"
+"Language-Code: es\n"
+"Language-Name: Español\n"
+"Preferred-Encodings: utf-8 latin1\n"
+"Domain: plonesocial.suite\n"
+"X-Is-Fallback-For: es-ar es-bo es-cl es-co es-cr es-do es-ec es-es es-sv es-gt es-hn es-mx es-ni es-pa es-py es-pe es-pr es-us es-uy es-ve\n"
+
+#: ./profiles/default/portlets.xml
+msgid "Activity Stream"
+msgstr "Actividad reciente"
+
+#: ./configure.zcml:
+msgid "Creates fake user profiles and microblog posts"
+msgstr "Crea perfiles falsos de usuarios y los tweet en sus microblogs"
+
+#: ./configure.zcml:
+msgid "Installs the suite of all plonesocial packages"
+msgstr "Instala la suite de todos los paquetes plonesocial"
+
+#: ./profiles/default/portlets.xml
+msgid "Microblog"
+msgstr "Microblog"
+
+#: ./configure.zcml:
+msgid "PloneSocial Suite"
+msgstr "PloneSocial - Suite"
+
+#: ./configure.zcml:
+msgid "PloneSocial Suite (Demo)"
+msgstr "PloneSocial - Suite (Demostración)"
+
+#: ./browser/navigation.pt:4
+msgid "explore"
+msgstr "explorar"
+
+#: ./browser/navigation.pt:6
+msgid "my profile"
+msgstr "mi perfil"
+
+#: ./browser/navigation.pt:2
+msgid "network updates"
+msgstr "actualizaciones de red"
@@ -0,0 +1,35 @@
+# --- 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: 2012-11-21 04:26+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: plonesocial.suite\n"
+
+#: ./configure.zcml:
+msgid "PloneSocial Suite"
+msgstr ""
+
+#: ./configure.zcml:
+msgid "Installs the suite of all plonesocial packages"
+msgstr ""
+
+#: ./configure.zcml:
+msgid "PloneSocial Suite (Demo)"
+msgstr ""
+
+#: ./configure.zcml:
+msgid "Creates fake user profiles and microblog posts"
+msgstr ""
+
@@ -0,0 +1,52 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"POT-Creation-Date: 2012-11-21 04:32+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"
+
+#: ./profiles/default/portlets.xml
+msgid "Activity Stream"
+msgstr ""
+
+#: ./configure.zcml:
+msgid "Creates fake user profiles and microblog posts"
+msgstr ""
+
+#: ./configure.zcml:
+msgid "Installs the suite of all plonesocial packages"
+msgstr ""
+
+#: ./profiles/default/portlets.xml
+msgid "Microblog"
+msgstr ""
+
+#: ./configure.zcml:
+msgid "PloneSocial Suite"
+msgstr ""
+
+#: ./configure.zcml:
+msgid "PloneSocial Suite (Demo)"
+msgstr ""
+
+#: ./browser/navigation.pt:4
+msgid "explore"
+msgstr ""
+
+#: ./browser/navigation.pt:6
+msgid "my profile"
+msgstr ""
+
+#: ./browser/navigation.pt:2
+msgid "network updates"
+msgstr ""
+
@@ -0,0 +1,55 @@
+# --- 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: 2012-11-21 04:32+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: plonesocial.suite\n"
+
+#: ./profiles/default/portlets.xml
+msgid "Activity Stream"
+msgstr ""
+
+#: ./configure.zcml:
+msgid "Creates fake user profiles and microblog posts"
+msgstr ""
+
+#: ./configure.zcml:
+msgid "Installs the suite of all plonesocial packages"
+msgstr ""
+
+#: ./profiles/default/portlets.xml
+msgid "Microblog"
+msgstr ""
+
+#: ./configure.zcml:
+msgid "PloneSocial Suite"
+msgstr ""
+
+#: ./configure.zcml:
+msgid "PloneSocial Suite (Demo)"
+msgstr ""
+
+#: ./browser/navigation.pt:4
+msgid "explore"
+msgstr ""
+
+#: ./browser/navigation.pt:6
+msgid "my profile"
+msgstr ""
+
+#: ./browser/navigation.pt:2
+msgid "network updates"
+msgstr ""
+
@@ -11,6 +11,7 @@
directory="profiles/default"
description="Installs the suite of all plonesocial packages"
provides="Products.GenericSetup.interfaces.EXTENSION"
+ i18n:attributes="title; description"
/>
<genericsetup:importStep
@@ -25,6 +26,7 @@
directory="profiles/demo"
description="Creates fake user profiles and microblog posts"
provides="Products.GenericSetup.interfaces.EXTENSION"
+ i18n:attributes="title; description"
/>
<genericsetup:importStep
@@ -1,17 +1,19 @@
<?xml version="1.0"?>
-<portlets>
+<portlets
+ xmlns:i18n="http://xml.zope.org/namespaces/i18n"
+ i18n:domain="plonesocial.suite">
<assignment name="microblog" category="context" key="/"
manager="plonesocial.activitystream.portletmanager"
type="plonesocial.microblog.portlet" visible="True">
<property name="compact">True</property>
- <property name="title">Microblog</property>
+ <property name="title" i18n:translate="">Microblog</property>
</assignment>
<assignment name="activity-stream" category="context" key="/"
manager="plonesocial.activitystream.portletmanager"
type="plonesocial.activitystream.portlet" visible="True">
<property name="count">5</property>
<property name="compact">True</property>
- <property name="title">Activity Stream</property>
+ <property name="title" i18n:translate="">Activity Stream</property>
</assignment>
</portlets>
@@ -0,0 +1,50 @@
+#!/bin/sh
+#
+# Shell script to manage .po files.
+#
+# Run this file in the folder main __init__.py of product
+#
+# E.g. if your product is yourproduct.name
+# you run this file in yourproduct.name/yourproduct/name
+#
+#
+# Copyright 2009 Twinapex Research http://www.twinapex.com
+#
+
+# Assume the product name is the current folder name
+CURRENT_PATH=`pwd`
+CATALOGNAME="plonesocial.suite"
+
+# List of languages
+LANGUAGES="en nl es"
+
+# Create locales folder structure for languages
+install -d locales
+for lang in $LANGUAGES; do
+ install -d locales/$lang/LC_MESSAGES
+done
+
+# Rebuild .pot
+i18ndude rebuild-pot --pot locales/$CATALOGNAME.pot --merge locales/manual.pot --create $CATALOGNAME .
+
+# Compile po files
+for lang in $(find locales -mindepth 1 -maxdepth 1 -type d); do
+
+ if test -d $lang/LC_MESSAGES; then
+
+ PO=$lang/LC_MESSAGES/${CATALOGNAME}.po
+
+ # Create po file if not exists
+ touch $PO
+
+ # Sync po file
+ echo "Syncing $PO"
+ i18ndude sync --pot locales/$CATALOGNAME.pot $PO
+
+ # Compile .po to .mo
+ MO=$lang/LC_MESSAGES/${CATALOGNAME}.mo
+ echo "Compiling $MO"
+ msgfmt -o $MO $lang/LC_MESSAGES/${CATALOGNAME}.po
+ fi
+done
+

0 comments on commit 4b26acb

Please sign in to comment.