Translate navigation text
-
Maybe you can add function to change language of the buttons:
- Previous
- Next Image
- (1 of 9)
In Dutch that would be:
- Vorige
- Volgende afbeelding
- (1 van 9)
-
I did some eddits to the jsj-gallery-slideshow/jsj-gallery-slideshow.php file. Changed:
// Start Navigation $output .= "<div class='gallery-navigation'>"; $output .= "<a id='galleryPrev-{$instance}' class='gallery-prev gallery-button' href='#'>" . __( 'Previous', 'jsj-gallery-slideshow' ) . "</a>"; $output .= " / <a id='galleryNext-{$instance}' class='gallery-next gallery-button' href='#'>" . __( 'Next Image', 'jsj-gallery-slideshow' ) . "</a>"; $output .= " <span id='galleryNumbering-{$instance}' class='gallery-numbering'></span>"; $output .= "</div>"; // Finish Navigation
Into:
// Start Navigation $output .= "<div class='gallery-navigation'>"; $output .= "<a id='galleryPrev-{$instance}' class='gallery-prev gallery-button' href='#'>" . __( 'Vorige', 'jsj-gallery-slideshow' ) . "</a>"; $output .= " / <a id='galleryNext-{$instance}' class='gallery-next gallery-button' href='#'>" . __( 'Volgende afbeelding', 'jsj-gallery-slideshow' ) . "</a>"; $output .= " <span id='galleryNumbering-{$instance}' class='gallery-numbering'></span>"; $output .= "</div>"; // Finish Navigation
Previous and next image to vorige and volgende afbeelding
Hey datiswous,
This will definitely work, but an even better way is to create a translation file for it.
If you go to the plugin and open the languages/jsj-gallery-slideshow.pot file with something like POEdit https://www.poedit.net/download.php, you can create a translation for the plugin.
Keep in mind that this has field for all text in the plugin and it’s totally fine if you don’t complete every single field, but if you don translate part of the plugin into Dutch ( I think ), then we could actually include it as part of the plugin and could solve this problem for all Dutch speakers.
Again, if you only want to translate some fields (especially those in the frontend of the site), that would already be helpful.
If you’re up for doing this send me an email at jorge.silva @ thejsj . com
J.
Also keep in mind that you might lose these changes when you update your plugin…
Thanks, didn’t know. Should have looked for translation files..
I’m going to look into it, try to translate it. If I come up with something useful, I will contact you.
About your last comment: everything, like changes to css and other files are overwritten when I install a new version. Is it possible to include a custom-file? Like custom.css for the custom css changes. Or is this already possible?
Sounds good!
If you want to customize CSS, you should probably do it in your theme. For most cases, that is better since those CSS changes are related to they way in which your theme interacts with the plugin. In my opinion, theme css should be more customized/specific than plugin CSS. Same goes for CSS when possible.
Let me know if this works!
Can you make two translation files? One for frontend and one for backend?
translation of the back-end is not importend for me (and I think most Dutch people because their English is generally good).
But for the translation on the front-end, it is important.
Or if not, put some text in the pot files to seperate front-end and back-end sections.
Also:
What line in the translation file is for translating: (1 of 10)
In Dutch that has to be: (1 van 10)
Just have one translation file and translate what you can/want. I can only use one translation file for the whole thing and having multiple translation files would be a mess.
A little translation is better than no translation, so don’t worry if you don’t translate the whole thing. Besides, this might help for the next person to come along and translate the rest.
Also, I just pushed a new version of the plugin (1.2.6) that DOES have ‘of’ as a translation string. Update your plugin and see if it works for you.
Thanks.
Ok I will start to translate the frontend part of the language file (probably 3 strings), then try to do some of the rest.
It might be nice if people can set the language in the plugin, instead only for whole the site.
From a programming perspective, I think it would be a really bad idea to make this part of this specific plugin, because WordPress already has way to handle all that. Better to let WordPress handle it, so that it’s more maintainable and easier for users.
There’s thread about this kind of stuff in the web:
https://blog.christosoft.de/2012/02/wordpress-frontend-and-backend-in-different-language/
Let me know how the translation goes!
- The topic ‘Translate navigation text’ is closed to new replies.