Weblate: [Component discovery] Not the same settings as the original component

Created on 23 Aug 2018  路  7Comments  路  Source: WeblateOrg/weblate

Steps to reproduce

  1. Add a 1st component with custom settings (Committer name + email, etc ...)
  2. Follow the Component discovery documentation
  3. Check settings for newly created components (Committer name + email, etc ...)

Actual behaviour

Some settings are not the same as in the original component

Expected behaviour

Most settings should be identical (Committer name, email, Age of changes to commit)

Server configuration and status

  • Weblate 3.1.1
  • Python 3.5.2
  • Django 2.1
  • six 1.11.0
  • social-auth-core 1.7.0
  • social-auth-app-django 2.1.0
  • django-appconf 1.0.2
  • translate-toolkit 2.3.0
  • Whoosh 2.7.4
  • defusedxml 0.5.0
  • Git 2.18.0
  • Pillow 5.2.0
  • python-dateutil 2.7.3
  • lxml 4.2.4
  • django-crispy-forms 1.7.2
  • django_compressor 2.2
  • djangorestframework 3.8.2
  • user-agents 1.1.0
  • jellyfish 0.6.1
  • pytz 2018.5
  • pyuca 1.2
  • python-bidi 0.4.0
  • PyYAML 3.13
  • Database backends: django.db.backends.postgresql_psycopg2
  • Cache backends: default:MemcachedCache
  • Platform: Linux 4.4.0-131-generic (x86_64)
bug good first issue help wanted

All 7 comments

Currently only limited set of fields is copied, it certainly can be extended:

https://github.com/WeblateOrg/weblate/blob/6e51dd8e259a61b0deea260fa3138d6a0d9a7c5c/weblate/trans/discovery.py#L131-L134

Pull requests welcome ;-).

Name and Slug are update with the new component name. Can we do the same for filemask and new_base (base file for new translation) ? For example the filemask of my first component is _component-a/.po_ and with auto-discovery I would like to have it _component-x/.po_

Can I use the get_val() method :
https://github.com/WeblateOrg/weblate/blob/6e51dd8e259a61b0deea260fa3138d6a0d9a7c5c/weblate/trans/discovery.py#L129-L134
So I will have:

        name = get_val('name')
        slug = get_val('slug')
        filemask = get_val('filemask')
        new_base = get_val('new_base')
        simple_keys = (
            'project', 'branch', 'vcs', 'push_on_commit', 'license_url', 'license',
            'committer_name', 'committer_email', 'push_on_commit', 'commit_pending_age', 'language_regex',
        )

The language_regex is filled in by discovery as well, but rest IMHO can be safely included.

Thank you for your report, the issue you have reported has just been fixed.

  • In case you see problem with the fix, please comment on this issue.
  • In case you see similar problem, please open separate issue.
  • If you are happy with the outcome, consider supporting Weblate by donating.

Sorry to not have continue on that task. I was struggling to get my dev environment up and running and then I had to switch to an other task !

@nijel Is there any reason why edit_template is not on that list?

Not really :-). Maybe it was not present back then. Added in 6e6c7b320b.

Was this page helpful?
0 / 5 - 0 ratings