Skip to content

Commit

Permalink
Use the transifex slug and not name as the key
Browse files Browse the repository at this point in the history
Previously the name was used, which can be Foreman instead of foreman.
It was silently passing so now a warning is printed.
  • Loading branch information
ekohl committed Sep 18, 2024
1 parent 8c50189 commit 2e9bf74
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions sync
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,12 @@ class Transifex(Engine):
for resource in self._get_resources():
for language in languages:
try:
content = translations[f'{resource.name}__{language.code}']
except KeyError:
content = translations[f'{resource.slug}__{language.code}']
except KeyError as e:
print(f"Translation not found: {e}")
pass
else:
print('Uploading', resource.name, 'in', language.code)
print('Uploading', resource.slug, 'in', language.code)
res = transifex_api.ResourceTranslationsAsyncUpload.upload(resource=resource,
language=language,
content=content,
Expand Down

0 comments on commit 2e9bf74

Please sign in to comment.