REST client to retrieve and push data on a PO-Projects service
Project description
REST client to retrieve and push datas on a PO-Projects service.
The purpose of this client is to install PO files from a PO-Projects translation project in your Django project (or Optimus), or to send updated POT files to update translation project on the service.
Install
Require
Usage
Before starting to use it, you must create a new translation project on you PO-Projects service. Note its slug name.
And so execute the action:
po_projects [ACTION]
But if it’s your first usage, you should need to give some arguments to commandline, check those require ones with the help :
po_projects help [ACTION]
After the first successful connect on the service, a ‘po_projects.cfg’ config file will be writed at the current directory, it will contains all required stuff needed to connect to the service and get the project datas without to specify them again in command arguments.
Also you can write the config file before the first usage to avoid to give command arguments. Just write this in a “po_projects.cfg” file at the root of your project (or everywhere you want to use the client command):
[PO_Project] host = http://192.168.0.103:8001/po/rest/ password = mypassword user = myusername locale_path = project/locale project_slug = myslug kind = django django_default_locale = en_US
user and password is from an User account registered on the service API, it needs to be an admin account (is_staff = True);
host is the full URL to use to connect to the service API;
locale_path can be every relative path or an absolute path to the project locales directory which will contains the message catalogs structure with the PO files;
kind can be django (for a Django project) or messages (for common gettext projects like Optimus);
Actually you cannot create and register a new project on the service from the client, you have to create it before on the service, then note the slug name to use it with the client.
Pull
This is the command to get the current project translations tarball :
po_projects pull
It will install or update your locales directory (locale_path) from the current existing project on a PO-Project service. Note that the previous locales directory will be replaced with the new one, you should backup it before if you care.
Push
This is the command to update a project translation on the service :
po_projects push
It will send your current local translation catalog to the service so it will merge the translation strings on the project from extracted strings.
When using django kind, it requires an extra argument django_default_locale, this is the directory name (relative to locale_path) of the locale catalog to send to the service to update a project. optimus kind doesn’t need it because it directly use the POT file that don’t exists within a Django project;
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file PO-Projects-client-0.1.2.1.tar.gz
.
File metadata
- Download URL: PO-Projects-client-0.1.2.1.tar.gz
- Upload date:
- Size: 10.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2e93f410584284fa51e22d4a3267dc2b1db9c1e2afbeea40743eab15a7999fd |
|
MD5 | 20b99d272cebf87a39009136eecfe0ae |
|
BLAKE2b-256 | 02ff617eb011e4a3830257b2a1aa79151e0d4612a417a7a36fd5b54b62c8fdbf |