Good morning,
Thank you for contacting us. I can see you have deleted the message you had sent.
Is there something we can help you with ?
Have you resolved the issue?
Could you please what are you trying to achieve so that we can help you with your use case?
Thank you for your attentive reply; the answer is No, I havenāt fully resolved my issue. Hereās some context. I am using the Python SDK. My goal is to extract a list of language codes of all translations available under a given project and resource slug. Hereās a my code:
if resource := project.fetch("resources").get(slug=resource_slug):
it = tx_api.ResourceLanguageStats.filter(
project=project,
resource=resource
).all()
language_codes = []
for tr in it:
# trying to do something with 'tr' here
# to get the tr's language codes...
Now perhaps I missed something and ResourceLanguageStats is not the appropriate class to use. I donāt mind as long as I can get the data I am looking forā¦
So the goal is not to get all language codes that are a declared target language on Transifex project but just those that have been (not exclusively fully) translated. correct?
Hum, maybe? Not sure whether what youāre saying = what I am saying. What I would like to extract: all the languages with any number of translation strings for the given <project, resource> pair.
Hello @MrNycticorax ,
I am Panagiotis from the Transifex support team, a colleague of @chrisb .
Allow me to chime in here since I would like to understand your need better. I understand what you wrote, but what need do you want to cover?
Every project has specific target languages. So, the projectās target languages are the same for all the project resources. Letās take the following example:
You have Project A, with English as Source Language and FR and ES as target languages.
Under this project, you have the following four resources.
-Resource R1
-Resource R2
-Resource R3
-Resource R4
Letās assume that:
Resource R1 has been translated at 35% both in FR and ES
Resource R2 has only one string translated in FR and none strings translated in ES
Resource R3 has 0 strings translated both in FR and ES.
Resource R4 has none strings translated in FR and 100% translated strings in ES.
What are you looking for in the above example?
Thank you in advance for your answer!
Kind regards,
Panagiotis
Principal Success Engineer at Transifex
Thanks for chiming in! I am grateful for your debunking my mistaken assumption that different resources under the same project could have different target languages for translations. Thanks for that!
So to answer your question, bearing in mind your example, Iād like to produce the list [fr, es], or any similar list including the language codes for the two target languages.