appstore
appstore copied to clipboard
Bad i18n on button for downloading an app release
When visiting the releases page for some app, .e.g,, the calendar app, the button to download that version is phrased incorrectly in German:
It reads "Herunterladen Calendar 1.7.2", but should be "Calendar 1.7.2 herunterladen".
However, I can not fix this in the translations, because the corresponding code uses
trans
instead of blocktrans
.
https://github.com/nextcloud/appstore/blob/1cbe9eb06c3ff19b36e8b7b49771e24cf30d2dbb/nextcloudappstore/core/templates/app/releases.html#L86
@PFischbeck can you create a PR, thanks!
This turns out to be harder than expected... I would like to use a kind of nested translation - I have the following as a block:
{{ object.name }} {{ release.version }}{% if release.is_nightly %} ({% trans 'nightly' %}) {% endif %}
I want the result of that in a variable release_name
, which could then be used like this:
{% blocktrans %}
Download {{ release_name }}
{% endblocktrans %}
However, the first step (saving the result of this block in a variable) is not really possible in vanilla Django. Does anyone see a nice way of doing this?
It is, check https://stackoverflow.com/questions/1070398/how-to-set-a-value-of-a-variable-inside-a-template-code
@BernhardPosselt Do you mean the with
template tag? I don't understand how I would assign the complex block from above to the variable release_name
, since this includes concatenation, an if
, and a translation. The same holds for the blocktrans with
template tag, leading to this problem:
{% blocktrans with release_name=??? %}
Download {{ release_name }}
{% endblocktrans %}
What to put in place of the question marks? Or should I add a custom template tag for this release name generation?