View Issue Details

This bug affects 1 person(s).
 10
IDProjectCategoryView StatusLast Update
17825Bug reportsTranslationpublic2022-10-11 22:05
Reportersamarta Assigned Togabrieljenik  
PrioritynoneSeveritytext 
Status closedResolutionfixed 
Product Version5.2.x 
Summary17825: Strings “LimeSurvey internal database” not available for translation in GlotPress
Description

Hi,
The string “LimeSurvey internal database” , in the initial window , in the drop down “Authentication method” does not appears to be translated in GlotPress.
It does not appear translated in Portuguese-PT.
I also checked with Polish and German. All 3 of these languages are already 100% translated.

Attached are two images of the situation in German and Portuguese-PT.

Steps To Reproduce

Check the drop down “Authentication method” in the initial window
Expected result

(Base de dados interna do LimeSurvey)

Actual result

(LimeSurvey internal database)

TagsNo tags attached.
Attached Files
ls_internaldatabase_PT.png (38,146 bytes)   
ls_internaldatabase_PT.png (38,146 bytes)   
ls_internaldatabase_DE.png (34,895 bytes)   
ls_internaldatabase_DE.png (34,895 bytes)   
Bug heat10
Complete LimeSurvey version number (& build)Version 5.2.8+220103
I will donate to the project if issue is resolvedNo
BrowserSafari
Database type & versionmysql 7.4.21
Server OS (if known)centos
Webserver software & version (if known)
PHP Version7.4.21

Users monitoring this issue

There are no users monitoring this issue.

Activities

samarta

samarta

2022-03-09 10:59

reporter   ~68606

Hi,

The issue remains in version 5.3.4+220309

gabrieljenik

gabrieljenik

2022-09-16 16:12

manager   ~71793

@ollehar what do you think about the following.

How about adding a parameter to the newLoginForm event? The new parameter would indicate the name of the authentication method. If it is left empty, it is taken from the same place as now.

ollehar

ollehar

2022-09-16 16:14

administrator   ~71794

Hm, how would that solve the translation issue?

gabrieljenik

gabrieljenik

2022-09-16 16:30

manager   ~71797

Each auth plugin can set their own translation of their plugin name

ollehar

ollehar

2022-09-16 16:33

administrator   ~71798

Yes, but it can only be translated if the text is wrapped in gT(), which I believe is the problem here?

gabrieljenik

gabrieljenik

2022-09-16 16:35

manager   ~71799

Each plugin would send the text already translated... not sure if talking about the same.

ollehar

ollehar

2022-09-16 16:39

administrator   ~71800

Last edited: 2022-09-16 16:39

protected static $name = 'LimeSurvey internal database';  // Missing gT or eT

Hm. Maybe we also need getName() in PluginBase, so that gT is applied.

gabrieljenik

gabrieljenik

2022-09-16 22:33

manager   ~71807

This is how the dropdown is formed. (see attachment)

If we use a method, it will have to be a static method.
Probably i would separate it from the name, as to allow a friendly label to be shown and not the technical name.
So I wouldn't choose the method name to be "getPluginName()", but "getAuthenticationName()", and that could be on the AuthPluginBase.

I prefer the new parameter on the event as it is a bit cleaner as all the exchange in between the plugin and the core would be via event.

What do you think?

As for setting the new parameter, we will not be able to use event->set() as that is not multidimensional and we need to allow all plugins to set a different value each. So I would create a new event method event->setForPlugin($plugin, $key, $value).

That would be very usefull for avoiding workarounds like this (https://github.com/LimeSurvey/LimeSurvey/blob/master/application/core/plugins/ExportR/ExportR.php#L57) where one plugin can easily mess something set by another plugin. (not talking about security, but about overwriting by accident, for example)

Thoughts?

image.png (98,133 bytes)   
image.png (98,133 bytes)   
DenisChenu

DenisChenu

2022-09-19 09:19

developer   ~71810

Last edited: 2022-09-19 09:22

Hm. Maybe we also need getName() in PluginBase, so that gT is applied.

I already done like this before :)
(i stop : i keep the name unchanged now)

Alternative solution : Plugin event can get name for drop-down with another function ?

Then : name of plugin can stay AuthCas for but shown as «Authentification with your CAS account» in this dropdow.

Easy solution

    public function getPublicName()
    {
        return $this->getName();
    }
ollehar

ollehar

2022-09-19 11:22

administrator   ~71819

Last edited: 2022-09-19 11:26

Hmmm, if there's a config.xml, it will read name from there instead. ExtensionConfig::getName(). Would it make sense to put gT() in there? But it should be $plugin->gT() so it would read from plugin translation files first. :d

But yeah, maybe you're right, it should be a separate label, and plugin name should never really be translated anyway...?

DenisChenu

DenisChenu

2022-09-19 11:26

developer   ~71820

You can already translate name in own plugin :
https://github.com/LimeSurvey/LimeSurvey/blob/e871bea897585edf28de26d0723bf02d746210f7/application/libraries/PluginManager/PluginBase.php#L188

No need to add gT globally … just do it for needed part inside needed plugin.

The question about $this->gT is already open somewhere …
Improving translation in core plugin is not improving translation for all other plugin.

Same for SurveyTheme and QuestionTheme : and here : no way …

gabrieljenik

gabrieljenik

2022-09-19 14:17

manager   ~71825

I prefer the new parameter on the event as it is a bit cleaner as all the exchange in between the plugin and the core would be via event.

Thoughts on this?

DenisChenu

DenisChenu

2022-09-19 14:46

developer   ~71827

Last edited: 2022-09-19 14:47

all the exchange in between the plugin and the core would be via event.

No … since it extend a existing Class : for me it's clear it can replace public function of this class.

I really prefer to use getName(); than a new event …
( but prefer to have a dedicated function since i use Class name for name now).

Vote :
Event value : 1
Function call : 1

gabrieljenik

gabrieljenik

2022-09-28 15:14

manager   ~72002

PR: https://github.com/LimeSurvey/LimeSurvey/pull/2637

gabrieljenik

gabrieljenik

2022-09-30 18:43

manager   ~72038

@samarta Not sure about your technical background, but maybe you can help on testing the PR?

Thanks!

gabrieljenik

gabrieljenik

2022-10-06 10:22

manager   ~72138

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

LimeBot

LimeBot

2022-10-10 10:47

administrator   ~72181

Fixed in Release 5.4.5+221010

gabrieljenik

gabrieljenik

2022-10-11 22:05

manager   ~72203

Updated https://manual.limesurvey.org/Authentication_plugin_development#The_authentication_method_name

Related Changesets

LimeSurvey: master b4f9604c

2022-10-06 10:22:05

gabrieljenik


Committer: GitHub Details Diff
Fixed issue 17825: Strings “LimeSurvey internal database” not available for translation in GlotPress (#2637)

Co-authored-by: encuestabizdevgit <devgit@encuesta.biz>
Affected Issues
17825
mod - application/core/plugins/Authdb/Authdb.php Diff File
mod - application/libraries/PluginManager/AuthPluginBase.php Diff File
mod - application/views/admin/authentication/login.php Diff File

Issue History

Date Modified Username Field Change
2022-01-07 11:23 samarta New Issue
2022-01-07 11:23 samarta File Added: ls_internaldatabase_PT.png
2022-01-07 11:23 samarta File Added: ls_internaldatabase_DE.png
2022-03-09 10:59 samarta Note Added: 68606
2022-03-09 10:59 samarta Bug heat 0 => 2
2022-08-04 21:10 gabrieljenik Assigned To => gabrieljenik
2022-08-04 21:10 gabrieljenik Status new => confirmed
2022-09-16 16:12 gabrieljenik Note Added: 71793
2022-09-16 16:12 gabrieljenik Bug heat 2 => 4
2022-09-16 16:14 ollehar Note Added: 71794
2022-09-16 16:14 ollehar Bug heat 4 => 6
2022-09-16 16:30 gabrieljenik Note Added: 71797
2022-09-16 16:33 ollehar Note Added: 71798
2022-09-16 16:35 gabrieljenik Note Added: 71799
2022-09-16 16:39 ollehar Note Added: 71800
2022-09-16 16:39 ollehar Note Edited: 71800
2022-09-16 22:33 gabrieljenik Note Added: 71807
2022-09-16 22:33 gabrieljenik File Added: image.png
2022-09-19 09:19 DenisChenu Note Added: 71810
2022-09-19 09:19 DenisChenu Bug heat 6 => 8
2022-09-19 09:22 DenisChenu Note Edited: 71810
2022-09-19 09:22 DenisChenu Note Edited: 71810
2022-09-19 11:22 ollehar Note Added: 71819
2022-09-19 11:26 ollehar Note Edited: 71819
2022-09-19 11:26 DenisChenu Note Added: 71820
2022-09-19 14:17 gabrieljenik Note Added: 71825
2022-09-19 14:46 DenisChenu Note Added: 71827
2022-09-19 14:47 DenisChenu Note Edited: 71827
2022-09-28 15:14 gabrieljenik Status confirmed => ready for code review
2022-09-28 15:14 gabrieljenik Note Added: 72002
2022-09-28 15:16 gabrieljenik Assigned To gabrieljenik => DenisChenu
2022-09-29 09:27 DenisChenu Assigned To DenisChenu =>
2022-09-29 09:27 DenisChenu Status ready for code review => ready for testing
2022-09-30 18:43 gabrieljenik Note Added: 72038
2022-09-30 18:50 gabrieljenik Assigned To => ollehar
2022-09-30 18:50 gabrieljenik Status ready for testing => ready for merge
2022-10-06 10:22 gabrieljenik Changeset attached => LimeSurvey master b4f9604c
2022-10-06 10:22 gabrieljenik Note Added: 72138
2022-10-06 10:22 gabrieljenik Assigned To ollehar => gabrieljenik
2022-10-06 10:22 gabrieljenik Resolution open => fixed
2022-10-10 10:47 LimeBot Note Added: 72181
2022-10-10 10:47 LimeBot Status ready for merge => closed
2022-10-10 10:47 LimeBot Bug heat 8 => 10
2022-10-11 22:05 gabrieljenik Note Added: 72203