View Issue Details

IDProjectCategoryView StatusLast Update
15267Bug reports[All Projects] Otherpublic2019-10-04 13:15
Reporterollehar Assigned Toeddylackmann  
PrioritynoneSeveritymajor 
Status confirmedResolutionopen 
Product Version4.0.0-RC3 
Target Version4.0.0-RC4Fixed in Version 
Summary15267: Translation strings in vue templates must be picked up by glotpress
Description

Title.

Example:

assets/packages/textelements/src/TextElementsApp.vue

215 <label for="">{{'Decimal mark' | translate }}</label>

Adapt the glotpress regexp that scans PHP-files?

TagsNo tags attached.
Complete LimeSurvey version number (& build)latest
I will donate to the project if issue is resolvedNo
Browser-
Database & DB-Version-
Server OS (if known)-
Webserver software & version (if known)-
PHP Version-

Relationships

related to 15146 new missing translation 

Activities

ollehar

ollehar

2019-10-02 11:59

administrator   ~53820

Can someone explain to me why it's not possible to simply adjust the regexp to feed these translations to globpress? Why do we need to put twig file gT into php files?

ollehar

ollehar

2019-10-02 12:12

administrator   ~53821

@LouisGac? ^

LouisGac

LouisGac

2019-10-02 12:36

manager   ~53822

because there is nothing like "a regexp" to adjust.
there is a bunch of spaghetti code hard to read. So on my side, I just preferred to add a command line to generate the twig cache: php files that glotpress can parse. Also, this twig command line could be used to pregenerate the cache when activating the survey to increase performance of the system, or be part of a cache flush system (eg: after update delete all tmp directories to remove unused duplicates, but then launch twig tmp file generation to recreate all the assets and so avoiding first survey taker to face some display bugs or something ). So creating the twig command line was using time in a more productive way than trying to hack the Glot Parser.

Btw: many people, like a lot, tried to hack the glot press parser to make it compatible with twig. All of them finally decided to use the twig cache method.

For vuejs, knowing it can use a "twig compatible syntax", I'd suggest to replace the translate filter by a gT function, then to move all the html in different files (not mixed with vuejs logic, just pure HTML and {{ }} ), and finally to use twig to create php files out of it. Then, just register to the Unbelievable Hackish Nobels.

ollehar

ollehar

2019-10-02 12:41

administrator   ~53823

OK, but somewhere there is some code that says "read gT() inside PHP file", no? So it should be able to expand to "read gT() inside twig file"?

LouisGac

LouisGac

2019-10-02 13:38

manager   ~53824

since you repeat your question in a different way, I will just repeat my answer in a different way. I didn't waste too much time reading GlotPress code. I tried a bit, then I googled, then I see that anyone who tried just felt in the "twig cache solution", then I thought it could be useful for LimeSurvey to deal with cash flush/asset regeneration, then I did the Twig Command Line tool.

LouisGac

LouisGac

2019-10-02 17:18

manager   ~53858

BTW:
Integrating WordPress Javascript Translations with Vue.js
https://v-bind.com/wordpress-javascript-translations-with-vue-js/

So, googling > debatting :)

ollehar

ollehar

2019-10-02 18:33

administrator   ~53864

You should learn to read code, Louis, not only write code. <3

eddylackmann

eddylackmann

2019-10-04 13:05

developer   ~53879

so @ollehar wich solution did you suggest ?

ollehar

ollehar

2019-10-04 13:15

administrator   ~53880

First step: Find the code which scans PHP files for gT/eT/...
Second step: Modify that code to also include Twig and Vuejs files

Issue History

Date Modified Username Field Change
2019-09-11 12:17 ollehar New Issue
2019-09-11 12:17 ollehar Summary Translation string in vue templates must be picked up by glotpress => Translation strings in vue templates must be picked up by glotpress
2019-09-11 12:17 ollehar Description Updated View Revisions
2019-09-11 17:39 cdorin Relationship added related to 15146
2019-10-02 11:04 eddylackmann Assigned To => eddylackmann
2019-10-02 11:04 eddylackmann Status new => confirmed
2019-10-02 11:59 ollehar Note Added: 53820
2019-10-02 12:12 ollehar Note Added: 53821
2019-10-02 12:36 LouisGac Note Added: 53822
2019-10-02 12:41 ollehar Note Added: 53823
2019-10-02 13:38 LouisGac Note Added: 53824
2019-10-02 17:18 LouisGac Note Added: 53858
2019-10-02 18:33 ollehar Note Added: 53864
2019-10-04 13:05 eddylackmann Note Added: 53879
2019-10-04 13:15 ollehar Note Added: 53880