WeblateOrg / weblate

Web based localization tool with tight version control integration.
https://weblate.org/
GNU General Public License v3.0
4.56k stars 1.01k forks source link

Addon - Squash Git commits - Template markup not working #7339

Open markoph opened 2 years ago

markoph commented 2 years ago

Describe the issue

I see template markup (variables) in commit message instead of strings these variables represent.

Documentation of addon-weblate-git-squash) indicates it should work:

The original commit messages can optionally be overridden with a custom commit message. See Template markup for the message options.

I already tried

Steps to reproduce the behavior

  1. Go to component addons. Add addon "Squash Git commits".
  2. Configure it as follows:
    • Commit squashing - per file
    • Append trailers to squashed commit message - checked
    • Commit message - use template markup. Eg. Translated using Weblate ({{ language_name }} / {{ filename }})
  3. Check commits. You'll see template markup instead of strings it should generate.

Expected behavior

Template markup should be processed and it should generate strings in place of variables.

Screenshots

Addon configuration: Screenshot from 2022-03-03 09-35-31

Repository maintenance page: Screenshot from 2022-03-03 09-35-49

GitLab MR: Screenshot from 2022-03-03 09-36-29

Exception traceback

No response

How do you run Weblate?

weblate.org service

Weblate versions

No response

Weblate deploy checks

No response

Additional context

No response

nijel commented 2 years ago

The documentation is wrong in this case, it was never supported here.

Also, language-specific variables (for example {{ filename }}) cannot work here because squashing merges commits across translations.

github-actions[bot] commented 2 years ago

This issue has been added to the backlog. It is not scheduled on the Weblate roadmap, but it eventually might be implemented.

In case you need this feature soon, please consider helping or push it by funding the development.

JacekJagosz commented 10 months ago

I think the template for the commit message plugin, when you are configuring it for the first time is still wrong, same as it was those 1.5 years ago.

nijel commented 10 months ago

@JacekJagosz There is no mention of template support there. Can you please clarify what is wrong?

JacekJagosz commented 10 months ago

When you first set this addon up, the default commit message is:

Translated using Weblate ({{ language_name }})

Currently translated at {{ stats.translated_percent }}% ({{ stats.translated }} of {{ stats.all }} strings)

Translation: {{ project_name }}/{{ component_name }} Translate-URL: {{ url }}

And the markdown in it is broken, so it looks like this in git when you commit something. obraz

My suggestion is to remove markdown from the default commit message that appears when you set this plugin up.

nijel commented 10 months ago

That is definitely not the default. The default is a blank string.