We recommend using our translation as a service tool: Weploy.ai
This project provides a Django application that lets you manage translations and deliver them via REST API to any application that supports the i18next JSON format. This project is intended to be a Free open source and Self-hosted Docker alternative to existing SaaS Solutions (e.g. locize.com). test
The first thing to do is to clone the repository:
$ git clone https://github.com/2567910/tmm.git
$ cd tmm
Create a virtual environment to install dependencies in and activate it:
$ python3 -m venv venv
$ source venv/bin/activate
Then install the dependencies:
(env)$ pip install -r requirements.txt
Note the (env)
in front of the prompt. This indicates that this terminal
session operates in a virtual environment set up by virtualenv2
.
Once pip
has finished downloading the dependencies:
(env)$ python manage.py runserver
Next you will need to setup the database.
Open another terminal window and go to the root directory of the project and run:
$ docker-compose up postgres
Switch back to the terminal window where the virtual env and migrate
(env)$ python manage.py migrate
Create a superuser
(env)$ ./manage.py createsuperuser --username YOUR_SUPERUSER_NAME
All done! After you run the command below the Django application should be visable under: http://127.0.0.1:8000/admin/
.
(env)$ python manage.py runserver
You should be able to use the created superuser credentials to log in to the admin.
Disclaimer: This project includes an example dockerfile for Production. But you should configure it to your own needs.
Once you have a Django application running, and you are logged in, you should see the screen Below.
If you are logged in as an admin you should be able to create, delete and update Projects, Languages, TranslationKey and Translations.
You also have the option to Import existing .json i18next formatted translation files. Upon import, all data is overwritten, so be aware. Imported files do not have the rights to delete Translations or TranslationKeys.
To access the translations you have created from the REST API use the following pattern: http://127.0.0.1:8000/translations/{PROJECT_NAME}/{LANGUAGE_CODE}
We have also created a demo React integration. Feel free to use the integration code from there.
The package is Open Source Software released under the MIT License. It's developed by Lukas Seyfarth.