Comments (6)
First of all, you don't need .pot files for that, Serge syncs .po files with Pootle.
Pootle expects a certain folder structure in order to work properly. Here's an example:
/pootle_root_po_dir
/project1
/de
/resources.json.po
/ja
/resources.json.po
/pt_BR
/resources.json.po
...
/project2
/de
/resources.xml.po
/ja
/resources.xml.po
/pt_BR
/resources.xml.po
...
...
and in your Pootle configuration file you need to set the path to /pootle_root_po_dir
.
Next, in your Serge config for your "Project 1" you need to specify:
ts_file_path /pootle_root_po_dir/project1/%LOCALE%/%FILE%.po
so that Serge generates .po files the way Pootle expects them.
On Pootle side, you need to go to your Admin panel => Projects and create a new project with id project1
(this is how Pootle will know that it needs to look inside /pootle_root_po_dir/project1
folder).
When this is configured, Serge will do the two-way sync with Pootle automatically using it's sync_stores
and update_stores
commands. All you need to do in your Serge config is to add the following section:
sync
{
ts
{
plugin pootle
data
{
manage_py_path /path/to/pootle/manage.py
project_id project1
}
}
...
}
from serge.
I'll keep this open till I add the above mentioned short tutorial to Serge's pootle
plugin documentation.
from serge.
@iafan out of curiosity: does the plugin take virtual environments into account? If one runs manage.py
directly, the first Python interpreter found in PATH
will be used, which won't match the intended interpreter if using virtual environments.
Also, if users installed Pootle via pip, they will have the pootle
command available, which serves the same purpose as manage.py
(note the latter will be buried somewhere under the Python installation subdirectories). So how does one specify to use the pootle
command in that case? Does it happen automatically?
from serge.
Good point, @julen!
- If Pootle is installed from under virtualenv, you need to make sure that
manage.py
is being run in the context of this environment (one can create a wrapper shell script to select this environment and call the script itself). - If in your system there's a script called
pootle
instead ofmanage.py
, then use it.
Basically, you need to tell Serge a path to some script that will consume sync_stores
and update_stores
commands and properly run them against the installed Pootle instance. Serge doesn't try to be overly smart about detecting system configuration.
from serge.
Thanks for the reply. I think I got most of that on my own after some digging. It turns out my problem was the language. I was specifying "jpn" for Japanese in my .serge file. Pootle was expecting the directory 'ja', not 'jpn' for the .po files.
from serge.
Added relevant documentation: https://serge.io/docs/guides/pootle/
from serge.
Related Issues (20)
- parse_php_xhtml: add an ability to fine-tune the list of tags processed by default
- Serge always prints debug output on CI. HOT 1
- Qt Text Id based (ts files) HOT 5
- Localized file generation failed HOT 5
- Typo bug: DROP index items_file_id_string_id after CREATE HOT 1
- Add support for computed properties in parse_js parser
- Optimizations prevent reusing translations on existing unmodified files
- Cannot use env variable on boolean property
- Serge surprisingly cuts file name. HOT 3
- transliterate option of test_language plugin should not modify printf() parameter fields
- [Question] Are there any examples (e.g. GitLab CI)?
- Support multiple source files in single XLIFF file HOT 1
- Each <trans-unit> sets "approved=yes" for untranslated strings HOT 3
- parse nginx.conf bug,include not support wildcard HOT 1
- While put the mouse on (Notebooks section) we are unable to place mouse directly on scroll bar, please increase the mouse scroll width like how the size it as page right hand side up and down scroll bar size.
- Parse MD file
- run_command for jobs with several destination_languages dont change %OUTFILE% variable HOT 1
- export_to_ttx is not including the translated text
- Docs no longer easily accessible HOT 1
- Ownership transfer request HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from serge.