Skip to content

Commit

Permalink
Load more languages at odoo startup (#66)
Browse files Browse the repository at this point in the history
By default, catalan and spanish (from spain)
  • Loading branch information
raneq authored Jul 22, 2019
1 parent ebfc644 commit 89a2ad2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,12 @@ odoo_role_odoo_git_ref: "11.0"
```yml
odoo_role_odoo_user: odoo
odoo_role_odoo_group: odoo


odoo_role_odoo_venv_path: /opt/.odoo_venv
```
* Directories structure
```yml
odoo_role_odoo_venv_path: /opt/.odoo_venv
odoo_role_odoo_path: /opt/odoo
odoo_role_odoo_bin_path: "{{ odoo_role_odoo_path }}/build/scripts-2.7/odoo"
odoo_role_odoo_python_path: "{{ odoo_venv_path }}/bin/python"
Expand All @@ -67,7 +65,7 @@ odoo_role_odoo_modules_path: /opt/odoo/modules
* Databases
```yml
# Array of DBs that the role will create.
# Array of DBs that the role will create.
odoo_role_odoo_dbs: [ "odoo" ]
# This is the password Odoo asks to user allow them to create, delete, etc. DBs
odoo_role_odoo_db_admin_password: 1234
Expand Down Expand Up @@ -100,6 +98,13 @@ odoo_role_odoo_core_modules: "base"
odoo_role_odoo_community_modules: ""
```
* Other command line parameters
Odoo loads alternative languages at start up. Listing more languages to load will increase the restart/start time, but at the same time it will show that there are more languages available to choose and it will be easy for the user to switch to one of them. Coma separated list of ISO language codes with optional country code ([source](https://github.com/odoo/odoo/blob/c868da4de607d48d27d5cf9852871ed4698627f8/odoo/tools/translate.py#L1191-L1200)). There are translations for [many languages](https://github.com/odoo/odoo/blob/c868da4de607d48d27d5cf9852871ed4698627f8/odoo/tools/translate.py#L1191-L1200).
```yaml
odoo_role_loaded_languages: ca_ES,es_ES # Also available: eu_ES,gl_ES,pt_PT
```
Community Roles
---------------
Expand Down
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ odoo_role_odoo_modules_path: /opt/odoo_modules

odoo_role_odoo_log_path: /var/log/odoo
odoo_role_odoo_log_level: debug
odoo_role_loaded_languages: ca_ES,es_ES # Also available: eu_ES,gl_ES,pt_PT

odoo_role_odoo_db_name: odoo
odoo_role_odoo_dbs: [ "{{ odoo_role_odoo_db_name }}" ]
Expand Down
2 changes: 1 addition & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
with_items: "{{ odoo_role_odoo_dbs }}"
changed_when: false

- name: "Init Odoo database(s): odoo_role_odoo_dbs"
- name: "Init Odoo database(s): {{ odoo_role_odoo_dbs }}"
become: yes
become_user: "{{ odoo_role_odoo_user }}"
command: >
Expand Down
2 changes: 1 addition & 1 deletion templates/odoo.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Description=Odoo server

[Service]
ExecStart={{ odoo_role_odoo_python_path }} {{ odoo_role_odoo_bin_path }} -c {{ odoo_role_odoo_config_path }}/odoo.conf
ExecStart={{ odoo_role_odoo_python_path }} {{ odoo_role_odoo_bin_path }} -c {{ odoo_role_odoo_config_path }}/odoo.conf --load-language='{{ odoo_role_loaded_languages }}'
# Execute service like user
User={{ odoo_role_odoo_user }}
Group={{ odoo_role_odoo_group }}
Expand Down

0 comments on commit 89a2ad2

Please sign in to comment.