My custom MachineTranslation always give empty translation #16182
-
Hello everyone, I tried making a POC of a MachineTranslation with a fix translation: from weblate.machinery.base import DownloadTranslations, MachineTranslation
class MyTranslation(MachineTranslation):
"""Sample machine translation interface."""
name = "APOC"
def download_languages(self):
"""Return list of languages your machine translation supports."""
return {"fr", "en", "es" "pt"}
def download_translations(
self,
source_language,
target_language,
text: str,
unit,
user,
threshold: int = 75,
) -> DownloadTranslations:
yield {"text": "BIG TRANSLATOR IS TRANSLATING YOU", "quality": min(threshold + 1, 100), "service": self.name, "source": text} I added it in my volumes:
- weblate-data:/app/data
- ./weblate_customize:/app/data/python/customize
- weblate-cache:/app/cache
environment:
WEBLATE_ADD_MACHINERY: "customize.my_translation.MyTranslation" I then had problems with the permissions so I made a Now no more permissions show up in the What am I doing wrong ? I am using the Docker image latest, Weblate v5.13.3 as I am writing Thanks in advance 🙏 Nicolas |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
“Your suggestion is empty!” appears when you submit a manual suggestion and it is empty; it has nothing to do with automatic suggestions. Those would appear on the “Automatic suggestions” tab. |
Beta Was this translation helpful? Give feedback.
“Your suggestion is empty!” appears when you submit a manual suggestion and it is empty; it has nothing to do with automatic suggestions. Those would appear on the “Automatic suggestions” tab.