From: Mauro Scomparin Date: Tue, 10 Jul 2018 23:26:15 +0000 (+0200) Subject: looks like it works like this X-Git-Url: https://git.scompo.it/?a=commitdiff_plain;h=4ac0def80be4a2a16c5c0a17fafbc90c2587fdbe;p=money.git looks like it works like this --- diff --git a/money/money.py b/money/money.py index 472d29c..05f9974 100755 --- a/money/money.py +++ b/money/money.py @@ -2,9 +2,15 @@ from time import localtime, gmtime, strftime, strptime from os.path import expanduser, join, exists, abspath from pprint import pprint from decimal import * +from pkg_resources import resource_filename import json + import gettext -_ = gettext.gettext + +loc_dir = resource_filename('money', 'translations') +t = gettext.translation('money', localedir = loc_dir, fallback=True) +_ = t.gettext +t.install() DATA_FILE_NAME = 'dataFile' LAST_MOVEMENT_NUMBER = 'latestMovementsNumber' diff --git a/money/translations/it/LC_MESSAGES/money.mo b/money/translations/it/LC_MESSAGES/money.mo new file mode 100644 index 0000000..a8dacac Binary files /dev/null and b/money/translations/it/LC_MESSAGES/money.mo differ diff --git a/money/translations/it/LC_MESSAGES/money.po b/money/translations/it/LC_MESSAGES/money.po new file mode 100644 index 0000000..053e348 --- /dev/null +++ b/money/translations/it/LC_MESSAGES/money.po @@ -0,0 +1,66 @@ +# Translations for money template file. +# Copyright (C) 2018 Mauro Scomparin +# This file is distributed under the same license as the money package. +# Mauro Scomparin , 2018. +# +msgid "" +msgstr "" +"Project-Id-Version: money 1.0.1\n" +"Report-Msgid-Bugs-To: scompo@gmail.com\n" +"POT-Creation-Date: 2018-07-10 23:10+0200\n" +"PO-Revision-Date: 2018-07-10 23:17+0200\n" +"Last-Translator: \n" +"Language-Team: Italian\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: money/money.py:14 +msgid "type" +msgstr "tipo" + +#: money/money.py:15 +msgid "value" +msgstr "valore" + +#: money/money.py:16 +msgid "date" +msgstr "data" + +#: money/money.py:17 +msgid "hour" +msgstr "ora" + +#: money/money.py:18 +msgid "description" +msgstr "descrizione" + +#: money/money.py:24 +msgid "today" +msgstr "oggi" + +#: money/money.py:25 +msgid "now" +msgstr "adesso" + +#: money/money.py:97 +msgid "data file:" +msgstr "file dati:" + +#: money/money.py:196 +msgid "latest {} movements:" +msgstr "ultimi {} movimenti:" + +#: money/money.py:216 +msgid "actual value: {}" +msgstr "valore attuale: {}" + +#: money/money.py:217 +msgid "total incomes: {}" +msgstr "incassi totali: {}" + +#: money/money.py:218 +msgid "total expenses: {}" +msgstr "spese totali: {}" diff --git a/money/translations/money.pot b/money/translations/money.pot new file mode 100644 index 0000000..dfab6f2 --- /dev/null +++ b/money/translations/money.pot @@ -0,0 +1,66 @@ +# Translations for money template file. +# Copyright (C) 2018 Mauro Scomparin +# This file is distributed under the same license as the PACKAGE package. +# Mauro Scomparin , 2018. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: money 1.0.1\n" +"Report-Msgid-Bugs-To: scompo@gmail.com\n" +"POT-Creation-Date: 2018-07-10 23:10+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: money/money.py:14 +msgid "type" +msgstr "" + +#: money/money.py:15 +msgid "value" +msgstr "" + +#: money/money.py:16 +msgid "date" +msgstr "" + +#: money/money.py:17 +msgid "hour" +msgstr "" + +#: money/money.py:18 +msgid "description" +msgstr "" + +#: money/money.py:24 +msgid "today" +msgstr "" + +#: money/money.py:25 +msgid "now" +msgstr "" + +#: money/money.py:97 +msgid "data file:" +msgstr "" + +#: money/money.py:196 +msgid "latest {} movements:" +msgstr "" + +#: money/money.py:216 +msgid "actual value: {}" +msgstr "" + +#: money/money.py:217 +msgid "total incomes: {}" +msgstr "" + +#: money/money.py:218 +msgid "total expenses: {}" +msgstr "" diff --git a/po/money.pot b/po/money.pot deleted file mode 100644 index a17d549..0000000 --- a/po/money.pot +++ /dev/null @@ -1,70 +0,0 @@ -# Translations for money template file. -# Copyright (C) 2018 Mauro Scomparin -# This file is distributed under the same license as the PACKAGE package. -# Mauro Scomparin , 2018. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: money 1.0.1\n" -"Report-Msgid-Bugs-To: scompo@gmail.com\n" -"POT-Creation-Date: 2018-07-10 23:10+0200\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: money/money.py:14 -msgid "type" -msgstr "" - -#: money/money.py:15 -msgid "value" -msgstr "" - -#: money/money.py:16 -msgid "date" -msgstr "" - -#: money/money.py:17 -msgid "hour" -msgstr "" - -#: money/money.py:18 -msgid "description" -msgstr "" - -#: money/money.py:24 -msgid "today" -msgstr "" - -#: money/money.py:25 -msgid "now" -msgstr "" - -#: money/money.py:97 -msgid "data file:" -msgstr "" - -#: money/money.py:196 -msgid "latest {} movements:" -msgstr "" - -#: money/money.py:216 -msgid "actual value: {}" -msgstr "" - -#: money/money.py:217 -msgid "total incomes: {}" -msgstr "" - -#: money/money.py:218 -msgid "total expenses: {}" -msgstr "" - -#: setup.py:13 -msgid "Money handling program" -msgstr "" diff --git a/setup.py b/setup.py index d935b4d..25f327d 100644 --- a/setup.py +++ b/setup.py @@ -4,21 +4,27 @@ from os import path here = path.abspath(path.dirname(__file__)) -with open(path.join(here, 'README.rst'), encoding = 'utf-8') as f: +with open(path.join(here, 'README.rst'), encoding='utf-8') as f: long_description = f.read() setup( - name = 'money', - version = '1.0.1', - description = _('Money handling program'), - long_description = long_description, - url = 'http://code.scompo.it:3000/scompo/money', - author = 'Mauro Scomparin', - author_email = 'scompo@gmail.com', - license = 'BSD', - packages=find_packages(exclude=['contrib', 'docs', 'tests', 'utils', 'scripts']), + name='money', + version='1.0.1', + description='Money handling program', + long_description=long_description, + url='http://code.scompo.it:3000/scompo/money', + author='Mauro Scomparin', + author_email='scompo@gmail.com', + license='BSD', + packages=find_packages( + exclude=['contrib', 'docs', 'tests', 'utils', 'scripts']), + package_data={ + 'money': [ + 'translations/*/LC_MESSAGES/money.mo' + ], + }, entry_points={ - 'console_scripts' : [ + 'console_scripts': [ 'money-insert=money.money:read_new_movement', 'money-latest=money.money:latest_movements', ],