-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.rst
141 lines (95 loc) · 4.39 KB
/
README.rst
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
==============
Portal Web GUI
==============
Web portal including:
- Tryton wrapper
- Web user management
- Web frontend
- API
- Plugin system
For a working development setup, see https://github.com/C3S/collecting_society_docker
Tryton wrapper
--------------
Provides helpful methods for initialisation of the db connection, transaction
handling, communication with the tryton pool and wrapping of tryton models.
Includes tryton model wrappers for web_user, company and bank_account_number.
Web user management
-------------------
Enables authorization and authentication of web user (register, login).
Web frontend
------------
Provides a bootstrap based basic user front- and backend, a traversal based
registry for hierarchical content structures and a form controller for easy
handling of multiple forms per view and maintainance of complex forms.
API
---
Provides an include mechanism for an API either within the web frontend or
standalone.
Plugin system
-------------
Plugins are other minimal setup pyramid apps, wich will be included within
the main app. Plugins may extend and possibly override certain aspects
of the main app. The plugins are found by a shared egg name pattern
configured within settings (``plugins.pattern``).
They have to define in their settings:
- ``plugin.priority=<Integer>``: to ensure a well defined order of inclusion
They should define in their ``__init__.py``:
- ``include_resources(settings)``: for all additions and changes to resources
- ``include views(settings)``: for all registrations of views
Settings
''''''''
The settings of plugins extend and override the main settings. Those of
plugins with the heigher priority will override lower ones.
Views
'''''
The views of plugins with higher priority will be registered first, later
ones will be ignored.
Resources
'''''''''
Resources of plugins may be added to main ones with ``Resource.add()``
Registry within resources may be extended with ``Resource.extend_registry()``
Logging
'''''''
The logging configuration of plugins will spawn new logger
Translations
------------
Explanation
```````````
- **.pot**: "Portable Object Template" file, list of message identifiers, template for **.po** files
- **.po**: "Portable Object" file, human editable list of translated messages
- **.mo**: "Machine Object" file, machine readable list of messages, created from a **.po** file
Installation
````````````
- **poedit**: ``$apt-get install poedit``
- **gettext**: ``$apt-get install gettext``
- **lingua**: ``$pip install lingua``
**Note**: If you are running different python versions on the host, you need to ensure, that the right ``pip`` (e.g. ``pip2.7``) is called.
Updates
```````
e.g. for project **portal_web** and language **de**
- only once, to start translation of a project, create the **.pot** file for the project
- ``$cd collecting_society_docker/volumes/shared/src/portal_web``
- ``$mkdir portal_web/locale``
- ``$pot-create -o portal_web/locale/portal_web.pot portal_web``
- only once, if you need a new language, create the **.po** file for the language
- ``$cd collecting_society_docker/volumes/shared/src/portal_web/portal_web/locale``
- ``$mkdir -p de/LC_MESSAGES``
- ``$msginit -l de -o de/LC_MESSAGES/portal_web.po``
- each time, the code or templates changed, recreate the **.pot** file:
- ``$cd collecting_society_docker/volumes/shared/src/portal_web``
- ``$pot-create -o portal_web/locale/portal_web.pot portal_web``
- every time the **.pot** file changed, recreate the **.po** files for all languages
- ``$cd collecting_society_docker/volumes/shared/src/portal_web``
- ``$msgmerge --update portal_web/locale/*/LC_MESSAGES/portal_web.po portal_web/locale/portal_web.pot``
- to edit translations, change the **.po** file via poedit
- ``$cd collecting_society_docker/volumes/shared/src/portal_web``
- ``$poedit portal_web/locale/de/LC_MESSAGES/portal_web.po``
- every time the **.po** file changed, create a **.mo** file
- ``$cd collecting_society_docker/volumes/shared/src/portal_web``
- ``$msgfmt -o portal_web/locale/de/LC_MESSAGES/portal_web.mo portal_web/locale/de/LC_MESSAGES/portal_web.po``
Further information
```````````````````
- see `pyramid documentation <http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/i18n.html#working-with-gettext-translation-files>`_
Copyright / License
-------------------
For infos on copyright and licenses, see ``./COPYRIGHT.rst``