Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to translate/localize to other languages from last Geconomicus release >=2.5 #50

Open
numeropi opened this issue Jan 14, 2021 · 0 comments

Comments

@numeropi
Copy link

Make sure you don't install sphinx=1.3 or python3.4 as the instructions tell you, it is outdated.

Download the latest release https://github.com/libre-money-projects/Geconomicus/releases
(currently the 2.5). Unzip it. Or if in the future this repository is updated, just make a git clone it.

First, create your language locale(in this example spanish es_ES) :

  • copy: /rst/source/locale/en_US to your new locale folder, ex for spanish: /rst/source/locale/es_ES
  • copy build_en_US.sh to build_es_ES.sh and edit the locale inside from 'en_US' to 'es_ES'
  • Make the file exectuable with: chmod +x build_es_ES.sh
  • translate the .po files to Spanish by using some local tool like poedit or online tool like https://localise.biz/free/poeditor
  • create a python3 virtualenv for example like this (make sure to have python >=3.6) :

mkvirtualenv -p python3 geconomicus
(geconomicus) # pip install sphinx sphinx-intl

  • edit the file rst/source/conf.py and change 'sphinx.ext.pngmath' to 'sphinx.ext.imgmath',

To generate all the necessary images and resources:
(geconomicus) # ./build.sh

To re-generate the translated .mo files and final .html outputs:
(geconomicus) # ./build_es_ES.sh

Done!
It will generate you a rst/build/html/index.html that you can upload via FTP to your web server and show. Or create a PDF from it.

@galuel maybe you can try this and update the repository to 2.5 without problems.

TODO: maybe the build.sh could have a parameter to add the locale directly there without having to create additional .sh per new locale.

Good job with this educative tool by the way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant