diff --git a/CHANGES.rst b/CHANGES.rst index 50c8278..ed3c519 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,12 +4,15 @@ Alterações 1.0.3 (unreleased) ^^^^^^^^^^^^^^^^^^ +* Adiciona internacionalização Português e Espanhol. + [dbarbato] + * Adiciona ação de regra de conteúdo para aplicação de termos - VCGE a conteúdos + VCGE a conteúdos. [ericof] * Adiciona condição de regra de conteúdo baseada nos termos - VCGE + VCGE. [ericof] 1.0.2 (2014-02-28) diff --git a/README.rst b/README.rst index 3f306bc..c48006d 100644 --- a/README.rst +++ b/README.rst @@ -39,6 +39,15 @@ Este produto utiliza um arquivo `SKOS W3C para representar vocabulários controlados, dentre outras estruturas de classificação. +Versionamento +--------------------- + +As versões 1.x deste pacote se referem ao VCGE 1.0 + +As versões 2.x deste pacote se referem ao VCGE 2.0. + +Ainda não existe um caminho de migração de termos do VCGE 1.0 para o VCGE 2.0, portanto utilize o VCGE 2.0 apenas em **novos** projetos. + Estado deste pacote --------------------- diff --git a/src/brasil/gov/vcge/__init__.py b/src/brasil/gov/vcge/__init__.py index b2513b7..e8693af 100644 --- a/src/brasil/gov/vcge/__init__.py +++ b/src/brasil/gov/vcge/__init__.py @@ -1,5 +1,4 @@ -# -*- coding:utf-8 -*- -from zope.i18nmessageid import MessageFactory as BaseMessageFactory +# -*- coding: utf-8 -*- +from zope.i18nmessageid import MessageFactory - -MessageFactory = BaseMessageFactory('brasil.gov.vcge') +_ = MessageFactory('brasil.gov.vcge') diff --git a/src/brasil/gov/vcge/at/extender.py b/src/brasil/gov/vcge/at/extender.py index 148e4f8..e826de8 100644 --- a/src/brasil/gov/vcge/at/extender.py +++ b/src/brasil/gov/vcge/at/extender.py @@ -1,10 +1,10 @@ # -*- coding:utf-8 -*- +from Products.Archetypes import public as atapi +from Products.Archetypes.interfaces import IBaseContent from archetypes.schemaextender.field import ExtensionField from archetypes.schemaextender.interfaces import IBrowserLayerAwareExtender -from brasil.gov.vcge import MessageFactory as _ +from brasil.gov.vcge import _ as _ from brasil.gov.vcge.interfaces import IVCGEInstalado -from Products.Archetypes import public as atapi -from Products.Archetypes.interfaces import IBaseContent from raptus.autocompletewidget.widget import AutocompleteMultiSelectionWidget from zope.component import adapts from zope.interface import implements diff --git a/src/brasil/gov/vcge/browser/templates/vcge.pt b/src/brasil/gov/vcge/browser/templates/vcge.pt index 464208b..cb2d70c 100644 --- a/src/brasil/gov/vcge/browser/templates/vcge.pt +++ b/src/brasil/gov/vcge/browser/templates/vcge.pt @@ -3,7 +3,7 @@ class="documentByLine" tal:define="categories view/skos|nothing;" tal:condition="categories"> - Assunto(s): + Subject(s): \n" "Language-Team: PloneGov.Br \n" @@ -14,11 +14,92 @@ msgstr "" "Preferred-Encodings: utf-8 latin1\n" "Domain: DOMAIN\n" -#: ../extender.py:37 +#: ../contentrules/condition.py:21 +msgid "A VGCE condition performs a content rule only if one of the selected terms is present. If no term is selected, the rule will be implemented only in content without VCGE terms applied." +msgstr "" + +#: ../contentrules/action.py:97 +msgid "Add VCGE action to the content rule" +msgstr "" + +#: ../contentrules/condition.py:89 +msgid "Add VCGE condition" +msgstr "" + +#: ../contentrules/action.py:23 +msgid "An action that applies VGCE terms to content" +msgstr "" + +#: ../contentrules/action.py:58 +msgid "Applies folder terms to content." +msgstr "" + +#: ../contentrules/action.py:60 +msgid "Applies the terms ${skos}" +msgstr "" + +#: ../contentrules/action.py:21 +msgid "Configure the action" +msgstr "" + +#: ../contentrules/condition.py:19 +msgid "Configure the condition" +msgstr "" + +#: ../contentrules/action.py:111 +msgid "Edit VCGE action on the content rule" +msgstr "" + +#: ../contentrules/condition.py:104 +msgid "Edit condition VCGE" +msgstr "" + +#: ../profiles/default/registry.xml +#: ../upgrades/v2000/profile/registry.xml +msgid "Metadata" +msgstr "" + +#: ../contentrules/condition.py:51 +msgid "No terms selected" +msgstr "" + +#: ../contentrules/action.py:32 +msgid "Select this option to have the VCGE terms inherited from the folder that holds the content. Selecting this option ignores the terms of the field below." +msgstr "" + +#: ../browser/templates/vcge.pt:6 +msgid "Subject(s):" +msgstr "" + +#: ../contentrules/action.py:39 +msgid "Terms to be applied to the content." +msgstr "" + +#: ../contentrules/condition.py:33 +msgid "Terms to be searched. Leave blank to select content with no VCGE term applied." +msgstr "" + +#: ../contentrules/action.py:31 +msgid "Use folder terms" +msgstr "" + +#: ../at/extender.py:39 +#: ../contentrules/action.py:38 +#: ../contentrules/condition.py:32 msgid "VCGE" msgstr "" -#: ../extender.py:38 +#: ../contentrules/condition.py:53 +msgid "VCGE contains ${skos}" +msgstr "" + +#: ../profiles/default/registry.xml +#: ../upgrades/v2000/profile/registry.xml +msgid "Vocabulario Controlado do Governo Eletronico" +msgstr "" + +#: ../at/extender.py:40 +#: ../dx/behaviors.py:26 msgid "vcge_desc" msgstr "" diff --git a/src/brasil/gov/vcge/locales/es/LC_MESSAGES/brasil.gov.vcge.po b/src/brasil/gov/vcge/locales/es/LC_MESSAGES/brasil.gov.vcge.po new file mode 100644 index 0000000..fc192a1 --- /dev/null +++ b/src/brasil/gov/vcge/locales/es/LC_MESSAGES/brasil.gov.vcge.po @@ -0,0 +1,107 @@ +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2014-11-07 16:52+0000\n" +"PO-Revision-Date: 2014-11-06 15:40-0200\n" +"Last-Translator: Danilo Sartorelli Barbato \n" +"Language-Team: PloneGov.Br \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" +"Language-Code: es\n" +"Language-Name: Español\n" +"Preferred-Encodings: utf-8 latin1\n" +"Domain: brasil.gov.vcge\n" +"Language: es\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" + +#: ../contentrules/condition.py:21 +msgid "A VGCE condition performs a content rule only if one of the selected terms is present. If no term is selected, the rule will be implemented only in content without VCGE terms applied." +msgstr "Una condición VGCE realiza una regla de contenido sólo si uno de los términos seleccionados está presente. Si no se selecciona ningún plazo, la regla se aplicará sólo en el contenido sin términos VCGE aplican." + +#: ../contentrules/action.py:97 +msgid "Add VCGE action to the content rule" +msgstr "Añadir acción VCGE a la regla de contenido" + +#: ../contentrules/condition.py:89 +msgid "Add VCGE condition" +msgstr "Añadir condición VCGE" + +#: ../contentrules/action.py:23 +msgid "An action that applies VGCE terms to content" +msgstr "Una acción que se aplica términos VGCE al contenido" + +#: ../contentrules/action.py:58 +msgid "Applies folder terms to content." +msgstr "Aplica términos de carpetas a contenido." + +#: ../contentrules/action.py:60 +msgid "Applies the terms ${skos}" +msgstr "Aplica los términos ${skos}" + +#: ../contentrules/action.py:21 +msgid "Configure the action" +msgstr "Configure la acción" + +#: ../contentrules/condition.py:19 +msgid "Configure the condition" +msgstr "Configure la condición" + +#: ../contentrules/action.py:111 +msgid "Edit VCGE action on the content rule" +msgstr "Editar acción VCGE en la regla de contenido" + +#: ../contentrules/condition.py:104 +msgid "Edit condition VCGE" +msgstr "Editar condición VCGE" + +#: ../profiles/default/registry.xml +#: ../upgrades/v2000/profile/registry.xml +msgid "Metadata" +msgstr "" + +#: ../contentrules/condition.py:51 +msgid "No terms selected" +msgstr "Ningún término seleccionado" + +#: ../contentrules/action.py:32 +msgid "Select this option to have the VCGE terms inherited from the folder that holds the content. Selecting this option ignores the terms of the field below." +msgstr "Seleccione esta opción para los términos VCGE que se heredan de la carpeta que contiene el contenido. Al seleccionar esta opción ignora los términos del campo de abajo." + +#: ../browser/templates/vcge.pt:6 +msgid "Subject(s):" +msgstr "Asunto(s):" + +#: ../contentrules/action.py:39 +msgid "Terms to be applied to the content." +msgstr "Condiciones que han de aplicarse a los contenidos." + +#: ../contentrules/condition.py:33 +msgid "Terms to be searched. Leave blank to select content with no VCGE term applied." +msgstr "Condiciones para ser buscados. Dejar en blanco para seleccionar el contenido sin término VCGE aplicado." + +#: ../contentrules/action.py:31 +msgid "Use folder terms" +msgstr "Utilice términos de carpetas" + +#: ../at/extender.py:39 +#: ../contentrules/action.py:38 +#: ../contentrules/condition.py:32 +msgid "VCGE" +msgstr "" + +#: ../contentrules/condition.py:53 +msgid "VCGE contains ${skos}" +msgstr "VCGE contiene ${skos}" + +#: ../profiles/default/registry.xml +#: ../upgrades/v2000/profile/registry.xml +msgid "Vocabulario Controlado do Governo Eletronico" +msgstr "Vocabulario Controlado para Gobierno Electrónico" + +#: ../at/extender.py:40 +#: ../dx/behaviors.py:26 +msgid "vcge_desc" +msgstr "Vocabulario Controlado para Gobierno Electrónico: Será presentado al escribir un vocabulario entradas plazo que contienen este término." + diff --git a/src/brasil/gov/vcge/locales/pt_BR/LC_MESSAGES/brasil.gov.vcge.po b/src/brasil/gov/vcge/locales/pt_BR/LC_MESSAGES/brasil.gov.vcge.po index 73b4194..78396f5 100644 --- a/src/brasil/gov/vcge/locales/pt_BR/LC_MESSAGES/brasil.gov.vcge.po +++ b/src/brasil/gov/vcge/locales/pt_BR/LC_MESSAGES/brasil.gov.vcge.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: brasil.gov.vcge\n" -"POT-Creation-Date: 2013-03-07 00:46+0000\n" +"POT-Creation-Date: 2014-11-07 16:52+0000\n" "PO-Revision-Date: 2012-09-18 23:00+0000\n" "Last-Translator: PloneGov.Br \n" "Language-Team: PloneGov.Br \n" @@ -14,11 +14,92 @@ msgstr "" "Preferred-Encodings: utf-8 latin1\n" "Domain: brasil.gov.vcge\n" -#: ../extender.py:37 +#: ../contentrules/condition.py:21 +msgid "A VGCE condition performs a content rule only if one of the selected terms is present. If no term is selected, the rule will be implemented only in content without VCGE terms applied." +msgstr "Uma condição VGCE executa uma regra de conteúdo apenas se um dos termos selecionados estiver presente. Caso nenhum termo seja selecionado a regra será executada apenas em conteúdos semtermos VCGE aplicados." + +#: ../contentrules/action.py:97 +msgid "Add VCGE action to the content rule" +msgstr "Adicionar ação VCGE na regra de conteúdo" + +#: ../contentrules/condition.py:89 +msgid "Add VCGE condition" +msgstr "Adicionar condição VCGE" + +#: ../contentrules/action.py:23 +msgid "An action that applies VGCE terms to content" +msgstr "Uma ação que aplica termos do VGCE a um conteúdo" + +#: ../contentrules/action.py:58 +msgid "Applies folder terms to content." +msgstr "Aplica termos da pasta no conteúdo." + +#: ../contentrules/action.py:60 +msgid "Applies the terms ${skos}" +msgstr "Aplica os termos ${skos}" + +#: ../contentrules/action.py:21 +msgid "Configure the action" +msgstr "Configurar a ação" + +#: ../contentrules/condition.py:19 +msgid "Configure the condition" +msgstr "Configurar a condição" + +#: ../contentrules/action.py:111 +msgid "Edit VCGE action on the content rule" +msgstr "Editar ação VCGE na regra de conteúdo" + +#: ../contentrules/condition.py:104 +msgid "Edit condition VCGE" +msgstr "Editar condição VCGE" + +#: ../profiles/default/registry.xml +#: ../upgrades/v2000/profile/registry.xml +msgid "Metadata" +msgstr "" + +#: ../contentrules/condition.py:51 +msgid "No terms selected" +msgstr "Nenhum termo selecionado" + +#: ../contentrules/action.py:32 +msgid "Select this option to have the VCGE terms inherited from the folder that holds the content. Selecting this option ignores the terms of the field below." +msgstr "Selecione esta opção para que os termos VCGE sejam herdados da pasta que abriga o conteúdo. Selecionar esta opção ignora os termos do campo a seguir." + +#: ../browser/templates/vcge.pt:6 +msgid "Subject(s):" +msgstr "Assunto(s):" + +#: ../contentrules/action.py:39 +msgid "Terms to be applied to the content." +msgstr "Termos a serem aplicados ao conteúdo." + +#: ../contentrules/condition.py:33 +msgid "Terms to be searched. Leave blank to select content with no VCGE term applied." +msgstr "Termos a serem procurados. Deixe em branco para selecionar conteúdos sem nenhum termo VCGE aplicado." + +#: ../contentrules/action.py:31 +msgid "Use folder terms" +msgstr "Utilizar os termos da pasta" + +#: ../at/extender.py:39 +#: ../contentrules/action.py:38 +#: ../contentrules/condition.py:32 msgid "VCGE" msgstr "VCGE" -#: ../extender.py:38 +#: ../contentrules/condition.py:53 +msgid "VCGE contains ${skos}" +msgstr "VCGE contém ${skos}" + +#: ../profiles/default/registry.xml +#: ../upgrades/v2000/profile/registry.xml +msgid "Vocabulario Controlado do Governo Eletronico" +msgstr "" + +#: ../at/extender.py:40 +#: ../dx/behaviors.py:26 msgid "vcge_desc" msgstr "Vocabulário Controlado do Governo Eletrônico: Ao digitar um termo serão apresentados os itens do vocabulário que contenham este termo." diff --git a/src/brasil/gov/vcge/tests/test_contentrules_action.py b/src/brasil/gov/vcge/tests/test_contentrules_action.py index 38f9093..7be744c 100644 --- a/src/brasil/gov/vcge/tests/test_contentrules_action.py +++ b/src/brasil/gov/vcge/tests/test_contentrules_action.py @@ -94,14 +94,14 @@ def test_summary_parent_vcge(self): e.same_as_parent = True self.assertEqual( e.summary, - u"Aplica termos da pasta no conteúdo." + u"Applies folder terms to content." ) def test_summary_with_vcge(self): from plone.app.contentrules import PloneMessageFactory as _ e = VCGEAction() e.skos = [self.term, ] - msg = _(u"Aplica os termos ${skos}", + msg = _(u"Applies the terms ${skos}", mapping=dict(skos=" or ".join(e.skos))) self.assertEqual( e.summary, diff --git a/src/brasil/gov/vcge/tests/test_contentrules_condition.py b/src/brasil/gov/vcge/tests/test_contentrules_condition.py index 2129648..7563736 100644 --- a/src/brasil/gov/vcge/tests/test_contentrules_condition.py +++ b/src/brasil/gov/vcge/tests/test_contentrules_condition.py @@ -78,13 +78,13 @@ def test_invoke_edit_view(self): def test_summary_empty_vcge(self): e = VCGECondition() - self.assertEqual(e.summary, u"Nenhum termo selecionado") + self.assertEqual(e.summary, u"No terms selected") def test_summary_with_vcge(self): from plone.app.contentrules import PloneMessageFactory as _ e = VCGECondition() e.skos = [self.term, ] - msg = _(u"VCGE contém ${skos}", + msg = _(u"VCGE contains ${skos}", mapping=dict(skos=" or ".join(e.skos))) self.assertEqual( e.summary, diff --git a/src/brasil/gov/vcge/utils.py b/src/brasil/gov/vcge/utils.py index cc0e41a..e4c75be 100644 --- a/src/brasil/gov/vcge/utils.py +++ b/src/brasil/gov/vcge/utils.py @@ -30,7 +30,7 @@ def parse_skos(data, format='xml'): oId = obj[0].toPython() title = unicode(obj[2]) lang = obj[2].language - if not oId in termos: + if oId not in termos: termos[oId] = {'title': u'', 'lang': u''} termos[oId]['title'] = title termos[oId]['lang'] = lang diff --git a/travis.cfg b/travis.cfg index 705d8fa..a43b2a5 100644 --- a/travis.cfg +++ b/travis.cfg @@ -10,6 +10,7 @@ extends = package-name = brasil.gov.vcge package-extras = [test, archetypes, dexterity] package-min-coverage = 86 +test-eggs = Pillow parts += createcoverage