Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing target translation when using monolingual XLIFF files #8466

Closed
2 tasks done
GregWoods opened this issue Dec 9, 2022 · 3 comments
Closed
2 tasks done

Missing target translation when using monolingual XLIFF files #8466

GregWoods opened this issue Dec 9, 2022 · 3 comments
Labels
question This is more a question for the support than an issue. wontfix Nobody will work on this.

Comments

@GregWoods
Copy link

GregWoods commented Dec 9, 2022

Describe the issue

I am testing using weblate using xliff files in a monolingual way.

My base file "en.xlf" contains only one item

<?xml version="1.0" encoding="UTF-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.1" version="1.1">
  <file original="" source-language="en" target-language="fr" datatype="plaintext">
    <body>

      <trans-unit id="hi" approved="yes">
        <source>Hello World</source>
      </trans-unit>

    </body>
  </file>
</xliff>

My translated file is simply

<?xml version="1.0" encoding="UTF-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.1" version="1.1">
  <file original="" source-language="en" target-language="fr" datatype="plaintext">
    <body>

      <trans-unit id="hi">
        <target>Bonjour le monde</target>
      </trans-unit>

    </body>
  </file>

I seem to be doing things correctly according to the docs: https://docs.weblate.org/en/latest/formats.html#formats

monolingual formats identify the string by ID, and each language file contains only the mapping of those to any given language

For correct use of monolingual files, Weblate requires access to a file containing complete list of strings to translate with their source—this file is called Monolingual base language file within Weblate

Clicking around various links related to monolingual files provides no additional info.

I already tried

  • I've read and searched the documentation.
  • I've searched for similar issues in this repository.

Steps to reproduce the behavior

Using the above xliff inputs in my source code repo
I set up a new project
Set up a new project component
I can see the EN and FR languages
The English contain contains id and source
The French contains id, source, but the target is empty

Expected behavior

The French translation should include the target string of "Bonjour le monde"

Screenshots

image

Exception traceback

No response

How do you run Weblate?

Docker container

Weblate versions

Weblate versions
Weblate: 4.14.2
Django: 4.1.3
siphashc: 2.1
translate-toolkit: 3.7.4
lxml: 4.9.1
Pillow: 9.3.0
bleach: 5.0.1
python-dateutil: 2.8.2
social-auth-core: 4.3.0
social-auth-app-django: 5.0.0
django-crispy-forms: 1.14.0
oauthlib: 3.2.2
django-compressor: 4.1
djangorestframework: 3.14.0
django-filter: 22.1
django-appconf: 1.0.5
user-agents: 2.2.0
filelock: 3.8.0
rapidfuzz: 2.13.1
openpyxl: 3.0.10
celery: 5.2.7
kombu: 5.2.4
translation-finder: 2.14
weblate-language-data: 2022.8
html2text: 2020.1.16
pycairo: 1.21.0
pygobject: 3.42.2
diff-match-patch: 20200713
requests: 2.28.1
django-redis: 5.2.0
hiredis: 2.0.0
sentry_sdk: 1.10.1
Cython: 0.29.32
misaka: 2.1.1
GitPython: 3.1.29
borgbackup: 1.2.2
pyparsing: 3.0.9
pyahocorasick: 1.4.4
python-redis-lock: 4.0.0
charset-normalizer: 2.1.1
Python: 3.11.0
Git: 2.30.2
psycopg2: 2.9.5
psycopg2-binary: 2.9.5
phply: 1.2.5
ruamel.yaml: 0.17.21
tesserocr: 2.5.2
boto3: 1.26.3
zeep: 4.2.0
aeidon: 1.11
iniparse: 0.5
mysqlclient: 2.1.1
Mercurial: 6.2.3
git-svn: 2.30.2
git-review: 2.3.1
Redis server: 6.2.7
PostgreSQL server: 15.1
Database backends: django.db.backends.postgresql
Cache backends: default:RedisCache, avatar:FileBasedCache
Email setup: django.core.mail.backends.smtp.EmailBackend: mail.authsmtp.com
OS encoding: filesystem=utf-8, default=utf-8
Celery: redis://cache:6379/1, redis://cache:6379/1, regular
Platform: Linux 5.4.0-132-generic (x86_64)

Weblate deploy checks

WARNINGS:
?: (security.W004) You have not set a value for the SECURE_HSTS_SECONDS setting. If your entire site is served only over SSL, you may want to consider setting a value and enabling HTTP Strict Transport Security. Be sure to read the documentation first; enabling HSTS carelessly can cause serious, irreversible problems.
?: (security.W008) Your SECURE_SSL_REDIRECT setting is not set to True. Unless your site should be available over both SSL and non-SSL connections, you may want to either set this setting True or configure a load balancer or reverse-proxy server to redirect all connections to HTTPS.
?: (security.W012) SESSION_COOKIE_SECURE is not set to True. Using a secure-only session cookie makes it more difficult for network traffic sniffers to hijack user sessions.
?: (security.W018) You should not have DEBUG set to True in deployment.

INFOS:
?: (weblate.I021) Error collection is not set up, it is highly recommended for production use
        HINT: https://docs.weblate.org/en/weblate-4.14.2/admin/install.html#collecting-errors
?: (weblate.I028) Backups are not configured, it is highly recommended for production use
        HINT: https://docs.weblate.org/en/weblate-4.14.2/admin/backup.html

System check identified 6 issues (1 silenced).

Additional context

No response

@GregWoods GregWoods added the question This is more a question for the support than an issue. label Dec 9, 2022
@github-actions
Copy link

github-actions bot commented Dec 9, 2022

This issue looks more like a support question than an issue. We strive to answer these reasonably fast, but purchasing the support subscription is not only more responsible and faster for your business but also makes Weblate stronger.

In case your question is already answered, making a donation is the right way to say thank you!

@GregWoods GregWoods changed the title Cannot figure out monolingual XLIFF files Missing target translation when using monolingual XLIFF files Dec 9, 2022
@nijel
Copy link
Member

nijel commented Dec 12, 2022

Your translated file violates XLIFF specification (it lacks <source> element inside <trans-unit>). That confuses translate toolkit (the library we use for parsing translations) and doesn't parse the translation out of that file.

@github-actions
Copy link

This issue has been automatically marked as stale because there wasn’t any recent activity.

It will be closed soon if no further action occurs.

Thank you for your contributions!

@github-actions github-actions bot added the wontfix Nobody will work on this. label Dec 23, 2022
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question This is more a question for the support than an issue. wontfix Nobody will work on this.
Projects
None yet
Development

No branches or pull requests

2 participants