-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
95 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 16 additions & 20 deletions
36
src/yafowil/widget/image/locales/yafowil.widget.image.pot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 "" | ||
|