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

Discovery module don't create all components #6295

Closed
Loic-Hakisa opened this issue Jul 15, 2021 · 4 comments
Closed

Discovery module don't create all components #6295

Loic-Hakisa opened this issue Jul 15, 2021 · 4 comments
Labels
question This is more a question for the support than an issue.

Comments

@Loic-Hakisa
Copy link

Loic-Hakisa commented Jul 15, 2021

We currently use component discovery to load all our translation configurations.

Our project is split into config and domains (translations/config/domain.language.xliff , for example :

  • translations/CalendarBundle/bo.en.xliff
  • translations/CalendarBundle/messages.en.xliff
  • translations/CalendarBundle/messages.fr.xliff
  • translations/ContactBundle/messages.en.xliff

We use the following Regex in the discovery module:
translations/(?P<component>[^/]*)/[a-z]+\.(?P<language>[^/.]*)\.xliff

Weblate proposes all our bundles and displays several components with the same name because we have several domains per configuration:
decouverte-composants

Once the components are synchronized, the interface displays several components per bundle, since there are several domains per component, which for us is not a problem.
liste-composants

What is problematic is that weblate does not download all the components, we have to restart the component discovery several times to have all the domains...
relancer-decouverte-composants

No error appears in the logs.

Do you have any idea what's going on?
Should we avoid using component discovery in our use case?
Is it possible to create and import a file with the configuration of all our components separated by domain so that weblate creates all the components without using discovery and without the need to manually create the components?

Weblate 4.7.1 using docker on linux

  • Weblate: 4.7.1
  • Django: 3.2.4
  • siphashc: 2.1
  • translate-toolkit: 3.3.6
  • lxml: 4.6.3
  • Pillow: 8.2.0
  • bleach: 3.3.0
  • python-dateutil: 2.8.1
  • social-auth-core: 4.1.0
  • social-auth-app-django: 4.0.0
  • django-crispy-forms: 1.12.0
  • oauthlib: 3.1.1
  • django-compressor: 2.4.1
  • djangorestframework: 3.12.4
  • django-filter: 2.4.0
  • django-appconf: 1.0.4
  • user-agents: 2.2.0
  • filelock: 3.0.12
  • setuptools: 40.8.0
  • jellyfish: 0.8.2
  • openpyxl: 3.0.7
  • celery: 5.1.2
  • kombu: 5.1.0
  • translation-finder: 2.9
  • weblate-language-data: 2021.5
  • html2text: 2020.1.16
  • pycairo: 1.16.2
  • pygobject: 3.30.4
  • diff-match-patch: 20200713
  • requests: 2.25.1
  • django-redis: 5.0.0
  • hiredis: 2.0.0
  • sentry_sdk: 1.1.0
  • Cython: 0.29.23
  • misaka: 2.1.1
  • GitPython: 3.1.18
  • borgbackup: 1.1.16
  • pyparsing: 2.4.7
  • pyahocorasick: 1.4.2
  • python-redis-lock: 3.7.0
  • Python: 3.7.3
  • Git: 2.20.1
  • psycopg2: 2.9.1
  • psycopg2-binary: 2.9.1
  • phply: 1.2.5
  • chardet: 4.0.0
  • ruamel.yaml: 0.17.10
  • tesserocr: 2.5.2
  • akismet: 1.1
  • boto3: 1.17.102
  • zeep: 4.0.0
  • aeidon: 1.9
  • iniparse: 0.5
  • mysqlclient: 2.0.3
  • Mercurial: 5.8
  • git-svn: 2.20.1
  • git-review: 2.1.0
  • Redis server: 6.2.4
  • PostgreSQL server: 13.3
  • Database backends: django.db.backends.postgresql
  • Cache backends: default:RedisCache, avatar:FileBasedCache
  • Email setup: django.core.mail.backends.smtp.EmailBackend: email-smtp.eu-central-1.amazonaws.com
  • OS encoding: filesystem=utf-8, default=utf-8
  • Celery: redis://cache:6379/1, redis://cache:6379/1, regular
  • Platform: Linux 4.14.209-160.339.amzn2.x86_64 (x86_64)

logs-weblate.txt

@Loic-Hakisa Loic-Hakisa added the question This is more a question for the support than an issue. label Jul 15, 2021
@github-actions
Copy link

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!

@nijel
Copy link
Member

nijel commented Jul 15, 2021

I think it groups matches by component part, so in your case the non captured part will be chosen randomly. Better to use something like translations/(?P<component>[^/]*/[a-z]+)\.(?P<language>[^/.]*)\.xliff to include the name in the component name as well.

Alternatively, you can use an additional capture group and name the component differently, see #6270 for example (this will work with 4.7.2 which was just released).

@Loic-Hakisa
Copy link
Author

It seems to work perfectly well, we will continue testing, thank you very much!

@github-actions
Copy link

The issue you have reported is now resolved. If you don’t feel it’s right, please follow its labels to get a clue for further steps.

  • In case you see a similar problem, please open a separate issue.
  • If you are happy with the outcome, don’t hesitate to support Weblate by making a donation.

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.
Projects
None yet
Development

No branches or pull requests

2 participants