Skip to content

Commit

Permalink
Adding i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
mpj17 committed Oct 29, 2014
1 parent a9012eb commit 0a2f92f
Show file tree
Hide file tree
Showing 11 changed files with 300 additions and 17 deletions.
3 changes: 2 additions & 1 deletion gs/search/topic/__init__.py
@@ -1,2 +1,3 @@
# -*- coding: utf-8 -*-
# This space intentionally left blank.
from zope.i18nmessageid import MessageFactory
GSMessageFactory = MessageFactory('gs.search.topic')
12 changes: 8 additions & 4 deletions gs/search/topic/browser/templates/link.pt
@@ -1,4 +1,8 @@
<link id="gs-search-topic-link"
rel="alternate" type="application/atom+xml" title="Topics"
href="/s/search.atom"
tal:attributes="title string:Topics on ${view/siteInfo/name}"/>
<link id="gs-search-topic-link"
xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
i18n:domain="gs.search.topic"
i18n:attributes="title;"
rel="alternate" type="application/atom+xml" title="Topics"
href="/s/search.atom"
tal:attributes="title string:Topics on ${view/siteInfo/name}"/>
20 changes: 13 additions & 7 deletions gs/search/topic/browser/templates/site-topics-ajax-hole.pt
@@ -1,23 +1,27 @@
<div id="gs-search-topic-site-home-search"
xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
i18n:domain="gs.search.topic"
class="gs-search search" role="application">
<div class="gs-search-entry search input-append"
role="search" aria-controls="gs-search-topic-site-home-latest">
<input type="search" name="s" placeholder="Search within topics&#8230;"
i18n:attributes="placeholder; title"
autocomplete="on"
id="gs-search-topic-site-home-input" value=""
title="Search within topics"/>
<button id="gs-search-topic-site-home-search-button"
class="btn">Search</button>
i18n:translate="" class="btn">Search</button>
</div><!--gs-group-messages-topics-search-->
<p id="gs-search-topic-site-home-loading"
class="gs-search-loading" style="display:none;">
<span data-icon="&#xe619;" aria-hidden="true" class="loading"> </span>
Loading the topics&#8230;
<tal:block i18n:translate="">Loading the topics&#8230;</tal:block>
</p><!--gs-search-topic-site-home-loading-->
<p class="gs-search-failed">
<p class="gs-search-failed" i18n:translate="search-failed">
No topics were found.
</p><!--gs-search-failed-->
<p class="gs-search-empty muted">
<p class="gs-search-empty muted" i18n:translate="no-visible">
There are no visible topics on this site.
</p><!--gs-search-empty-->
<div id="gs-search-topic-site-home-latest"
Expand All @@ -29,24 +33,26 @@
<button id="gs-search-topic-site-home-toolbar-prev"
aria-controls="gs-search-topic-site-home-latest"
aria-flowto="gs-search-topic-site-home-toolbar-next"
data-icon="&#x25c3;"
data-icon="&#x25c3;" i18n:translate="newer"
class="btn gs-search-toolbar-previous">Newer</button>
<div id="gs-search-topic-site-home-tasks" role="navigation">
<ul class="inline-list">
<li>
<a type="application/atom+xml" class="alternateATOM icon-alone"
tal:define="title string:Posts in ${view/siteInfo/name};"
i18n:attributes="title"
href="/s/search.atom?t=0&amp;f=0&amp;p=1">
<span aria-hidden="true" data-icon="&#xe003;"></span>
<span class="screen-reader-text">Web feed</span>
<span class="screen-reader-text"
i18n:translate="web-feed">Web feed</span>
</a>
</li>
</ul>
</div><!--gs-search-topic-site-home-tasks-->
<button id="gs-search-topic-site-home-toolbar-next"
aria-controls="gs-search-topic-site-home-latest"
aria-flowto="gs-search-topic-site-home-tasks"
data-icon-after="&#x25b9;"
data-icon-after="&#x25b9;" i18n:translate="older"
class="btn gs-search-toolbar-next">Older</button>
</div><!--gs-search-topic-site-home-tasks-->
</div><!--gs-search-->
11 changes: 6 additions & 5 deletions gs/search/topic/configure.zcml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!-- Copyright © 2013, 2014 OnlineGroups.net and Contributors. -->
<!-- Copyright © 2012, 2013, 2014 OnlineGroups.net and Contributors. -->
<!-- All Rights Reserved. -->

<!-- This software is subject to the provisions of the Zope Public -->
Expand All @@ -12,19 +12,20 @@
<!-- FITNESS FOR A PARTICULAR PURPOSE. -->
<configure xmlns="http://namespaces.zope.org/zope"
xmlns:browser="http://namespaces.zope.org/browser"
i18n_domain="groupserver">
xmlns:i18n="http://namespaces.zope.org/i18n"
i18n_domain="gs.search.topic">

<i18n:registerTranslations directory="locales" />
<include package="zope.viewlet" file="meta.zcml" />

<!--The viewlet for the site homepage-->
<browser:viewlet
name="gs-search-topic-site-topics-ajax-hole"
manager="gs.site.home.interfaces.ISiteHomeActivity"
template="browser/templates/site-topics-ajax-hole.pt"
class="gs.viewlet.viewlet.SiteViewlet"
class=".viewlet.TopicSearchViewlet"
permission="zope2.View"
weight="10"
title="Topics" />
weight="10" />
<!--The JavaScript to hide the right-column if there are not topics-->
<browser:resource
name="gs-search-topic-site-homepage-20140314.js"
Expand Down
61 changes: 61 additions & 0 deletions gs/search/topic/locales/de/LC_MESSAGES/gs.search.topic.po
@@ -0,0 +1,61 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2014-10-29 00:30+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"

#: ./browser/templates/site-topics-ajax-hole.pt:19
msgid "Loading the topics&#8230;"
msgstr ""

#: ./browser/templates/site-topics-ajax-hole.pt:13
msgid "Search"
msgstr ""

#: ./browser/templates/site-topics-ajax-hole.pt:8
msgid "Search within topics"
msgstr ""

#: ./browser/templates/site-topics-ajax-hole.pt:8
msgid "Search within topics…"
msgstr ""

#: ./viewlet.py:22
msgid "Topics"
msgstr ""

#. Default: "Newer"
#: ./browser/templates/site-topics-ajax-hole.pt:33
msgid "newer"
msgstr ""

#. Default: "There are no visible topics on this site."
#: ./browser/templates/site-topics-ajax-hole.pt:24
msgid "no-visible"
msgstr ""

#. Default: "Older"
#: ./browser/templates/site-topics-ajax-hole.pt:52
msgid "older"
msgstr ""

#. Default: "No topics were found."
#: ./browser/templates/site-topics-ajax-hole.pt:21
msgid "search-failed"
msgstr ""

#. Default: "Web feed"
#: ./browser/templates/site-topics-ajax-hole.pt:46
msgid "web-feed"
msgstr ""

61 changes: 61 additions & 0 deletions gs/search/topic/locales/en/LC_MESSAGES/gs.search.topic.po
@@ -0,0 +1,61 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2014-10-29 00:30+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"

#: ./browser/templates/site-topics-ajax-hole.pt:19
msgid "Loading the topics&#8230;"
msgstr ""

#: ./browser/templates/site-topics-ajax-hole.pt:13
msgid "Search"
msgstr ""

#: ./browser/templates/site-topics-ajax-hole.pt:8
msgid "Search within topics"
msgstr ""

#: ./browser/templates/site-topics-ajax-hole.pt:8
msgid "Search within topics…"
msgstr ""

#: ./viewlet.py:22
msgid "Topics"
msgstr ""

#. Default: "Newer"
#: ./browser/templates/site-topics-ajax-hole.pt:33
msgid "newer"
msgstr ""

#. Default: "There are no visible topics on this site."
#: ./browser/templates/site-topics-ajax-hole.pt:24
msgid "no-visible"
msgstr ""

#. Default: "Older"
#: ./browser/templates/site-topics-ajax-hole.pt:52
msgid "older"
msgstr ""

#. Default: "No topics were found."
#: ./browser/templates/site-topics-ajax-hole.pt:21
msgid "search-failed"
msgstr ""

#. Default: "Web feed"
#: ./browser/templates/site-topics-ajax-hole.pt:46
msgid "web-feed"
msgstr ""

Binary file not shown.
61 changes: 61 additions & 0 deletions gs/search/topic/locales/fr/LC_MESSAGES/gs.search.topic.po
@@ -0,0 +1,61 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2014-10-29 00:30+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"

#: ./browser/templates/site-topics-ajax-hole.pt:19
msgid "Loading the topics&#8230;"
msgstr "Chargement&#8230;"

#: ./browser/templates/site-topics-ajax-hole.pt:13
msgid "Search"
msgstr "Recherche"

#: ./browser/templates/site-topics-ajax-hole.pt:8
msgid "Search within topics"
msgstr "Recherche dans nos sujets"

#: ./browser/templates/site-topics-ajax-hole.pt:8
msgid "Search within topics…"
msgstr "Recherche dans sujets…"

#: ./viewlet.py:22
msgid "Topics"
msgstr "Des sujets"

#. Default: "Newer"
#: ./browser/templates/site-topics-ajax-hole.pt:33
msgid "newer"
msgstr "Récent"

#. Default: "There are no visible topics on this site."
#: ./browser/templates/site-topics-ajax-hole.pt:24
msgid "no-visible"
msgstr "Il n'y à pas des sujets visable"

#. Default: "Older"
#: ./browser/templates/site-topics-ajax-hole.pt:52
msgid "older"
msgstr "Vieux"

#. Default: "No topics were found."
#: ./browser/templates/site-topics-ajax-hole.pt:21
msgid "search-failed"
msgstr "Il n'y à pas des sujets."

#. Default: "Web feed"
#: ./browser/templates/site-topics-ajax-hole.pt:46
msgid "web-feed"
msgstr ""

64 changes: 64 additions & 0 deletions gs/search/topic/locales/gs.search.topic.pot
@@ -0,0 +1,64 @@
# --- 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: 2014-10-29 00:30+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: gs.search.topic\n"

#: ./browser/templates/site-topics-ajax-hole.pt:19
msgid "Loading the topics&#8230;"
msgstr ""

#: ./browser/templates/site-topics-ajax-hole.pt:13
msgid "Search"
msgstr ""

#: ./browser/templates/site-topics-ajax-hole.pt:8
msgid "Search within topics"
msgstr ""

#: ./browser/templates/site-topics-ajax-hole.pt:8
msgid "Search within topics…"
msgstr ""

#: ./viewlet.py:22
msgid "Topics"
msgstr ""

#. Default: "Newer"
#: ./browser/templates/site-topics-ajax-hole.pt:33
msgid "newer"
msgstr ""

#. Default: "There are no visible topics on this site."
#: ./browser/templates/site-topics-ajax-hole.pt:24
msgid "no-visible"
msgstr ""

#. Default: "Older"
#: ./browser/templates/site-topics-ajax-hole.pt:52
msgid "older"
msgstr ""

#. Default: "No topics were found."
#: ./browser/templates/site-topics-ajax-hole.pt:21
msgid "search-failed"
msgstr ""

#. Default: "Web feed"
#: ./browser/templates/site-topics-ajax-hole.pt:46
msgid "web-feed"
msgstr ""

22 changes: 22 additions & 0 deletions gs/search/topic/viewlet.py
@@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
############################################################################
#
# Copyright © 2014 OnlineGroups.net and Contributors.
# 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.
#
############################################################################
from __future__ import absolute_import, unicode_literals
from gs.viewlet.viewlet import SiteViewlet
from . import GSMessageFactory as _


class TopicSearchViewlet(SiteViewlet):
'The viewlet for the "AJAX Hole"'
title = _('Topics')
2 changes: 2 additions & 0 deletions setup.py
Expand Up @@ -54,6 +54,8 @@
'setuptools',
'zope.browserpage',
'zope.browserresource',
'zope.i18n',
'zope.i18nmessageid',
'zope.tal',
'zope.tales',
'zope.viewlet',
Expand Down

0 comments on commit 0a2f92f

Please sign in to comment.