Not logged in. · Lost password · Register
Forum: General Help and Support Plugins RSS
[SOLVED] Own localization doesn't work for gallery plugin
Avatar
cziehr #1
Member since Jan 2011 · 576 posts · Location: 10119 Berlin
Group memberships: Members
Show profile · Link to this post
Subject: [SOLVED] Own localization doesn't work for gallery plugin
Hello everyone,

I want to create an own localization for a localization string of the gallery plugin. If the command {{gallery> :namespace:subnamespace?lightbox }} is placed on a page, but there are no images in the subnamespace, the words

Nichts gefunden.

are displayed (which is German and means "nothing found"). I want to replace this by

Keine Bilder gefunden.

(which means "no images found"), because I use the command on a template with the bureaucracy-plugin, and if images become uploaded through the form, they should be displayed automatically, otherwise the hint should be displayed.

But now I made the discovery: In the regular language file for the gallery-plugin, this string is not defined. I found the code for the case that no images are found in the syntax.php-file of the plugin:

        //anything found?
        if(!count($files)){
            $ret .= '<div class="nothing">'.$lang['nothingfound'].'</div>';
            return $ret;
        }

It seems that this is no localization of the gallery-plugin, but a localization of the main language file of DokuWiki.

So the way as described in https://www.dokuwiki.org/localization with creating the file /conf/plugin_lang/gallery/de/lang.php with the language string (like I did it before for other plugins) doesn't work (I've tried it).

My question is:
Does anybody has a clue what to do in this situation? I don't want to hack the plugin code, because after every upgrade of the plugin I will have to change it again. The second option would be to change it in the plugin code of the gallery-plugin at github (which is no problem for me), but I don't know if the pull-request would be accepted, because then every other localization than German and English (which I can provide) has a missing localization string.

Greetings,
Christoph

PS: I probably needed more time to create this topic than manually fix the localization of the gallery plugin after every upgrade in the next 10 years, but I really hate fixing own hacks after upgrades...
This post was edited on 2019-01-05, 21:52 by cziehr.
Edit reason: Typo
Avatar
LarsDW223 #2
Member since Sep 2014 · 399 posts · Location: Paderborn
Group memberships: Members
Show profile · Link to this post
IMHO a change in the gallery plugin itself would be the best solution. Maybe just open an issue for the gallery plugin before wasting time in a PR. Then you can just ask if a PR would be accepted.
Avatar
cziehr #3
Member since Jan 2011 · 576 posts · Location: 10119 Berlin
Group memberships: Members
Show profile · Link to this post
Thanks for your answer, Lars.

I've created an issue at github: https://github.com/splitbrain/dokuwiki-plugin-gallery/issu…

EDIT: I've created a pull request which was confirmed a few minutes ago. So my problem is solved.
This post was edited on 2019-01-05, 21:51 by cziehr.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2019-06-17, 02:52:56 (UTC +02:00)