Add transifex
This commit is contained in:
parent
b4be69017b
commit
88a061a0ff
14
transifex_demo.py
Normal file
14
transifex_demo.py
Normal file
|
@ -0,0 +1,14 @@
|
|||
from transifex.native.daemon import daemon
|
||||
from transifex.native import init, tx
|
||||
from transifex.native.rendering import PseudoTranslationPolicy, SourceStringErrorPolicy
|
||||
from transifex.native.parsing import SourceString
|
||||
|
||||
init(token='1/6e212800e39991406f0001245517708823f293b8', languages=['el', 'fr', 'en'], secret='1/47cc0fcea6d5f229a618ae0a20e2b60113738fe1')
|
||||
# Add some strings to push
|
||||
strings = [SourceString('My Addresses')]
|
||||
|
||||
response_content = tx.push_source_strings(strings)
|
||||
print(response_content)
|
||||
tx.fetch_translations()
|
||||
el_translation = tx.translate('My Addresses', 'fr')
|
||||
print(el_translation)
|
Reference in New Issue
Block a user