Skip to content

Commit

Permalink
lingua only
Browse files Browse the repository at this point in the history
  • Loading branch information
rnixx committed Jul 30, 2014
1 parent a58edd0 commit b5b6d3e
Show file tree
Hide file tree
Showing 7 changed files with 95 additions and 98 deletions.
24 changes: 0 additions & 24 deletions i18n.rst

This file was deleted.

54 changes: 52 additions & 2 deletions i18n.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,54 @@
#!/bin/bash
# Author: Robert Niederreiter <rnix@squarewave.at>
# License: no license
# Date: 2014-07-20
#
# Requirements:
# - python lingua (sudo pip install lingua)
# - gettext
#
# Usage:
# Initial catalog creation (lang is the language identifier):
# ./i18n.sh lang
# Updating translation and compile catalog:
# ./i18n.sh

python setup.py extract_messages
python setup.py update_catalog
# configuration
DOMAIN="yafowil.widget.image"
SEACH_PATH=src/yafowil/widget/image
LOCALES_PATH=src/yafowil/widget/image/locales
# end configuration

# create locales folder if not exists
if [ ! -d "$LOCALES_PATH" ]; then
echo "Locales directory not exists, create"
mkdir -p $LOCALES_PATH
fi

# create pot if not exists
if [ ! -f $LOCALES_PATH/$DOMAIN.pot ]; then
echo "Create pot file"
touch $LOCALES_PATH/$DOMAIN.pot
fi

# no arguments, extract and update
if [ $# -eq 0 ]; then
echo "Extract messages"
pot-create $SEACH_PATH -o $LOCALES_PATH/$DOMAIN.pot

echo "Update translations"
for po in $LOCALES_PATH/*/LC_MESSAGES/$DOMAIN.po; do
msgmerge -o $po $po $LOCALES_PATH/$DOMAIN.pot
done

echo "Compile message catalogs"
for po in $LOCALES_PATH/*/LC_MESSAGES/*.po; do
msgfmt -o ${po%.*}.mo $po
done

# first argument represents language identifier, create catalog
else
cd $LOCALES_PATH
mkdir -p $1/LC_MESSAGES
msginit -i $DOMAIN.pot -o $1/LC_MESSAGES/$DOMAIN.po -l $1
fi
20 changes: 0 additions & 20 deletions setup.cfg

This file was deleted.

5 changes: 0 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@
test=tests_require,
),
test_suite="yafowil.widget.image.tests.test_suite",
message_extractors = {
'.': [
('**.py', 'lingua_python', None),
]
},
entry_points="""
[yafowil.plugin]
register = yafowil.widget.image:register
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,55 +9,55 @@ msgid ""
msgstr ""
"Project-Id-Version: yafowil.widget.image 1.2dev\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2014-04-30 19:35+0200\n"
"POT-Creation-Date: 2014-07-30 12:31+0200\n"
"PO-Revision-Date: 2014-04-30 19:31+0200\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: de <LL@li.org>\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"Generated-By: Babel 1.3\n"

#. Default: Uploaded file is not an image.
#: src/yafowil/widget/image/widget.py:61
#: src/yafowil/widget/image/widget.py:64
msgid "file_not_an_image"
msgstr "Datei ist kein Bild"

#. Default: Uploaded image not of type ${type}
#: src/yafowil/widget/image/widget.py:67
#: src/yafowil/widget/image/widget.py:70
msgid "file_invalid_type"
msgstr "Datei ist nich vom Typ ${type}"

#. Default: Image must have a size of ${width} x ${height} pixel
#: src/yafowil/widget/image/widget.py:97
#: src/yafowil/widget/image/widget.py:100
msgid "exact_image_size_required"
msgstr "Bild muss ${width} x ${height} Pixel groß sein"

#. Default: Image must have a minimum size of ${width} x ${height} pixel
#: src/yafowil/widget/image/widget.py:107
#: src/yafowil/widget/image/widget.py:110
msgid "minimum_image_size_required"
msgstr "Bild muss mindestens ${width} x ${height} Pixel groß sein"

#. Default: Image must have a maximum size of ${width} x ${height} pixel
#: src/yafowil/widget/image/widget.py:117
#: src/yafowil/widget/image/widget.py:120
msgid "maximum_image_size_required"
msgstr "Bild darf maximal ${width} x ${height} Pixel groß sein"

#. Default: Image must have a resolution of ${width} x ${height} DPI
#: src/yafowil/widget/image/widget.py:138
#: src/yafowil/widget/image/widget.py:141
msgid "exact_image_dpi_required"
msgstr "Bild muss eine Druckauflösung von ${width} x ${height} DPI haben"

#. Default: Image must have at least ${width} x ${height} DPI
#: src/yafowil/widget/image/widget.py:148
#: src/yafowil/widget/image/widget.py:151
msgid "minimum_image_dpi_required"
msgstr ""
"Bild muss mindestens eine Druckauflösung von ${width} x ${height} DPI "
"haben"
"Bild muss mindestens eine Druckauflösung von ${width} x ${height} DPI haben"

#. Default: Image must have a maximum of ${width} x ${height} DPI
#: src/yafowil/widget/image/widget.py:158
#: src/yafowil/widget/image/widget.py:161
msgid "maximum_image_dpi_required"
msgstr "Bild darf maximal eine Druckauflösung von ${width} x ${height} DPI haben"

msgstr ""
"Bild darf maximal eine Druckauflösung von ${width} x ${height} DPI haben"
Original file line number Diff line number Diff line change
Expand Up @@ -9,53 +9,53 @@ msgid ""
msgstr ""
"Project-Id-Version: yafowil.widget.image 1.2dev\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2014-04-30 19:35+0200\n"
"POT-Creation-Date: 2014-07-30 12:31+0200\n"
"PO-Revision-Date: 2014-04-30 19:31+0200\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: en <LL@li.org>\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"Generated-By: Babel 1.3\n"

#. Default: Uploaded file is not an image.
#: src/yafowil/widget/image/widget.py:61
#: src/yafowil/widget/image/widget.py:64
msgid "file_not_an_image"
msgstr "Uploaded file is not an image."

#. Default: Uploaded image not of type ${type}
#: src/yafowil/widget/image/widget.py:67
#: src/yafowil/widget/image/widget.py:70
msgid "file_invalid_type"
msgstr "Uploaded image not of type ${type}"

#. Default: Image must have a size of ${width} x ${height} pixel
#: src/yafowil/widget/image/widget.py:97
#: src/yafowil/widget/image/widget.py:100
msgid "exact_image_size_required"
msgstr "Image must have a size of ${width} x ${height} pixel"

#. Default: Image must have a minimum size of ${width} x ${height} pixel
#: src/yafowil/widget/image/widget.py:107
#: src/yafowil/widget/image/widget.py:110
msgid "minimum_image_size_required"
msgstr "Image must have a minimum size of ${width} x ${height} pixel"

#. Default: Image must have a maximum size of ${width} x ${height} pixel
#: src/yafowil/widget/image/widget.py:117
#: src/yafowil/widget/image/widget.py:120
msgid "maximum_image_size_required"
msgstr "Image must have a maximum size of ${width} x ${height} pixel"

#. Default: Image must have a resolution of ${width} x ${height} DPI
#: src/yafowil/widget/image/widget.py:138
#: src/yafowil/widget/image/widget.py:141
msgid "exact_image_dpi_required"
msgstr "Image must have a resolution of ${width} x ${height} DPI"

#. Default: Image must have at least ${width} x ${height} DPI
#: src/yafowil/widget/image/widget.py:148
#: src/yafowil/widget/image/widget.py:151
msgid "minimum_image_dpi_required"
msgstr "Image must have at least ${width} x ${height} DPI"

#. Default: Image must have a maximum of ${width} x ${height} DPI
#: src/yafowil/widget/image/widget.py:158
#: src/yafowil/widget/image/widget.py:161
msgid "maximum_image_dpi_required"
msgstr "Image must have a maximum of ${width} x ${height} DPI"

36 changes: 16 additions & 20 deletions src/yafowil/widget/image/locales/yafowil.widget.image.pot
Original file line number Diff line number Diff line change
@@ -1,60 +1,56 @@
# Translations template for yafowil.widget.image.
# Copyright (C) 2014 ORGANIZATION
# This file is distributed under the same license as the yafowil.widget.image
# project.
#
# SOME DESCRIPTIVE TITLE
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2014.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: yafowil.widget.image 1.2dev\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2014-04-30 19:35+0200\n"
"Project-Id-Version: PACKAGE 1.0\n"
"POT-Creation-Date: 2014-07-30 12:31+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\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-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 1.3\n"
"Language: \n"

#. Default: Uploaded file is not an image.
#: src/yafowil/widget/image/widget.py:61
#: ./src/yafowil/widget/image/widget.py:64
msgid "file_not_an_image"
msgstr ""

#. Default: Uploaded image not of type ${type}
#: src/yafowil/widget/image/widget.py:67
#: ./src/yafowil/widget/image/widget.py:70
msgid "file_invalid_type"
msgstr ""

#. Default: Image must have a size of ${width} x ${height} pixel
#: src/yafowil/widget/image/widget.py:97
#: ./src/yafowil/widget/image/widget.py:100
msgid "exact_image_size_required"
msgstr ""

#. Default: Image must have a minimum size of ${width} x ${height} pixel
#: src/yafowil/widget/image/widget.py:107
#: ./src/yafowil/widget/image/widget.py:110
msgid "minimum_image_size_required"
msgstr ""

#. Default: Image must have a maximum size of ${width} x ${height} pixel
#: src/yafowil/widget/image/widget.py:117
#: ./src/yafowil/widget/image/widget.py:120
msgid "maximum_image_size_required"
msgstr ""

#. Default: Image must have a resolution of ${width} x ${height} DPI
#: src/yafowil/widget/image/widget.py:138
#: ./src/yafowil/widget/image/widget.py:141
msgid "exact_image_dpi_required"
msgstr ""

#. Default: Image must have at least ${width} x ${height} DPI
#: src/yafowil/widget/image/widget.py:148
#: ./src/yafowil/widget/image/widget.py:151
msgid "minimum_image_dpi_required"
msgstr ""

#. Default: Image must have a maximum of ${width} x ${height} DPI
#: src/yafowil/widget/image/widget.py:158
#: ./src/yafowil/widget/image/widget.py:161
msgid "maximum_image_dpi_required"
msgstr ""

0 comments on commit b5b6d3e

Please sign in to comment.