View Issue Details

IDProjectCategoryView StatusLast Update
11666Bug reportsPluginspublic2020-03-13 19:25
ReporterDenisChenu Assigned To 
PrioritynoneSeverityminor 
Status newResolutionreopened 
Product Version2.51.x 
Summary11666: Hard to use 'localized" plugins setting option
Description

For a plugin dev , it's hard to use localized in a setting of a plugin:

Steps To Reproduce

Find a way to use localized/multi language setting in a plugin

Additional Information

If localized : settings widget add the language to the name {$name}[$lang] : great : https://github.com/LimeSurvey/LimeSurvey/blob/master/application/extensions/SettingsWidget/SettingsWidget.php#L170

The current must be an array : https://github.com/LimeSurvey/LimeSurvey/blob/master/application/extensions/SettingsWidget/SettingsWidget.php#L269

But we can only senhd an array : name is the key : then you can not really have the same key for multiple language input ..... then you need different input.

Actaully : i fond only a way for fix it adding -$lang to the namle , and some bad hacking when saving : https://framagit.org/SondagePro-LimeSurvey-plugin/adaptEnterErrorSurveyText/blob/master/adaptEnterErrorSurveyText.php#L303

dirty but working

TagsNo tags attached.
Complete LimeSurvey version number (& build)4.1.10 github
I will donate to the project if issue is resolvedNo
Browsernot relevant
Database & DB-Versionnot relevant
Server OS (if known)not relevant
Webserver software & version (if known)not relevant
PHP Versionnot relevant

Activities

DenisChenu

DenisChenu

2016-09-17 18:26

developer   ~40808

Easy solution : allow name in metaData , and get it for the name of the input :

if ($metaData['name']){
$name=$metaData['name'];
}
Here : https://github.com/LimeSurvey/LimeSurvey/blob/master/application/extensions/SettingsWidget/SettingsWidget.php#L163

ANd this can be used for other purpose.

The best way, i think can be: use $metaData['language'] as an array of the language to be used. But this is really more complex actually: one setting must show multiple inpit. And we can not have a good way to show something like this

  • FR
    Input 1 FR
    Input 2 FR
  • EN
    Input 1 EN
    Input 2 EN

Like we have in LS core settings

ollehar

ollehar

2016-10-17 12:17

administrator   ~41395

Did you see my changes on the cint branch regarding localized plugins?

DenisChenu

DenisChenu

2016-10-17 12:22

developer   ~41396

No, not actually :)

But i think it's not related. Here it's the "localized"=>true for settings.
For example : when you want to show a textarea for each language in a survey :
https://framagit.org/SondagePro-LimeSurvey-plugin/adaptEnterErrorSurveyText/blob/master/adaptEnterErrorSurveyText.php#L111

(i update the title to be more clear).

DenisChenu

DenisChenu

2016-11-02 09:25

developer   ~41671

@olle : you have an advice about it ?

$metaData['language'] as array seems OK for you ?
or better allow $metaData['name'] ?
or , maybe : allow $metaData['name'] + fix name if "localized"=>true ?
or : another great idea (or not great)

:)

DenisChenu

DenisChenu

2017-01-25 09:55

developer   ~42830

Tested some code ....

Not OK because we need a 'global' tabs.

Then :

  1. Adding fieldset system
  2. Add a language in fieldset : if the fieldset have language (in array): show all input in this fieldset with each language set
DenisChenu

DenisChenu

2017-01-25 09:55

developer  

c_schmitz

c_schmitz

2020-03-13 18:46

administrator   ~56458

This version of LimeSurvey is not longer supported. Please check so that the issue is fixed in a more recent version of LimeSurvey. If it's not, please reopen this bug report. Thank you.

DenisChenu

DenisChenu

2020-03-13 19:25

developer   ~56529

Still really hard ....

Issue History

Date Modified Username Field Change
2016-09-17 18:21 DenisChenu New Issue
2016-09-17 18:26 DenisChenu Note Added: 40808
2016-10-17 12:17 ollehar Note Added: 41395
2016-10-17 12:22 DenisChenu Note Added: 41396
2016-10-17 12:23 DenisChenu Summary Hard to use 'localized" plugins => Hard to use 'localized" plugins setting option
2016-10-17 12:23 DenisChenu Description Updated View Revisions
2016-10-17 12:23 DenisChenu Steps to Reproduce Updated View Revisions
2016-11-02 00:17 ollehar Assigned To => DenisChenu
2016-11-02 00:17 ollehar Status new => assigned
2016-11-02 09:25 DenisChenu Note Added: 41671
2017-01-25 09:55 DenisChenu Note Added: 42830
2017-01-25 09:55 DenisChenu File Added: Capture du 2017-01-25 09-54-07.png
2020-03-13 18:46 c_schmitz Note Added: 56458
2020-03-13 18:46 c_schmitz Status assigned => closed
2020-03-13 19:25 DenisChenu Assigned To DenisChenu =>
2020-03-13 19:25 DenisChenu Status closed => new
2020-03-13 19:25 DenisChenu Resolution open => reopened
2020-03-13 19:25 DenisChenu Complete LimeSurvey version number (& build) 20160917 => 4.1.10 github
2020-03-13 19:25 DenisChenu Note Added: 56529