[Koha-bugs] [Bug 25099] Sending a LANG variable to plug-in template
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25099 Nicolas Legrand changed: What|Removed |Added Text to go in the||Make it easier to build release notes||internationalised plug-in ||by sending a LANG variable ||to the plug-in template. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 25099] Sending a LANG variable to plug-in template
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25099 Jonathan Druart changed: What|Removed |Added CC||jonathan.dru...@bugs.koha-c ||ommunity.org Keywords|release-notes-needed| -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 25099] Sending a LANG variable to plug-in template
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25099 Katrin Fischer changed: What|Removed |Added Assignee|koha-b...@lists.koha-commun |nicolas.legr...@bulac.fr |ity.org | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 25099] Sending a LANG variable to plug-in template
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25099 claire.hernan...@biblibre.com changed: What|Removed |Added CC||claire.hernandez@biblibre.c ||om -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 25099] Sending a LANG variable to plug-in template
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25099 Joy Nelson changed: What|Removed |Added Status|Pushed to master|Pushed to stable CC||j...@bywatersolutions.com Version(s)|20.05.00|20.05.00, 19.11.06 released in|| --- Comment #18 from Joy Nelson --- Backported to 19.11.x for 19.11.06 -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 25099] Sending a LANG variable to plug-in template
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25099 Martin Renvoize changed: What|Removed |Added Status|Passed QA |Pushed to master Version(s)||20.05.00 released in|| -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 25099] Sending a LANG variable to plug-in template
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25099 --- Comment #17 from Martin Renvoize --- Nice work everyone! Pushed to master for 20.05 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 25099] Sending a LANG variable to plug-in template
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25099 --- Comment #16 from Katrin Fischer --- I think updating kitchen sink would be a good start. I'd love more general documentaiton than 'read the code' still, but at least there it's all in one place for now. See also: https://wiki.koha-community.org/wiki/Koha_Plugin_Hooks -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 25099] Sending a LANG variable to plug-in template
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25099 --- Comment #15 from didier --- (In reply to Nicolas Legrand from comment #14) > (In reply to Martin Renvoize from comment #13) > > Passing QA, this works well and is a useful addition to the plugin > > architecture. > > > > We do however, need something for the release notes > > What about: “[Bug 25099] Sending a LANG variable to plug-in template”? > > > and even better some > > plugin developer documentation somewhere.. > > There isn't much documentation apart from “take a look at kitchen sink” > right?. I can make some pull requests with internationalized kitchen sink? Add the first Koha version with LANG available? -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 25099] Sending a LANG variable to plug-in template
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25099 --- Comment #14 from Nicolas Legrand --- (In reply to Martin Renvoize from comment #13) > Passing QA, this works well and is a useful addition to the plugin > architecture. > > We do however, need something for the release notes What about: “[Bug 25099] Sending a LANG variable to plug-in template”? > and even better some > plugin developer documentation somewhere.. There isn't much documentation apart from “take a look at kitchen sink” right?. I can make some pull requests with internationalized kitchen sink? -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 25099] Sending a LANG variable to plug-in template
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25099 Martin Renvoize changed: What|Removed |Added Keywords|rel_20_05_candidate |release-notes-needed Status|Signed Off |Passed QA --- Comment #13 from Martin Renvoize --- Passing QA, this works well and is a useful addition to the plugin architecture. We do however, need something for the release notes and even better some plugin developer documentation somewhere.. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 25099] Sending a LANG variable to plug-in template
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25099 Martin Renvoize changed: What|Removed |Added Attachment #104317|0 |1 is obsolete|| --- Comment #12 from Martin Renvoize --- Created attachment 104374 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=104374=edit Bug 25099: Sending a LANG variable to plug-in template To make internationalised plug-ins, it may be useful to get the lang from C4::Languages::getlanguage. This patch adds C4::Languages::getlanguage result to a LANG variable which is sent to the template plugin. In your plugin, you can add a i18n directory containing lang[-DIALECT].inc files with a TOKENS hash like this: [% TOKENS = { PLUGIN_NAME = "Mannequin" PRESENTATION = "Voici un example d'outil." CLICK_ME = "Cliquez moi !" } %] The plugin template can then include such a lang[-DIALECT].inc with a hash containing all the plugin strings: [% TRY %] [% PROCESS "$PLUGIN_DIR/i18n/${LANG}.inc" %] [% CATCH %] [% PROCESS "$PLUGIN_DIR/i18n/default.inc" %] [% END %] The strings are then printed in the template with something like: [% TOKENS.PRESENTATION %] Test plan: 1. apply patch 2. install, enable and run BULAC Mannequin plugin 3. it should print stuff in english by default 4. install french French (fr-FR) 5. change you Koha lang to French 6. run again the plugin 7. ho là là! French! Thanks to Tomàs Cohen and his pay via paypal plug-in from which most ideas in this patch are taken. Signed-off-by: Victor Grousset/tuxayo Signed-off-by: Martin Renvoize -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 25099] Sending a LANG variable to plug-in template
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25099 Victor Grousset/tuxayo changed: What|Removed |Added CC||vic...@tuxayo.net Status|Needs Signoff |Signed Off --- Comment #11 from Victor Grousset/tuxayo --- ho là là ça marche! It works! -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 25099] Sending a LANG variable to plug-in template
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25099 Victor Grousset/tuxayo changed: What|Removed |Added Attachment #104309|0 |1 is obsolete|| --- Comment #10 from Victor Grousset/tuxayo --- Created attachment 104317 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=104317=edit Bug 25099: Sending a LANG variable to plug-in template To make internationalised plug-ins, it may be useful to get the lang from C4::Languages::getlanguage. This patch adds C4::Languages::getlanguage result to a LANG variable which is sent to the template plugin. In your plugin, you can add a i18n directory containing lang[-DIALECT].inc files with a TOKENS hash like this: [% TOKENS = { PLUGIN_NAME = "Mannequin" PRESENTATION = "Voici un example d'outil." CLICK_ME = "Cliquez moi !" } %] The plugin template can then include such a lang[-DIALECT].inc with a hash containing all the plugin strings: [% TRY %] [% PROCESS "$PLUGIN_DIR/i18n/${LANG}.inc" %] [% CATCH %] [% PROCESS "$PLUGIN_DIR/i18n/default.inc" %] [% END %] The strings are then printed in the template with something like: [% TOKENS.PRESENTATION %] Test plan: 1. apply patch 2. install, enable and run BULAC Mannequin plugin 3. it should print stuff in english by default 4. install french French (fr-FR) 5. change you Koha lang to French 6. run again the plugin 7. ho là là! French! Thanks to Tomàs Cohen and his pay via paypal plug-in from which most ideas in this patch are taken. Signed-off-by: Victor Grousset/tuxayo -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 25099] Sending a LANG variable to plug-in template
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25099 --- Comment #9 from Tomás Cohen Arazi --- (In reply to Nicolas Legrand from comment #8) > I let the QA team decide if C4::Languages::getlanguage called from > Koha::Plugin::Base is legit or not :). That's not a problem, Nicolas. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 25099] Sending a LANG variable to plug-in template
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25099 --- Comment #8 from Nicolas Legrand --- I let the QA team decide if C4::Languages::getlanguage called from Koha::Plugin::Base is legit or not :). -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 25099] Sending a LANG variable to plug-in template
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25099 Nicolas Legrand changed: What|Removed |Added Status|In Discussion |Needs Signoff -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 25099] Sending a LANG variable to plug-in template
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25099 Nicolas Legrand changed: What|Removed |Added Attachment #102644|0 |1 is obsolete|| -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 25099] Sending a LANG variable to plug-in template
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25099 --- Comment #7 from Nicolas Legrand --- Created attachment 104309 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=104309=edit Bug 25099: Sending a LANG variable to plug-in template To make internationalised plug-ins, it may be useful to get the lang from C4::Languages::getlanguage. This patch adds C4::Languages::getlanguage result to a LANG variable which is sent to the template plugin. In your plugin, you can add a i18n directory containing lang[-DIALECT].inc files with a TOKENS hash like this: [% TOKENS = { PLUGIN_NAME = "Mannequin" PRESENTATION = "Voici un example d'outil." CLICK_ME = "Cliquez moi !" } %] The plugin template can then include such a lang[-DIALECT].inc with a hash containing all the plugin strings: [% TRY %] [% PROCESS "$PLUGIN_DIR/i18n/${LANG}.inc" %] [% CATCH %] [% PROCESS "$PLUGIN_DIR/i18n/default.inc" %] [% END %] The strings are then printed in the template with something like: [% TOKENS.PRESENTATION %] Test plan: 1. apply patch 2. install, enable and run BULAC Mannequin plugin 3. it should print stuff in english by default 4. install french French (fr-FR) 5. change you Koha lang to French 6. run again the plugin 7. ho là là! French! Thanks to Tomàs Cohen and his pay via paypal plug-in from which most ideas in this patch are taken. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 25099] Sending a LANG variable to plug-in template
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25099 --- Comment #6 from Nicolas Legrand --- (In reply to Tomás Cohen Arazi from comment #5) > (In reply to Nicolas Legrand from comment #4) > > So should we send a LANG variable to template with > > C4::Languages::getlanguage and create an “official way to do translations in > > plug-ins” or should anyone get along with what fits him most and use > > C4::Languages::getlanguage directly from its own plug-in? > > I agree with stashing the LANG variable like this, and also agree it should > be done using getlanguages() as the PayPal plugin does, but in Base.pm. The only problem I see is that one should not reference C4 namespace in Koha namespace :). -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 25099] Sending a LANG variable to plug-in template
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25099 --- Comment #5 from Tomás Cohen Arazi --- (In reply to Nicolas Legrand from comment #4) > So should we send a LANG variable to template with > C4::Languages::getlanguage and create an “official way to do translations in > plug-ins” or should anyone get along with what fits him most and use > C4::Languages::getlanguage directly from its own plug-in? I agree with stashing the LANG variable like this, and also agree it should be done using getlanguages() as the PayPal plugin does, but in Base.pm. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 25099] Sending a LANG variable to plug-in template
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25099 Martin Renvoize changed: What|Removed |Added Keywords||rel_20_05_candidate CC||martin.renvoize@ptfs-europe ||.com -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 25099] Sending a LANG variable to plug-in template
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25099 Nicolas Legrand changed: What|Removed |Added Summary|Sending a LANG variable to |Sending a LANG variable to |template plug-in|plug-in template -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/