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'
--- /dev/null
+# Translations for money template file.
+# Copyright (C) 2018 Mauro Scomparin
+# This file is distributed under the same license as the money package.
+# Mauro Scomparin <scompo@gmail.com>, 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: <scompo@gmail.com>\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: {}"
--- /dev/null
+# Translations for money template file.
+# Copyright (C) 2018 Mauro Scomparin
+# This file is distributed under the same license as the PACKAGE package.
+# Mauro Scomparin <scompo@gmail.com>, 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 <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\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 ""
+++ /dev/null
-# Translations for money template file.
-# Copyright (C) 2018 Mauro Scomparin
-# This file is distributed under the same license as the PACKAGE package.
-# Mauro Scomparin <scompo@gmail.com>, 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 <EMAIL@ADDRESS>\n"
-"Language-Team: LANGUAGE <LL@li.org>\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 ""
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',
],