-
Notifications
You must be signed in to change notification settings - Fork 288
Pootle project tool
- provide access to tp_tool api
- clone tps within/between projects
- move tps within/between projects
- update some/all of 1 tp from another
- clone projects
- move projects
-
Template actions:
- Add missing units from source to target
- Remove units missing in source from target
- Adjust source of a unit in target
-
Target translation actions:
- Copy translations from source unit to target unit
- Copy only if blank
- Copy only if source unit is newer than target unit
- Copy translations from source unit to target unit
--target-language
can be set with one --language
parameter only. It will perform all actions on TP-SOURCE->TP-TARGET.
pootle project clone foo --target-project=baz [--language=…]*
pootle project clone foo --language=pt --target-project=baz --target-language=pt-BR
pootle project move foo --target-project=baz [--language=…]*
pootle project move foo --language=pt --target-project=baz --target-language=pt-BR
pootle project update foo --target-project=baz [--translations][--overwrite][--language=…]*
pootle project update foo --target-project=baz --language=pt --target-language=pt-BR [--translations][--overwrite]
Runs standard update process baz
project from foo
project. NEED TO CLARIFY. SEE EXAMPLE BELOW.
If --translations
is set it updates translations only. No new units can be added. No existing units can be marked as obsolete.
- there are two projects (
PRJ1
,PRJ2
) - sometimes we need to update
/LANG/PRJ1
from/LANG/PRJ2
- edit unit in
/LANG/PRJ1
- run
project update PRJ1 --language=LANG1 --target-project=PRJ2 --target-language=LANG2
What can we do if unit was already translated in /LANG/PRJ2
:
- overwrite translation without suggestion (available
--overwrite
=>source_revision = target.max_revision + 1
) - overwrite translation, add existing translation as suggestion (
source_revision=0
,SOURCE_WINS
) - add new translation as suggestion (
source_revision=0
,POOTLE_WINS
) - do nothing (
source_revision=0
,POOTLE_WINS
,--no-suggestions
)
Current available options: --overwrite
. NEED TO ADD MORE OPTIONS.
Having to say:
Current conflict detecting logic for FS updating relies on last_sync_revision
if overwrite:
store_revision = self.target_store.data.max_unit_revision
else:
store_revision = self.target_store.last_sync_revision or 0
There is no last_sync_revision
if we update a store from another store within Pootle however unit revision can be available (probs we can think about this later). Currently source_revision
is set to 0
what leads to resolving conflicts in any case when source and target units are translated and their translation are not the same.
pootle project remove foo [--force] [--language=…]*
--force
can be used for the whole project only and removes project directory from PO_DIRECTORY