WordPress.org

Ready to get started?Download WordPress

Forums

JSJ Gallery Slideshow
[resolved] Translate navigation text (12 posts)

  1. datiswous
    Member
    Posted 5 months ago #

    Maybe you can add function to change language of the buttons:

    1. Previous
    2. Next Image
    3. (1 of 9)

    In Dutch that would be:

    1. Vorige
    2. Volgende afbeelding
    3. (1 van 9)

    https://wordpress.org/plugins/jsj-gallery-slideshow/

  2. datiswous
    Member
    Posted 5 months ago #

    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

  3. Jorge Silva-Jetter
    Member
    Plugin Author

    Posted 5 months ago #

    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 http://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.

  4. Jorge Silva-Jetter
    Member
    Plugin Author

    Posted 5 months ago #

    Also keep in mind that you might lose these changes when you update your plugin...

  5. datiswous
    Member
    Posted 5 months ago #

    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?

  6. Jorge Silva-Jetter
    Member
    Plugin Author

    Posted 5 months ago #

    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!

  7. datiswous
    Member
    Posted 5 months ago #

    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.

  8. datiswous
    Member
    Posted 5 months ago #

    Also:

    What line in the translation file is for translating: (1 of 10)

    In Dutch that has to be: (1 van 10)

  9. Jorge Silva-Jetter
    Member
    Plugin Author

    Posted 5 months ago #

    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.

  10. datiswous
    Member
    Posted 5 months ago #

    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.

  11. Jorge Silva-Jetter
    Member
    Plugin Author

    Posted 5 months ago #

    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:

    http://wordpress.org/support/topic/wordpress-languages-front-end-french-back-end-dashboard-english?replies=7

    http://blog.christosoft.de/2012/02/wordpress-frontend-and-backend-in-different-language/

    http://stackoverflow.com/questions/3045744/single-backend-language-or-different-frontend-language-in-wordpress

  12. Jorge Silva-Jetter
    Member
    Plugin Author

    Posted 5 months ago #

    Let me know how the translation goes!

Reply

You must log in to post.

About this Plugin

About this Topic