Weblate is a copylefted libre software web-based continuous localization system, used by over 1150 libre projects and companies in more than 115 countries.
This repository has been forked from https://github.com/WeblateOrg/Weblate. It is a public repository, so take special care not to commit keys.
The Google Group [email protected]
is configured as the administrator account for Weblate. The password for this group is stored in a kubernetes secret.
To receive admin notifications (for requests, error logs, and repository alerts), add yourself to the [email protected]
Google Group.
Outgoing emails from Weblate use [email protected]
as the sender. This account is configured as an SMTP relay for Weblate using kubernetes environment variables WEBLATE_EMAIL_HOST_USER
and WEBLATE_EMAIL_HOST_PASSWORD
. The password is generated as an App Password.
Superadmin user accounts can access the Django Admin dashboard and Admin console. These tools can be used to view and update domain objects from the DB, debug issues, and run scripts.
The DeepL Translator is the preferred machine translation API when automating translations into non-English languages. We are subscribed to the Free tier, which offers 500,000 characters of translation per month. You can login to view account details and check usage here using credentials from the R&D LastPass account.
Google Translate API is kind of a backup machine translation API. It's really cheap to use, but produces pretty low-quality translations. It is managed through cloud console for the repcore-prod
project.
This project uses a unique branching structure since not all changes are appropriate to push upstream.
vendasta
: This branch is our "working master". It should be branched
off when starting new work and used as a base for pull requests. If code
committed to this branch can potentially be contributed to the Weblate
project, please cherry-pick the relevant commits into a pull request
against master.
master
: This branch is reserved for code that can potentially be
contributed back to the Weblate project. This should not be treated as
the base branch for new work.
weblate runs on Python 3.7 and Django. In order to develop locally, install Python with brew:
brew install python
Since you're most likely using Python 2 for your other projects, it's best to use a virtual environment for developing weblate:
python3 -m venv venv; source venv/bin/activate
Install additional requirements:
./install.sh
Build local dockerfile "weblate-dev" and run it on localhost:8080
:
inv serve
Run inv lint
to ensure all linting rules are being observed.
If you are missing pip modules you can install them using:
pip install -r requirements-lint.txt`
Weblate is deployed using kubernetes configurations located in the Gitops repo. These configurations are monitored by ArgoCD, which should be used to synchronize pods whenever the k8s files are updated.
- Push changes to
vendasta
branch, as described in Branching above. - Go to Mission Control and wait for your changes to build successfully.
- Go to the Build Log and copy the destination image from Execution Details:
- Go to Gitops. Find
weblate/demo/deployment.yaml
orweblate/prod/deployment.yaml
, and update theimage
key to the value copied in step 4. Commit this to master. - Go to ArgoCD. Find weblate-demo or weblate-prod, then click Sync > Synchronize.
To be found in the docs directory the source code, or viewed online on [https://docs.weblate.org/]
The topology of Weblate is divided into Projects and Components. A Project is simply an administrative collection of Components, and each Component represents a single collection of translation units.
Weblate does not have the stability necessary for serving translations to apps. Lexicon is a microservice for mirroring and serving translations as they are committed to Weblate component repos.
The NotifyLexicon
is responsible for triggering Lexicon mirroring workflows, and it should be enabled for any Component that serves its translations from Lexicon.
Before starting, your project needs a source translation file. This should typically be named en_devel.json
and should be saved to a Vendasta github repository.
- Navigate to Weblate and login using Vendasta SSO.
- Navigate to the Common Weblate Project. Create a new component for your project by clicking
Add new translation component
.- If this project is not a common library, you might choose another Weblate Project, or create a new Weblate Project using the
+
in the navbar. - Not everyone has permissions to create a new project. team-sre has permissions and can follow these steps:
- Log into weblate.apigateway.co using SSO
- Open Business App project and click info - this project website is the website that most projects use (according to Toni)
- Create a new translation project where the Project name is capitalized and the project website is what is in Business App
- Click save. Everyone can add components to the project.
- If this project is not a common library, you might choose another Weblate Project, or create a new Weblate Project using the
- Click the
Translate document
tab. - Complete the form and click
Continue
.- Document to translate: Choose the
en_devel.json
source file. - Project: The Weblate project this component lives under. You probably don't need to change this.
- Component name: The name for the component. Usually the repo name or project directory name.
- URL slug: The url and unique ID for the component. You probably don't need to change the generated value.
- Document to translate: Choose the
- Find and select the wildcard filepath for your translation files from the list, and click
Continue
. - Choose an option for
File format
that matches your file. It will probably beJSON file
,JSON nested structure file
, orXLIFF translation file
. - Copy the value from
Monolingual base language file
toTemplate for new translations
. - Accept other default values and click
Continue
. - After the component is created, click
Manage
>Addons
. - Add the
Notify Lexicon
Addon. This step ensures that any change to the base translation file within VCS will propagate to Lexicon.
Copyright © 2012–2020 Michal Čihař [email protected]
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details https://www.gnu.org/licenses/.
weblate.org: https://weblate.org/