Topic: Captions - Multilanguage possible ?

Hello,

is there any uncomplicated possibility to display captions in the current language of the visitor ?

e.g.:

define captions for two languages (e.g. german/english). if the visitor is from germany, he can see only the german captions, any other visitors from any country can see only the english captions.

is that possible ?

Re: Captions - Multilanguage possible ?

You would need to create two separate XML files (one with German captions and the other with English captions).
Then, in your gallery's embedding code, you would need to detect the user's language and use the appropriate XML file.
For example, the default code will default to using the XML file with German captions but if English is detected as the user's browser language, then the XML file with the English captions will be used instead.

<!--START SIMPLEVIEWER EMBED.-->
<script type="text/javascript" src="svcore/js/simpleviewer.js"></script>
<script type="text/javascript">
var flashvars={};
flashvars.galleryURL="german.xml";
var language=navigator.language;
if (language.indexOf("en") > -1)
{
    flashvars.galleryURL="english.xml";
}
simpleviewer.ready(function () {
simpleviewer.load("sv-container", "100%", "100%", "222222", true, flashvars);
});
</script>
<div id="sv-container"></div>
<!-- END SIMPLEVIEWER EMBED -->
Steven Speirs
SimpleViewer Support Team.

Re: Captions - Multilanguage possible ?

Hello,

thanks for your reply. Sorry it took so long, but i was very busy and couldn't try your code. But now, i did it and it does not work. I get only a white page. If i look at the source, i can see that my language variable is correctly set.

So i tried your code without the language detection (only the flashvar and the load part), and i get a white page too.

I don't know how to debug this. Can this problem be caused by SvManager ? (the galleries are created with SvManager).

Re: Captions - Multilanguage possible ?

I don't know how to debug this. Can this problem be caused by svManager ? (the galleries are created with SvManager).

You would need to edit either the 'index.php' files created by svManager in each gallery folder (after the galleries have been created) or svManager's 'svManager/plugins/simpleviewer2/sv2master/index.php' template file so that all galleries created have this modification.

I get only a white page.

Please post the URL to your gallery so that I can take a look.

Steven Speirs
SimpleViewer Support Team.

Re: Captions - Multilanguage possible ?

Hi,

thanks again - i found the error, it was a syntax error in javascript i did... now it works wink
Did the same with the prerefences.txt, as is contains the gallery title name.

Thanks for your help !