This repository has been archived on 2023-01-06. You can view files and clone it, but cannot push or open issues or pull requests.
transifex-webhook/app/transifex_demo.py

16 lines
524 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(el_translation)