View Issue Details

IDProjectCategoryView StatusLast Update
15520Bug reportsTranslationpublic2019-12-03 15:43
Reporterbebs Assigned Tocdorin  
PrioritynoneSeveritytrivial 
Status assignedResolutionopen 
Product Version3.19.1 
Summary15520: i18n issue: survey welcome message is not translated on registration page (theme and language registration)
Description

To make the registration page more user friendly I want to add the survey welcom message on top.

I copied the welcome div element from welcome.twig to register_messsage.twig
<div class="{{ aSurveyInfo.class.welcome }} text-primary" {{ aSurveyInfo.attr.welcome }}>
{{ processString(aSurveyInfo.welcome,1) }}
</div>

That displayed indeed the welcome message in the main survey language (FR in my case), but it does not get translated when I switch to another language (DE in my case)... whereas translation happens with no problem on the welcom page.

Denis suggested on the forum this might be an issue with language badly set in register.

Steps To Reproduce
  • create a survey with FR as main language, DE as second.
  • add any text as survey welcome message, different in both languages
  • edit the template registration message file to add the welcome message (your-theme/views/subviews/registration/register_message.twig), eg per sample given below for fruity.
  • activate survey, with token to activate registration page
  • try to register... and see that welcome message always displays in FR, even if you set language to DE.
Additional Information

sample content for your-theme/views/subviews/registration/register_message.twig, to test

{#
LimeSurvey
Copyright (C) 2007-2017 The LimeSurvey Project Team / Louis Gac
All rights reserved.
License: GNU/GPL License v2 or later, see LICENSE.php
LimeSurvey is free software. This version may have been modified pursuant
to the GNU General Public License, and as distributed it includes or
is derivative of works licensed under the GNU General Public License or
other free or open source software licenses.
See COPYRIGHT.php for copyright notices and details.

(¯`·._.·(¯`·._.· Registration message._.·´¯)·._.·´¯)

If there is a message on the registration page, like &quot;Survey has not started, or Register now! here it is displayed

#}

{% if registerSuccess %}
<p {{ aSurveyInfo.attr.registermessageb }} >{{ gT("Thank you for registering. You will receive an email shortly.") }}</p>
{% else %}
<div class="{{ aSurveyInfo.class.welcome }} text-primary" {{ aSurveyInfo.attr.welcome }}>
{{ processString(aSurveyInfo.welcome,1) }}
</div>

{% if sStartDate %}
&lt;p {{ aSurveyInfo.attr.registermessagea }} > {{ gT(&quot;You may register for this survey but you have to wait for the {{sStartDate}} before starting the survey.&quot;) }}</p>
{% else %}
&lt;p  {{ aSurveyInfo.attr.registermessageb }} >{{ gT(&quot;You may register for this survey if you wish to take part.&quot;) }}</p>
{% endif %}
&lt;p  {{ aSurveyInfo.attr.registermessagec }} >{{ gT(&quot;Enter your details below, and an email containing the link to participate in this survey will be sent immediately.&quot;) }}</p>

{% endif %}

{% if not empty(aSurveyInfo.aErrors) %}
<ul class='{{ aSurveyInfo.class.maincoldivdivbul }} alert alert-danger list-unstyled' {{ aSurveyInfo.attr.maincoldivdivbul }}>
{% for key, error in aSurveyInfo.aErrors%}
<li>{{ error }}</li>
{% endfor %}
</ul>
{% endif %}

Tagssurvey translation, template, translation
Complete LimeSurvey version number (& build)3.19.1+191009
I will donate to the project if issue is resolvedNo
Browserchromium
Database & DB-VersionMwSQL
Server OS (if known)Linux
Webserver software & version (if known)
PHP Version7

Activities

bebs

bebs

2019-11-01 22:24

reporter   ~54339

issue has been discussed briefly at https://www.limesurvey.org/forum/design-issues/119563-template-issue-survey-welcome-message-is-not-translated-on-registration-page#190602

bebs

bebs

2019-11-01 22:47

reporter   ~54340

demonstration survey FR-DE

bebs

bebs

2019-11-01 22:53

reporter   ~54341

bug is visible online (temporiraly) at http://emfro.vunderatert.lu/index.php/863857?newtest=Y&amp;lang=de ... see the small text line in french... should be German.

bebs

bebs

2019-11-01 22:54

reporter   ~54342

sorry... forgot to mention you need to enable public registration for the bug to be visible... otherwise registration page is not displayed.

Issue History

Date Modified Username Field Change
2019-11-01 22:23 bebs New Issue
2019-11-01 22:24 bebs Note Added: 54339
2019-11-01 22:47 bebs File Added: limesurvey_survey_863857.lss
2019-11-01 22:47 bebs Note Added: 54340
2019-11-01 22:48 bebs Tag Attached: translation
2019-11-01 22:48 bebs Tag Attached: survey translation
2019-11-01 22:48 bebs Tag Attached: template
2019-11-01 22:53 bebs Note Added: 54341
2019-11-01 22:54 bebs Note Added: 54342
2019-12-03 15:43 cdorin Assigned To => cdorin
2019-12-03 15:43 cdorin Status new => assigned