solved Automatic Default spanish language not working

alt=
@luis789
9 years ago
94 posts
Could you please help with is issue. My site is 90% for the spanish population and a lot of times with the Spanish audience see an English site, they exit.
I tried changing the default language to Spanish, in the users account but the es-ES option is not showing(see image). I uploaded the es-ES.php file to coreLang and still it will not show.
In the jrNova Skin, when I switch to Spanish language it will not work either.
I even applied the fix from this tread
https://www.jamroom.net/the-jamroom-network/forum/new_posts/9311/language-changes-when-i-login-or-logout/search_string=language
Still no luck.

I tried adding the this code in the header.tpl {jr_lang_prepare skin="jrNova" default="es-ES"}
same issue.

The flags works fine, but the point is that I want to change the default language to Spanish when people go to the site they can see the site on Spanish with out the need to select a different language from the flags.

I seen a few treads regarding this issue, but so far no fix.
Than You
languageissue.png
languageissue.png  •  37KB


updated by @luis789: 07/05/16 09:21:14PM
douglas
@douglas
9 years ago
2,794 posts
Once you've changed the default language in the users account, you'll want to clear your browser cookies for your website.

After you've changed the default language, all new users will see the default language, others will have to clear their browser cookies for your site as well.


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
alt=
@luis789
9 years ago
94 posts
Thank for your feedbak Douglas..
Done that. Also, run integrity check, reset catches.. tried from different browsers, different pcs, devices.
Same issue..
michael
@michael
9 years ago
7,750 posts
This thread outlines the issue pretty thoroughly.

https://www.jamroom.net/the-jamroom-network/forum/design-and-skin-customization/9311/language-changes-when-i-login-or-logout

You've tried all the suggestions in there?
michael
@michael
9 years ago
7,750 posts
Just went and had a look at the code for this and think I know what might be happening.

The code reads:
* if the user is logged in, use their default language, otherwise
* if the user has clicked on a language flag, use that, otherwise
* if the user is using a browser in a particular language, use that, otherwise
* use the default language set in the ACP.

So if a user visits your site with a spanish version of FireFox or other browser, the site will default to spanish. If they visit with an english browser, the site will default to english.

If the language of the browser can not be detected or is not set, then it will fall through to your default language.

On your site you have english, I am using an english browser, so english displays by default. If i click spanish then spanish displays.

If I change to using a japanese browser spanish displays.
michael
@michael
9 years ago
7,750 posts
Here's a way to ignore the browsers settings and force your site to spanish for anyone who has never clicked on the language button and is not logged in.

What it does is it checks for a language setting and if no setting is found it sets spanish as the default language and refreshes the page.

 <script type="text/javascript">
  var lang = jrReadCookie('jr_lang');
  if (lang == null) {
   jrSetCookie('jr_lang', 'es-ES');
   window.location.reload();
  }
 </script>

Add that to your sites header.tpl or meta.tpl page. I put it just inside the /head section of meta.tpl and it seamed to do the trick.

Tags