Browse Source

Cleans translation mechanism

Adrien Panay 6 years ago
parent
commit
d7dc759b91

+ 3 - 0
.gitignore View File

@@ -77,3 +77,6 @@ wsgidav.conf
77 77
 # builded files from gulp scripts
78 78
 /tracim/tracim/public/assets/dist/
79 79
 /tracim/tracim/public/assets/js/main_es5.js
80
+
81
+# binary translation files
82
+*.mo

+ 0 - 2
tracim/development.ini.base View File

@@ -32,8 +32,6 @@ cookie_secret = 3283411b-1904-4554-b0e1-883863b53080
32 32
 [app:main]
33 33
 use = egg:tracim
34 34
 full_stack = true
35
-# You can set french as default language by uncommenting next line
36
-# i18n.lang = fr
37 35
 
38 36
 cache_dir = %(here)s/data
39 37
 # preview generator cache directory

+ 20 - 1
tracim/setup.py View File

@@ -7,6 +7,7 @@
7 7
 #
8 8
 #
9 9
 
10
+from setuptools.command.develop import develop
10 11
 #This is just a work-around for a Python2.7 issue causing
11 12
 #interpreter crash at exit when trying to log an info message.
12 13
 try:
@@ -25,6 +26,17 @@ except ImportError:
25 26
     use_setuptools()
26 27
     from setuptools import setup, find_packages
27 28
 
29
+
30
+class DevelopWithCompileCatalog(develop):
31
+    def run(self):
32
+        from babel.messages.frontend import compile_catalog
33
+        compiler = compile_catalog(self.distribution)
34
+        option_dict = self.distribution.get_option_dict('compile_catalog')
35
+        compiler.domain = option_dict['domain'][1]
36
+        compiler.directory = option_dict['directory'][1]
37
+        compiler.run()
38
+        super().run()
39
+
28 40
 classifiers = [
29 41
     "License :: OSI Approved :: GNU Affero General Public License v3",
30 42
     "Programming Language :: Python",
@@ -56,6 +68,10 @@ install_requires=[
56 68
     'preview-generator'
57 69
     ]
58 70
 
71
+setup_requires = [
72
+    'babel',
73
+],
74
+
59 75
 setup(
60 76
     name='tracim',
61 77
     version='1.0.0',
@@ -93,5 +109,8 @@ setup(
93 109
     dependency_links=[
94 110
         'http://github.com/algoo/preview-generator/tarball/master#egg=preview_generator-1.0',
95 111
         ],
96
-    zip_safe=False
112
+    zip_safe=False,
113
+    cmdclass={
114
+        'develop': DevelopWithCompileCatalog,
115
+    },
97 116
 )

BIN
tracim/tracim/i18n/fr/LC_MESSAGES/tracim.mo View File


+ 0 - 24
tracim/tracim/i18n/ru/LC_MESSAGES/pboard.po View File

@@ -1,24 +0,0 @@
1
-# Russian translations for ${package}.
2
-# Copyright (C) 2008 ORGANIZATION
3
-# This file is distributed under the same license as the ${package} project.
4
-# FIRST AUTHOR <EMAIL@ADDRESS>, 2008.
5
-#
6
-msgid ""
7
-msgstr ""
8
-"Project-Id-Version: ${package} 0.0.0\n"
9
-"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
10
-"POT-Creation-Date: 2008-01-13 14:00+0200\n"
11
-"PO-Revision-Date: 2008-01-13 14:00+0200\n"
12
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
-"Language-Team: ru <LL@li.org>\n"
14
-"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
15
-"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)\n"
16
-"MIME-Version: 1.0\n"
17
-"Content-Type: text/plain; charset=utf-8\n"
18
-"Content-Transfer-Encoding: 8bit\n"
19
-"Generated-By: Babel 0.9.1\n"
20
-
21
-#: ${package}/controllers/root.py:13
22
-msgid "Your application is now running"
23
-msgstr "Ваши приложение успешно запущено"
24
-