AppStream: allow for translations

Fixes #211
This commit is contained in:
Ben Wiederhake 2016-01-07 23:24:53 +01:00
parent cc8873682a
commit 8779215927
5 changed files with 105 additions and 0 deletions

45
AppStream/Makefile Normal file
View file

@ -0,0 +1,45 @@
# This file is part of telegram-purple
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
#
# Copyright Ben Wiederhake 2016
# This file is NOT meant for inclusion into the main Makefile.
LOCALES=$(shell cat po/LINGUAS)
LOCALE_MOS=$(addprefix po/,$(addsuffix .mo,$(LOCALES)))
# Hardcoded, since this should only be run on very few machines anyway,
# which are expected to have msgfmt on their $PATH
MSGFMT_PATH=msgfmt
po/%.mo: po/%.po
${MSGFMT_PATH} -cf -o $@ $<
po/telegram-purple.metainfo.xml.pot: telegram-purple.metainfo.untranslated.xml as-metainfo.its
itstool -i as-metainfo.its -o $@ $<
# CAREFUL WHEN EDITING!
# "-j raw.xml *.mo" must be the last options!
telegram-purple.metainfo.xml: as-metainfo.its telegram-purple.metainfo.untranslated.xml $(LOCALE_MOS) po/LINGUAS
itstool -i as-metainfo.its -o $@ \
-j telegram-purple.metainfo.untranslated.xml $(LOCALE_MOS)
.PHONY: potfile
potfile: po/telegram-purple.metainfo.xml.pot
.PHONY: translate
translate: telegram-purple.metainfo.xml
all: translate

23
AppStream/as-metainfo.its Normal file
View file

@ -0,0 +1,23 @@
<!-- Copyright © 2012-2015 Matthias Klumpp.
This material may only be distributed subject to the terms and
conditions set forth in the GNU Free Documentation License (GFDL),
V1.2 with no invariant sections or later (the latest version is
presently available at http://www.gnu.org/licenses/fdl.txt).
This file bases on the "Quickstart Translation using itstool":
http://www.freedesktop.org/software/appstream/docs/sect-Quickstart-Translation.html
The copyright for the base transformer was found at:
http://www.freedesktop.org/software/appstream/docs/index.html
-->
<its:rules
xmlns:its="http://www.w3.org/2005/11/its"
version="1.0">
<its:translateRule translate="no" selector="/component"/>
<its:translateRule translate="yes"
selector="/component/name |
/component/summary |
/component/description |
/component/screenshots/screenshot/caption |
/component/developer_name"/>
</its:rules>

0
AppStream/po/LINGUAS Normal file
View file

View file

@ -0,0 +1,21 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2016-01-07 23:23+0100\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"
#. (itstool) path: component/name
#: telegram-purple.metainfo.untranslated.xml:9
msgid "Telegram"
msgstr ""
#. (itstool) path: component/summary
#: telegram-purple.metainfo.untranslated.xml:10
msgid "A plugin that adds support for Telegram"
msgstr ""

View file

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2015 Jiri Eischmann <eischmann@redhat.com>
It is very important that this file does *not* receive any
Invariant Sections as per GFDL.
-->
<component type="addon">
<id>telegram-purple</id>
<extends>pidgin.desktop</extends>
<name>Telegram</name>
<summary>A plugin that adds support for Telegram</summary>
<url type="homepage">https://github.com/majn/telegram-purple</url>
<url type="bugtracker">https://github.com/majn/telegram-purple/issues/</url>
<metadata_license>GFDL-1.3</metadata_license>
<project_license>GPL-2.0+</project_license>
<update_contact>eischmann_at_redhat.com</update_contact>
</component>