View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 12086 | Bug reports | Plugins | public | 2017-01-27 09:31 | 2020-01-16 16:20 |
| Reporter | DenisChenu | Assigned To | DenisChenu | ||
| Priority | none | Severity | minor | ||
| Status | closed | Resolution | no change required | ||
| Product Version | 3.x | ||||
| Summary | 12086: Review the way of translation for plugin | ||||
| Description | @olle add a translation system for plugin, but i think there are better option. I think
| ||||
| Steps To Reproduce | none ;) | ||||
| Additional Information | The actual way on develop is here : https://github.com/LimeSurvey/LimeSurvey/commit/2b2ac333dd867b7821e60c420ac45420f6eb9ddf See a Proff Of concept (working concept) https://framagit.org/SondagePro-LimeSurvey-plugin/maintenanceMode/blob/3ef3ca4a399fb1debfc4ab17ae419d1bc5e4ec25/maintenanceMode.php#L286 The idea is :
Then :
The hardest part are:
Maybe :
| ||||
| Tags | No tags attached. | ||||
| Bug heat | 6 | ||||
| Complete LimeSurvey version number (& build) | |||||
| I will donate to the project if issue is resolved | |||||
| Browser | |||||
| Database type & version | |||||
| Server OS (if known) | |||||
| Webserver software & version (if known) | |||||
| PHP Version | |||||
| Git branch / Pull Request URL | |||||
|
some idea about config: { { Or maybe: { I think starting by :
|
|
|
type + config seem better (for my POV) |
|
|
create default translation if local exist : can be a solution too @olle spoken for an 'auto load translation if able' |
|
|
Or a default translation config if omitted. |
|
|
yep :) locale directory exist => create the language component :) The difficulty seems to be :
Quick solution ls\pluginmanager\LimesurveyApi->gT(string) call this plugin translation |
|
|
Can you point to the specific place in code that was a problem with my implementation? Did I hack core Yii code? |
|
|
No really an error : just :
My objective is to finally have the easiest and most adaptable way to have translation for plugin. View you code : one (newClass + 1 function) + one way to have message : https://github.com/LimeSurvey/LimeSurvey/commit/2b2ac333dd867b7821e60c420ac45420f6eb9ddf#diff-de5ed4c534457ee3003a9ae2352e4eceR49 + no separation between plugin (same string by different plugin : i didn't track what happen here). There still a lack of feature in the 2 implementation : replace default core string ...... Maybe we have to find a way for this one too. PS : i think using locale/en/en.po is missused : locale/en/message.po seems OK, and more : we can have (in future) locale/en/public.po / locale/en/admin.po / locale/en/wtf.po :) |
|
|
Already have this->gT for plugins |
|
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2017-01-27 09:31 | DenisChenu | New Issue | |
| 2017-01-27 09:41 | DenisChenu | Note Added: 42843 | |
| 2017-01-27 09:41 | DenisChenu | Issue Monitored: ollehar | |
| 2017-01-27 09:41 | DenisChenu | Note Edited: 42843 | |
| 2017-01-27 09:42 | DenisChenu | Note Added: 42844 | |
| 2017-01-27 09:44 | DenisChenu | Note Edited: 42843 | |
| 2017-01-30 12:42 | DenisChenu | Note Added: 42868 | |
| 2017-01-30 12:46 | DenisChenu | Additional Information Updated | |
| 2017-01-30 12:53 | ollehar | Note Added: 42869 | |
| 2017-01-30 13:15 | DenisChenu | Note Added: 42870 | |
| 2017-01-31 15:06 | ollehar | Note Added: 42911 | |
| 2017-01-31 15:28 | DenisChenu | Note Added: 42912 | |
| 2017-06-18 11:33 | DenisChenu | Assigned To | => DenisChenu |
| 2017-06-18 11:33 | DenisChenu | Status | new => assigned |
| 2020-01-16 16:20 | DenisChenu | Status | assigned => closed |
| 2020-01-16 16:20 | DenisChenu | Resolution | open => no change required |
| 2020-01-16 16:20 | DenisChenu | Note Added: 55325 |