Languages...

Page: 1

Author Post
Member
Registered: May 2009
Posts: 88
I like the language options..but in my case i have users pick the lang they want to use within my site...the site it translated in 5 language, and the majority of them do not have the browser or local lang set on their computer.. how can i change (for example) the word close in the window to my code...not using the nl.json file..
steve
Administrator
Registered: Aug 2008
Posts: 3382
The language option determines which language file is used. The default setting of "auto" means site visitors will get the language file that matches the language localization of the the browser they are using. You could dynamically allocate a language file by manipulating the language option inside fbPageOptions. Suppose you set a variable called pageLang to the two letter language code you want to use. Then in your <head> section you could say:
<script type="text/javascript">//<![CDATA[
fbPageOptions = {
language: pageLang
};
//]]></script>
« Last edit by admin on Fri May 15, 2009 9:53 pm. »
Member
Registered: May 2009
Posts: 88
that did help..but only with the hints...what is the var for the word Close..
THANKS
Steve
Administrator
Registered: Aug 2008
Posts: 3382
fb.strings.hintClose
That's the tooltip text you get when you hover over the close button.

Maybe you are trying to target the word "Close" that you see on the button itself??? That's not a string. That's baked in to the background image for that control.

You have two choices for the type of controls used, controlled by the "graphicsType" option. See the options reference for details on this.

Here's a sample of the background image used for the close button. The graphicsType option controls whether you get the left side or right side of this background image.
User posted image
« Last edit by admin on Wed May 13, 2009 6:38 pm. »
Member
Registered: May 2009
Posts: 88
i have ...

customStrings = {
"hintClose": "Sluiten (toets: Esc...)",
...

but in the fb window it shows Close (the mouse over hint does show the custom text)

Make sense?
THANKS!
Steve
Administrator
Registered: Aug 2008
Posts: 3382
I'm a step ahead of you. :) See my edit to my previous post.
Member
Registered: May 2009
Posts: 88
:P that gave me 2 ideas.. 1 just use the X as everyone understands that... 2nd can the close_black.gif be called on the fly..

i.e... close_black_en.gif - close_black_es.gif etc....
Steve
Administrator
Registered: Aug 2008
Posts: 3382
If you've got custom background gifs, you could dynamically style up the close button from an afterBoxStart action in your fbPageOptions object.
<script type="text/javascript">//<![CDATA[
fbPageOptions = {
afterBoxStart: function() { fb.lastChild.fbClose.style.backgroundImage = "url(<pathToFile>/close_black_es.gif)"; }
};
//]]></script>


If you want the mouse-over highlighting of the controls, you'll need both the upper and lower parts of your custom graphic, similar to the built in ones, and you'll need those two parts to align perfectly pixel for pixel with variation only in the coloring.
« Last edit by admin on Fri May 15, 2009 9:54 pm. »

Page: 1