forked from Bitmessage/transifex-webhook
16 lines
550 B
Python
16 lines
550 B
Python
"""Transifex basic implementation using python native sdk """
|
|
import os
|
|
from transifex.native import init, tx
|
|
from transifex.native.parsing import SourceString
|
|
|
|
token = os.getenv('token')
|
|
secret = os.getenv('secret')
|
|
print("token value",token)
|
|
init(token=token, languages=['el', 'fr', 'en'], secret=secret)
|
|
# Add some strings to push
|
|
strings = [SourceString('My Addresses')]
|
|
response_content = tx.push_source_strings(strings)
|
|
tx.fetch_translations()
|
|
el_translation = tx.translate('My Addresses', 'fr')
|
|
print("here is the translation",el_translation)
|