weblate icon indicating copy to clipboard operation
weblate copied to clipboard

Weblate commits the repository when getting texts using the translation file API

Open derkoe opened this issue 1 year ago • 2 comments

Describe the issue

When calling the REST API to get the translations as a file, Weblate commits the current repository. This also leads to a repository push (with the default settings).

See also https://github.com/porscheinformatik/weblate-spring/issues/38

I already tried

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

Steps to reproduce the behavior

  1. Open any component
  2. Translate a single text for a language
  3. Call https://{{weblate-instance}}/api/translations/{{project}}/{{component}}/{{language}}/units/?q=state%3A%3E%3Dtranslated
  4. The change from above is committed into the repository

Expected behavior

The change should only be committed after the Age of changes to commit is over.

Screenshots

No response

Exception traceback

No response

How do you run Weblate?

Docker container

Weblate versions

  • Weblate: 4.13.1
  • Django: 4.0.5
  • siphashc: 2.1
  • translate-toolkit: 3.7.1
  • lxml: 4.6.5
  • Pillow: 9.1.1
  • 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.0
  • django-compressor: 4.0
  • djangorestframework: 3.13.1
  • django-filter: 22.1
  • django-appconf: 1.0.5
  • user-agents: 2.2.0
  • filelock: 3.7.1
  • jellyfish: 0.9.0
  • openpyxl: 3.0.10
  • celery: 5.2.7
  • kombu: 5.2.4
  • translation-finder: 2.13
  • weblate-language-data: 2022.5
  • html2text: 2020.1.16
  • pycairo: 1.21.0
  • pygobject: 3.42.1
  • diff-match-patch: 20200713
  • requests: 2.28.1
  • django-redis: 5.2.0
  • hiredis: 2.0.0
  • sentry_sdk: 1.6.0
  • Cython: 0.29.30
  • misaka: 2.1.1
  • GitPython: 3.1.27
  • borgbackup: 1.2.1
  • pyparsing: 3.0.9
  • pyahocorasick: 1.4.4
  • python-redis-lock: 3.7.0
  • charset-normalizer: 2.1.0
  • Python: 3.10.5
  • Git: 2.30.2
  • psycopg2: 2.9.3
  • psycopg2-binary: 2.9.3
  • phply: 1.2.5
  • ruamel.yaml: 0.17.21
  • tesserocr: 2.5.2
  • boto3: 1.24.21
  • zeep: 4.1.0
  • aeidon: 1.11
  • iniparse: 0.5
  • mysqlclient: 2.1.1
  • Mercurial: 6.1.4
  • git-svn: 2.30.2
  • git-review: 2.3.1
  • Redis server: 6.2.7
  • PostgreSQL server: 11.16
  • Database backends: django.db.backends.postgresql
  • Cache backends: default:RedisCache, avatar:FileBasedCache
  • Email setup: django.core.mail.backends.smtp.EmailBackend: mailz.porsche.co.at
  • OS encoding: filesystem=utf-8, default=utf-8
  • Celery: redis://localhost:6379/1, redis://localhost:6379/1, regular
  • Platform: Linux 3.10.0-1160.71.1.el7.x86_64 (x86_64)

Weblate deploy checks

System check identified some issues:

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

System check identified 1 issue (1 silenced).

Additional context

We use the API to get the translated strings in non-PROD environments to directly reflect the changes in the user interface using https://github.com/porscheinformatik/weblate-spring/. This leads to lots of commits and pushes to our repositories. As we query the API quite frequently nearly every change leads to a push.

derkoe avatar Jul 28 '22 12:07 derkoe

This is currently expected - Weblate needs to generate up-to-date file for the download, and it does that by saving it to the repository.

nijel avatar Jul 28 '22 12:07 nijel

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[bot] avatar Aug 08 '22 02:08 github-actions[bot]