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 ftwbook.graphicblock portal_type translation to plone domain and fix tests #12

Merged
merged 4 commits into from Jan 9, 2020
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/HISTORY.txt
Expand Up @@ -5,7 +5,7 @@ Changelog
3.1.1 (unreleased)
------------------

- Nothing changed yet.
- Add ftwbook.graphicblock portal_type translation to plone domain. [tinagerber]


3.1.0 (2019-12-10)
Expand Down
27 changes: 27 additions & 0 deletions ftwbook/graphicblock/configure.zcml
Expand Up @@ -3,11 +3,13 @@
xmlns:five="http://namespaces.zope.org/five"
xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
xmlns:i18n="http://namespaces.zope.org/i18n"
xmlns:profilehook="http://namespaces.zope.org/profilehook"
xmlns:zcml="http://namespaces.zope.org/zcml"
xmlns:upgrade-step="http://namespaces.zope.org/ftw.upgrade"
i18n_domain="ftwbook.graphicblock">

<include package="ftw.upgrade" file="meta.zcml" />
<include package="ftw.profilehook" />

<five:registerPackage package="." initialize=".initialize" />
<i18n:registerTranslations directory="locales" />
Expand All @@ -18,6 +20,7 @@
<include package=".latex" />

<genericsetup:registerProfile
zcml:condition="not-have plone-5"
name="default"
title="ftwbook.graphicblock"
directory="profiles/default"
Expand All @@ -26,13 +29,37 @@
/>

<genericsetup:registerProfile
zcml:condition="not-have plone-5"
name="uninstall"
title="Uninstall ftwbook.graphicblock"
directory="profiles/uninstall"
provides="Products.GenericSetup.interfaces.EXTENSION"
for="Products.CMFPlone.interfaces.IMigratingPloneSiteRoot"
/>

<genericsetup:registerProfile
zcml:condition="have plone-5"
name="default"
title="ftwbook.graphicblock"
directory="profiles/default_plone5"
description=""
provides="Products.GenericSetup.interfaces.EXTENSION"
/>

<genericsetup:registerProfile
zcml:condition="have plone-5"
name="uninstall"
title="Uninstall ftwbook.graphicblock"
directory="profiles/uninstall_plone5"
provides="Products.GenericSetup.interfaces.EXTENSION"
for="Products.CMFPlone.interfaces.IMigratingPloneSiteRoot"
/>

<profilehook:hook
profile="ftwbook.graphicblock:uninstall"
handler=".hooks.uninstalled"
/>

<upgrade-step:directory
profile="ftwbook.graphicblock:default"
directory="upgrades"
Expand Down
18 changes: 18 additions & 0 deletions ftwbook/graphicblock/hooks.py
@@ -0,0 +1,18 @@
from plone.registry.interfaces import IRegistry
from zope.component import getUtility
import pkg_resources


IS_PLONE_5 = pkg_resources.get_distribution('Products.CMFPlone').version >= '5'


def uninstalled(site):
if IS_PLONE_5:
clean_plone5_registry(site)


def clean_plone5_registry(site):
registry = getUtility(IRegistry)
types_not_searched = list(registry['plone.types_not_searched'])
types_not_searched.remove('ftwbook.graphicblock.GraphicBlock')
registry['plone.types_not_searched'] = tuple(types_not_searched)
16 changes: 16 additions & 0 deletions ftwbook/graphicblock/locales/de/LC_MESSAGES/plone.po
@@ -0,0 +1,16 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2020-01-08 17:37+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"
"Preferred-Encodings: utf-8 latin1\n"

msgid "ftwbook.graphicblock.GraphicBlock"
msgstr "Grafik Block"

16 changes: 16 additions & 0 deletions ftwbook/graphicblock/locales/en/LC_MESSAGES/plone.po
@@ -0,0 +1,16 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2020-01-08 17:37+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"
"Preferred-Encodings: utf-8 latin1\n"

msgid "ftwbook.graphicblock.GraphicBlock"
msgstr "Graphic Block"

18 changes: 18 additions & 0 deletions ftwbook/graphicblock/locales/plone.pot
@@ -0,0 +1,18 @@
# --- 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: 2020-01-08 17:37+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"
"Preferred-Encodings: utf-8 latin1\n"

msgid "ftwbook.graphicblock.GraphicBlock"
msgstr ""
9 changes: 4 additions & 5 deletions ftwbook/graphicblock/profiles/default_plone5/registry.xml
@@ -1,11 +1,10 @@
<?xml version="1.0"?>
<object name="portal_properties" meta_type="Plone Properties Tool">

<registry>
<record name="plone.types_not_searched"
interface="Products.CMFPlone.interfaces.controlpanel.ISearchSchema"
field="types_not_searched">
interface="Products.CMFPlone.interfaces.controlpanel.ISearchSchema"
field="types_not_searched">
<value purge="false">
<element>ftwbook.graphicblock.GraphicBlock</element>
</value>
</record>
</object>
</registry>
1 change: 1 addition & 0 deletions ftwbook/graphicblock/profiles/default_plone5/types.xml
@@ -1,3 +1,4 @@
<?xml version="1.0"?>
<object name="portal_types" meta_type="Plone Types Tool">

<object name="ftwbook.graphicblock.GraphicBlock" meta_type="Dexterity FTI" />
Expand Down
11 changes: 0 additions & 11 deletions ftwbook/graphicblock/profiles/uninstall_plone5/registry.xml

This file was deleted.