Uploaded messages.pot using config file

This commit is contained in:
Mohammad Osama Khan 2022-12-28 21:23:42 +05:30
parent 5c88231081
commit 02246b8602
No known key found for this signature in database
GPG Key ID: 15F978BEFADAB9E1
5 changed files with 28 additions and 4 deletions

9
.tx/config Normal file
View File

@ -0,0 +1,9 @@
[main]
host = https://www.transifex.com
api_token = ''
[pybitmessage-test.messages-pot]
file_filter = <lang>po
minimum_perc = 0
source_file = messages.pot
source_lang = en
type = PO

View File

@ -12,4 +12,4 @@ strings = [SourceString('My Addresses')]
response_content = tx.push_source_strings(strings)
tx.fetch_translations()
el_translation = tx.translate('My Addresses', 'fr')
print(el_translation)
print("here is the translation",el_translation)

View File

@ -80,7 +80,7 @@ def upload_source():
def async_job(id):
response = requests.get("http://www.transifex.com/bitmessage-project/pybitmessage/upload_source/$BUILDBOT_JOBID" + id +"/")
api_token = '1/95c69f7fd63425f673ba0037dcb1b2a98edf096c'
api_token = ''
transifex_api.setup(auth=api_token)
# transifex_api.Organization.list()
organization = transifex_api.Organization.get(slug="bitmessage-project")
@ -88,9 +88,21 @@ def async_job(id):
language = transifex_api.Language.get(code="fr")
resource = project.fetch('resources').get(slug="messagespot")
content = "The new source file content"
transifex_api.ResourceStringsAsyncUpload.upload(resource, content)
with open(resource,'rb') as f:
upload = transifex_api.ResourceStringsAsyncUpload.create_with_form(
data={'resource': resource.id},
files={'content': f},
)
return "done"
# transifex_api.ResourceStringsAsyncUpload.upload(resource, content)
while not response:
time.sleep(1)
sleep_time = time.sleep(1)
sleep_time+=1
if sleep_time == 600:
return False

3
transifex_upload.sh Executable file
View File

@ -0,0 +1,3 @@
pip install transifex-client
# chmod 777 '/home/cis/PyBitmessage/transifex/transifex-webhook/.tx/config'
tx init

BIN
tx Executable file

Binary file not shown.