• Resolved Philstix

    (@philstix)


    I’m now using WP Photo Album Plus with qTranslate for a site in English, Dutch, German and French. I’m extremely impressed with the amount of thought and effort you have put into this plugin.

    I use the qTranslate dropdown control to switch languages, so that for example the url of https://mysite/info will automatically change to https://mysite/nl/info when I switch from English to Dutch.

    If I run WP Photo Album Plus without subsequently changing languages it’s fine – it detects the locale and uses that to display text in the correct language.

    The problem is that if I then change the locale with qTranslate’s dropdown control WP Photo Album Plus doesn’t detect the change and stays in the same language that applied when it was started.

    So if I’m displaying the photo gallery page in Dutch the url is https://mysite/nl/photo-gallery/ and if I then start a slideshow from that page the url becomes https://mysite/nl/photo-gallery/?locale=nl_NL&wppa-album=3&wppa-slide&wppa-occur=2&wppa-photo=20 and the slideshow starts with Dutch text displayed correctly.

    If during the slideshow I change the locale, say from Dutch to German, the url changes to https://mysite/de/photo-gallery/?locale=nl_NL&wppa-album=3&wppa-slide&wppa-occur=2&wppa-photo=20 so that the rest of the page is in German but the slideshow text is still in Dutch.

    Is there any way I can make WP Photo Album Plus dynamically change its locale while a slide show is running?

    I have tried both the old and new shortcode / script alternatives without success. I was hoping there might be a locale attribute to set the locale but I couldn’t see anything in the reference pages. Is there perhaps some php I could run in a foreign shortcode to change the locale?

    https://www.ads-software.com/extend/plugins/wp-photo-album-plus/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Jacob N. Breetvelt

    (@opajaap)

    Is there any way I can make WP Photo Album Plus dynamically change its locale while a slide show is running?

    No, that is not possible as the slideshow data is already local, changing the slide is entirely done with js, using the data in the language the page was created.

    Why would one want to change the language there? Is this a pure academic issue or does it have any practical use?

    Thread Starter Philstix

    (@philstix)

    No this is not academic, it is relevant to the site I’m developing.

    The user is free to change the language at any time using the qTranslate dropdown control. That causes a different version of the page to be loaded, one with a different language and a different url. The same WP Photo Album Plus shortcode is in each version of the page.

    I thought that when I changed the language while a slide show was running that the slideshow would stop (because I’m opening a different page) and the shortcode in the new page would cause a new slideshow to start, taking the locale of the new page. It seems that either the original slideshow keeps running or, if a new slideshow is started by the new page, it uses the locale set by the first page.

    Thread Starter Philstix

    (@philstix)

    I’ve done a bit more testing with it, and it looks like it does start a new slideshow running, but it keeps the old locale setting.

    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    This makes sense. I will see if i can change the priority of searching for a locale such that if one is set (by qTranslate) it should have precedence over the locale in the querystring.

    To be continued…

    Thread Starter Philstix

    (@philstix)

    I’ve come up with a workaround for the problem.

    I renamed each album using qTranslate shortcodes of the form:
    `[:en]English Title[:nl]Dutch Title[:de]German Title[:fr]French Title’ in the album title input box.

    Then I changed the way I loaded the slideshow by using WPPA+ scripts instead of shortcodes, and referring to the album by the localised name instead of by number:
    English page: %%wppa%% %%slide=”$English Title”%%
    Dutch page: %%wppa%% %%slide=”$Dutch Title”%%
    German page: %%wppa%% %%slide=”$German Title”%%
    French page: %%wppa%% %%slide=”$French Title”%%

    I also had to disable the WPPA+ link from the album cover photo I’m using, and manually create links to each slideshow page to make sure it went to the page with the correct locale.

    It’s a workaround rather than a solution, but it gets the job done ??

    Thanks again for this wonderful plugin.

    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    That causes a different version of the page to be loaded, one with a different language and a different url. The same WP Photo Album Plus shortcode is in each version of the page.

    This is not needed, you can have all languages in one page.

    I renamed each album using qTranslate shortcodes of the form:

    [:en]English Title[:nl]Dutch Title[:de]German Title[:fr]French Title’ in the album title input box.

    This is how you should do it.

    English page: %%wppa%% %%slide=”$English Title”%%
    Dutch page: %%wppa%% %%slide=”$Dutch Title”%%
    German page: %%wppa%% %%slide=”$German Title”%%
    French page: %%wppa%% %%slide=”$French Title”%%

    This is not recommended, numbers should do.

    I did some testing in my docs site: https://wppa.opajaap.nl/ and can not reproduce the problem. I tested with the qTranslate settings (advanced) Query mode (my default) and pre-path (as it is now) but both ways work.
    I also tested it with and without &locale=... : i removed:

    //	if ( $wppa_locale ) {
    //		if ( $key == 'js' ) $pl .= 'locale='.$wppa_locale.'&';
    //		else $pl .= 'locale='.$wppa_locale.'&';
    //	}

    from wppa-functions.php in the routine function wppa_get_permalink() as it seems to be redundant and it shortens the permalink. Still correct behaviour.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Changing the locale’ is closed to new replies.