Go to file
Javier Sánchez Parra c34da1e098 Add language configuration and Spanish translation
This commits configures and sets up flask-babel and adds Spanish po
file. Flask-babel is already a dependency so this commits no needs to
add it.

Users can edit ogcp.json to choose between English or Spanish. After
changing the language in the configuration file, users must restart ogcp
service.

Instructions to generate translation files, inspired by
https://flask-babel.tkte.ch/:

1. Download ogcp source code.

   git clone git://git.soleta.eu/ogCP /path/to/ogcp

2. Create a python virtual environment.

   python3 -m venv /path/to/new/venv

3. Activate the virtual environment.

   source /path/to/new/venv/bin/activate

4. Install dependencies to the virtual environment.

   cd /path/to/ogcp
   pip3 install -r requirements.txt

5. Extract ogcp strings.

   cd /path/to/ogcp/ogcp
   pybabel extract -F babel.cfg -k _l -o messages.pot .

   NOTE: "-k _l" is needed to extract strings which use lazy
   translations.

6. Create or update translation files.

   a. Create translation file. This example creates a french translation
   file.

      pybabel init -i messages.pot -d translations -l fr

   b. Update translation files. You need to do this when ogcp strings
   change and want to update current supported languages.

      pybabel update -i messages.pot -d translations

7. Edit the translations .po file as needed. Example route:
   /path/to/ogcp/ogcp/translations/fr/LC_MESSAGES/messages.po.

8. Compile translations.

   pybabel compile -d translations

9. Launch ogcp and check the translations.

   cd /path/to/ogcp
   pip3 install -r requirements.txt

10. Commit and push .po files with translation changes.
2022-01-13 11:36:46 +01:00
ogcp Add language configuration and Spanish translation 2022-01-13 11:36:46 +01:00
.gitignore Add gitignore 2020-08-28 10:18:43 +02:00
COPYING Add README.md and COPYING files 2021-05-21 11:18:08 +02:00
README.md Add README.md and COPYING files 2021-05-21 11:18:08 +02:00
requirements.txt Add login 2021-03-05 11:47:27 +01:00
run_test.sh Add run_test.sh script 2020-10-27 10:38:56 +01:00

README.md

ogCP

ogCP (OpenGnsys Control Panel) is the new web interface, a modern alternative to the classical administration panel (WebConsole).

Installation

Steps to install ogCP on Ubuntu 18.04 LTS:

  • Clone the repository that is temporarily available at: https://github.com/javsanpar/ogCP
  • Edit ogcp/cfg/ogcp.json and include the API token and the IP address of the ogServer. In addition, we must define the user and the key we want for authentication in ogCP.
  • Create a python virtual environment.
    • Install venv with:
      apt-get install python3-venv
      
    • Create the folder where we will start the virtual environment.
    • Create the virtual environment with:
      python3 -m venv ./previous-folder
      
  • Activate the shell with the virtual environment with:
    source ./previous-folder/bin/activate
    
  • (Optional) If you want to expose ogCP to other machines, you must edit run_test.sh with:
    ...
    flask run --host=0.0.0.0
    
  • With the shell linked to the newly created python environment, navigate to the folder where you cloned ogCP and launch:
    ./run_test.sh
    
    When running run_test.sh for the first time some errors are expected, but they do not affect to the usability of ogCP.

License

ogCP is released under the GNU Affero Public License v3+

Authors

Soleta Networks