# HG changeset patch # User Thomas De Schampheleire # Date 2020-04-06 21:29:37 # Node ID cd3f326d0ff163c7737e4c5c56147fa129b063c4 # Parent f787c028ffc0ebab6106fdf36f70a11acd73a42c email templates: fix missing translation of titles and buttons The buttons and titles of email templates were not correctly translated. The corresponding strings were not part of the i18n files because they were not recognized by the extraction logic. Note: this will generate new translation strings. Reported-by: Jan Heylen diff --git a/kallithea/templates/email_templates/changeset_comment.html b/kallithea/templates/email_templates/changeset_comment.html --- a/kallithea/templates/email_templates/changeset_comment.html +++ b/kallithea/templates/email_templates/changeset_comment.html @@ -33,7 +33,8 @@ -<%include file="button.html" args="url=cs_comment_url,title=_('View Comment'),padding_bottom=False"/>\ +<% title = _('View Comment') %>\ +<%include file="button.html" args="url=cs_comment_url,title=title,padding_bottom=False"/>\ diff --git a/kallithea/templates/email_templates/changeset_comment.txt b/kallithea/templates/email_templates/changeset_comment.txt --- a/kallithea/templates/email_templates/changeset_comment.txt +++ b/kallithea/templates/email_templates/changeset_comment.txt @@ -13,4 +13,5 @@ ${branch|n,unicode}: ${_('by')|n,unicode} \ ${cs_author.full_name_and_username|n,unicode}. -<%include file="button.txt" args="url=cs_comment_url,title=_('View Comment')"/>\ +<% title = _('View Comment') %>\ +<%include file="button.txt" args="url=cs_comment_url,title=title"/>\ diff --git a/kallithea/templates/email_templates/default.html b/kallithea/templates/email_templates/default.html --- a/kallithea/templates/email_templates/default.html +++ b/kallithea/templates/email_templates/default.html @@ -1,7 +1,8 @@ <%inherit file="main.html"/>\ \ <%block name="header">\ -<%include file="header.html" args="title=_('Message'),link=None"/>\ +<% title = _('Message') %>\ +<%include file="header.html" args="title=title,link=None"/>\ \ \ diff --git a/kallithea/templates/email_templates/password_reset.html b/kallithea/templates/email_templates/password_reset.html --- a/kallithea/templates/email_templates/password_reset.html +++ b/kallithea/templates/email_templates/password_reset.html @@ -1,7 +1,8 @@ <%inherit file="main.html"/>\ \ <%block name="header">\ -<%include file="header.html" args="title=_('Password Reset Request'),link=None"/>\ +<% title = _('Password Reset Request') %>\ +<%include file="header.html" args="title=title,link=None"/>\ \ \
diff --git a/kallithea/templates/email_templates/password_reset.txt b/kallithea/templates/email_templates/password_reset.txt --- a/kallithea/templates/email_templates/password_reset.txt +++ b/kallithea/templates/email_templates/password_reset.txt @@ -1,5 +1,6 @@ <%block name="header">\ -<%include file="header.txt" args="title=_('Password Reset Request'),link=None"/>\ +<% title = _('Password Reset Request') %>\ +<%include file="header.txt" args="title=title,link=None"/>\ \ \ ${_('Hello %s') % user|n,unicode}, diff --git a/kallithea/templates/email_templates/pull_request.html b/kallithea/templates/email_templates/pull_request.html --- a/kallithea/templates/email_templates/pull_request.html +++ b/kallithea/templates/email_templates/pull_request.html @@ -82,7 +82,8 @@
-<%include file="button.html" args="url=pr_url,title=_('View Pull Request'),padding_bottom=False"/>\ +<% title = _('View Pull Request') %>\ +<%include file="button.html" args="url=pr_url,title=title,padding_bottom=False"/>\
diff --git a/kallithea/templates/email_templates/pull_request.txt b/kallithea/templates/email_templates/pull_request.txt --- a/kallithea/templates/email_templates/pull_request.txt +++ b/kallithea/templates/email_templates/pull_request.txt @@ -29,4 +29,5 @@ ${_('Changesets')|n,unicode}: ${h.shorter(desc, 80, firstline=True)|n,unicode} %endfor -<%include file="button.txt" args="url=pr_url,title='View Pull Request'"/>\ +<% title = _('View Pull Request') %>\ +<%include file="button.txt" args="url=pr_url,title=title"/>\ diff --git a/kallithea/templates/email_templates/pull_request_comment.html b/kallithea/templates/email_templates/pull_request_comment.html --- a/kallithea/templates/email_templates/pull_request_comment.html +++ b/kallithea/templates/email_templates/pull_request_comment.html @@ -40,7 +40,8 @@ -<%include file="button.html" args="url=pr_comment_url,title=_('View Comment'),padding_bottom=False"/>\ +<% title = _('View Comment') %>\ +<%include file="button.html" args="url=pr_comment_url,title=title,padding_bottom=False"/>\ diff --git a/kallithea/templates/email_templates/pull_request_comment.txt b/kallithea/templates/email_templates/pull_request_comment.txt --- a/kallithea/templates/email_templates/pull_request_comment.txt +++ b/kallithea/templates/email_templates/pull_request_comment.txt @@ -19,4 +19,5 @@ ${pr_target_repo|n,unicode} \ ${_('branch')|n,unicode} \ ${pr_target_branch|n,unicode} -<%include file="button.txt" args="url=pr_comment_url,title=_('View Comment')"/>\ +<% title = _('View Comment') %>\ +<%include file="button.txt" args="url=pr_comment_url,title=title"/>\ diff --git a/kallithea/templates/email_templates/registration.html b/kallithea/templates/email_templates/registration.html --- a/kallithea/templates/email_templates/registration.html +++ b/kallithea/templates/email_templates/registration.html @@ -2,7 +2,8 @@ <%inherit file="main.html"/>\ \ <%block name="header">\ -<%include file="header.html" args="title=_('New User Registration'),link=registered_user_url"/>\ +<% title = _('New User Registration') %>\ +<%include file="header.html" args="title=title,link=registered_user_url"/>\ \ \ @@ -38,7 +39,8 @@
-<%include file="button.html" args="url=registered_user_url,title=_('View User Profile'),padding_bottom=False"/>\ +<% title = _('View User Profile') %>\ +<%include file="button.html" args="url=registered_user_url,title=title,padding_bottom=False"/>\
diff --git a/kallithea/templates/email_templates/registration.txt b/kallithea/templates/email_templates/registration.txt --- a/kallithea/templates/email_templates/registration.txt +++ b/kallithea/templates/email_templates/registration.txt @@ -1,5 +1,6 @@ <%block name="header">\ -<%include file="header.txt" args="title=_('New User Registration'),link=registered_user_url"/>\ +<% title = _('New User Registration') %>\ +<%include file="header.txt" args="title=title,link=registered_user_url"/>\ \ ${_('Username')|n,unicode}: ${new_username|n,unicode} @@ -8,4 +9,5 @@ ${_('Full Name')|n,unicode}: ${new_full_ ${_('Email')|n,unicode}: ${new_email|n,unicode} -<%include file="button.txt" args="url=registered_user_url,title='View User Profile'"/>\ +<% title = _('View User Profile') %>\ +<%include file="button.txt" args="url=registered_user_url,title=title"/>\