View Issue Details

This bug affects 1 person(s).
 8
IDProjectCategoryView StatusLast Update
18414Bug reportsTranslationpublic2022-11-01 10:59
ReporterMazi Assigned Togabrieljenik  
PriorityhighSeverityminor 
Status closedResolutionfixed 
Product Version5.4.x 
Summary18414: "Add line" button label can not be translated
Description

At the LS 5.x multi short text question type which allows adding new lines using the "Add line" button, the button label does not seem to be available for trasnlation.
I was searching the German translation at https://translate.limesurvey.org/projects/limesurvey-4/de/default/ but was unable to find this. Probably the code is missing the translation function to get applied.

Steps To Reproduce

Steps to reproduce

Create a 1 question survey with multi text dynamic question type in non-English language. Run the survey and check the button label.
Check https://translate.limesurvey.org/projects/limesurvey-4/de/default/ for your language if you can find the "Add line" label for translation.

Expected result

"Add line" should be available for translations at https://translate.limesurvey.org/projects/limesurvey-4

Actual result

No translation available, the label is always shown in English.

TagsNo tags attached.
Bug heat8
Complete LimeSurvey version number (& build)5.4.3
I will donate to the project if issue is resolvedNo
BrowserChrome
Database type & versionMariaDB 10.1.48
Server OS (if known)Ubuntu 20
Webserver software & version (if known)Apache
PHP Version7.4

Relationships

related to 18437 acknowledged Untranslatable texts on Fruity settings 

Users monitoring this issue

There are no users monitoring this issue.

Activities

c_schmitz

c_schmitz

2022-10-13 14:28

administrator   ~72232

Last edited: 2022-10-13 17:01

Some information on how to fix it:
The translation is in \themes\question\inputondemand\survey\questions\answer\multipleshorttext\answer.twig.
The problem is apparently that these twig files (at least the one in /themes/question) are not picked up by the function actionGenerateTwigTmpFiles.

This is a console command to create/compile temporary .php files from the twig files to the twig_cache directory, where they are then picked up by our translation tools.

You can run it this way:

/usr/bin/php application/commands/console.php Twig generateTwigTmpFiles

gabrieljenik

gabrieljenik

2022-10-17 22:14

manager   ~72311

https://github.com/LimeSurvey/LimeSurvey/pull/2674

c_schmitz

c_schmitz

2022-10-18 16:34

administrator   ~72338

Last edited: 2022-10-18 16:36

Gabriel, please extend generateTwigTmpFiles so it properly creates the tmp files for all twig files..

"Add line" was just an example - I bet there are more strings that are currently not picked up and also this will avoid to have all strings duplicated in a normal PHP file.

gabrieljenik

gabrieljenik

2022-10-18 16:45

manager   ~72342

Got it! Sorry :)

gabrieljenik

gabrieljenik

2022-10-19 16:23

manager   ~72365

PR 2674 is replaced by PR 2678, which is a broader and more general solution.

https://github.com/LimeSurvey/LimeSurvey/pull/2678

gabrieljenik

gabrieljenik

2022-10-19 16:24

manager   ~72366

On some comments in the code, it is mentioned that some twig files may not be reached by the temp rendering process.
Ex: When you have an included inside an if.

An alternative solution for that could be to just scan the twig files and render all of them.
So, instead of rendering the main file and hoping to include the child files, we just render them all.

DenisChenu

DenisChenu

2022-10-25 09:00

developer   ~72397

@c_schmitz : maybe you want to review too ?

gabrieljenik

gabrieljenik

2022-10-26 10:52

manager   ~72431

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=33997

gabrieljenik

gabrieljenik

2022-10-26 15:36

manager   ~72434

I believe this could be a good enhancement for the future:
https://bugs.limesurvey.org/view.php?id=18414#c72366

Also, maybe we can parse question themes XML for translating question attributes as well.
What do you think?

New ticket?

LimeBot

LimeBot

2022-11-01 10:59

administrator   ~72504

Fixed in Release 5.4.9+221101

Related Changesets

LimeSurvey: master c13e1723

2022-10-26 12:51

gabrieljenik

Committer: GitHub


Details Diff
Fixed issue 18414: Missing translations (#2678) Affected Issues
18414
mod - application/commands/TwigCommand.php Diff File

Issue History

Date Modified Username Field Change
2022-10-13 12:43 Mazi New Issue
2022-10-13 14:28 c_schmitz Note Added: 72232
2022-10-13 14:28 c_schmitz Bug heat 0 => 2
2022-10-13 14:28 c_schmitz Note Edited: 72232
2022-10-13 14:29 c_schmitz Assigned To => gabrieljenik
2022-10-13 14:29 c_schmitz Status new => assigned
2022-10-13 14:32 c_schmitz Priority none => high
2022-10-13 14:33 c_schmitz Note Edited: 72232
2022-10-13 17:01 c_schmitz Note Edited: 72232
2022-10-17 22:14 gabrieljenik Assigned To gabrieljenik => DenisChenu
2022-10-17 22:14 gabrieljenik Status assigned => ready for code review
2022-10-17 22:14 gabrieljenik Note Added: 72311
2022-10-17 22:14 gabrieljenik Bug heat 2 => 4
2022-10-18 08:18 DenisChenu Assigned To DenisChenu =>
2022-10-18 08:18 DenisChenu Status ready for code review => ready for testing
2022-10-18 16:34 c_schmitz Assigned To => gabrieljenik
2022-10-18 16:34 c_schmitz Note Added: 72338
2022-10-18 16:36 c_schmitz Note Edited: 72338
2022-10-18 16:36 c_schmitz Status ready for testing => assigned
2022-10-18 16:45 gabrieljenik Note Added: 72342
2022-10-19 16:23 gabrieljenik Note Added: 72365
2022-10-19 16:24 gabrieljenik Note Added: 72366
2022-10-19 16:35 gabrieljenik Assigned To gabrieljenik => DenisChenu
2022-10-19 16:35 gabrieljenik Status assigned => ready for code review
2022-10-25 09:00 DenisChenu Assigned To DenisChenu =>
2022-10-25 09:00 DenisChenu Status ready for code review => ready for testing
2022-10-25 09:00 DenisChenu Note Added: 72397
2022-10-25 09:00 DenisChenu Bug heat 4 => 6
2022-10-26 10:28 c_schmitz Assigned To => gabrieljenik
2022-10-26 10:52 gabrieljenik Changeset attached => LimeSurvey master c13e1723
2022-10-26 10:52 gabrieljenik Note Added: 72431
2022-10-26 10:52 gabrieljenik Resolution open => fixed
2022-10-26 11:06 c_schmitz Status ready for testing => resolved
2022-10-26 15:36 gabrieljenik Note Added: 72434
2022-10-31 14:08 gabrieljenik Relationship added related to 18437
2022-11-01 10:59 LimeBot Note Added: 72504
2022-11-01 10:59 LimeBot Status resolved => closed
2022-11-01 10:59 LimeBot Bug heat 6 => 8