Jump to content

1.5.6.0 - can not change or set the default language for multistore domains


Recommended Posts

Hi,

i can not change default language for domains in BackOfiice -> Localization -> Localization.

 

 

1 shop - English

2 shop - German

 

It does not work in 1.5.5 and 1.5.6

 

PHP v.: 5.2.17

 

Do you know anybody where can be problem? Thank you

 

 

Link to comment
Share on other sites

Hi,

 

I'm experiencing the same problem:

 

I've just updated to the V 1.5.6.0

 

I've created a multishop: Ireland, France and Belgium

 

What I want is quite simple:

Language for Ireland: English

Language fro France and Belgium: French

 

I've downloaded the latest language package and installed it. So far so good...

 

However, I can not get my French an Belgian shops to be in French. 

 

Any idea why???

 

Tks for your help!

Link to comment
Share on other sites

Hi there,

I already sent a bug report here.

http://forge.prestashop.com/browse/PSCFV-10273

Unfortunatly it is not recognized so far. Maybe you can vote it up to get more attention. I am really loosing my nerves on this multishop thing because I really wait now over a year, maybe even two since they first announced it and every new version I am dissapointed again that there are still serious bugs.

All the best, Trip

  • Like 1
Link to comment
Share on other sites

Same problem here. I fully agree, this is a major issue. I also tried to turn off and on "Friendly URL" as suggested in other parts of this forum but it worked once and now is back to English as the default language. This is a major issue since visitors in a country where English is not spoken at all will be annoyed and may never return.

Link to comment
Share on other sites

I did some testing using the site anonymouse.org and the result is that languages ​​work

 

That is the problem. I started out correctly with the default language. After making some changes to the design (completely unrelated to localization), suddenly English was the default language. After multiple attempts of turning off and on "Friendly URL" and emptying the cache, it still did not change back to the correct default language. But after trying it a few more times, it suddenly worked. 

 

In other words, the issue cannot be consistently replicated nor can be the solution. 

Link to comment
Share on other sites

That is the problem. I started out correctly with the default language. After making some changes to the design (completely unrelated to localization), suddenly English was the default language. After multiple attempts of turning off and on "Friendly URL" and emptying the cache, it still did not change back to the correct default language. But after trying it a few more times, it suddenly worked. 

 

In other words, the issue cannot be consistently replicated nor can be the solution. 

 

We are looking into this now. It has been correctly reported and we are working hard to investigate and solve. I will definitely update you as new developments occur. 

Link to comment
Share on other sites

If anybody need quick solve, so you try insert into .htaccess in ROOT this code. It will work, but i'm not sure if it is good solving.

 

# URL rewriting module activation
RewriteEngine on

# Remove Accept-Language header (if exists) to really serve
# the "default language" set, for visitors without a cookie


RequestHeader unset Accept-Language

Link to comment
Share on other sites

@chrasty,

can you describe exactly what you enter in the htaccess? RequestHeader unset Accept-Language gives an internal server error. I don't think (and honestly hope) that it is a cookie issue because google crawler does not accept cookies and therefore will not be able to index the site in the correct language. That was the sad case in early PS versions but I think and hope this mistake will not be done once again ;)

All the best, Trip

Link to comment
Share on other sites

www.domain.com/en/

www.domain.com/de/

 

If Google will not indexing site from the default language, so it is really big problem. So I do not know if this is good solve.

 

Thus begins my htaccess file:

 

# ~~start~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again
# .htaccess automaticaly generated by PrestaShop e-commerce open-source solution
# http://www.prestashop.com - http://www.prestashop.com/forums

<IfModule mod_rewrite.c>
SetEnv HTTP_MOD_REWRITE On
RewriteEngine on
RequestHeader unset Accept-Language
RewriteCond %{HTTP_HOST} ^domain.com$
RewriteRule . - [E=REWRITEBASE:/]
RewriteRule ^api/?(.*)$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L]

# Images

Link to comment
Share on other sites

Hi there, my bug report was closed in the tracker.

I can confirm that the workaround from chrasty is working although I don't understand the mechanism behind it ;)

I've updated the bug report and hope I get an answer from Remi if this is a bug in PS. To be honest I guess, maybe just a small one but I for myself had to enable mod_headers before and I guess this is not standard and if it is wanted that way there should be a message like "you need to enable mod_headers blah blah etc.pp."

So, I did not test that well but thx to chrasty we hopefully are getting in the right direction and I only can hope that Remi now gets an idea where he has to look. I've updated the bug report with the workaround.

All the best, Trip

Link to comment
Share on other sites

today is 9 days which im working on multistore on prestashop 1.5.6 daily 10 hours , it is really good thing for ppl like me that have 2 or 3 online shops , but multishop is colony of bugs . Language , currency , Module , Themes , quantity and etc.

 

i wont waist more time on it . im gald when it become free bug i start to using it 

Link to comment
Share on other sites

I was try to redirect page with index.php file, but no luck

 

<?php
        header('location:http://www.yourshop.com/shop/de');
?>

It just automatically swich back to english, hope so that we gonna get solution asap, this is huge problem for me

Link to comment
Share on other sites

The bug imo is the mechanism from PS to determine the user language. I assume that it tries to find the browser accept language and if this fails it falls back to english.... noo, with further tests now I am sure.

 

As I have an english OS the preferred languages in my browser settings are English/United States [en-us] and English[en]. When I add Thai [th] and give it the highest priority than the page is displayed correct.

 

Question remains how google bot will crawl the pages. As the language is in the header <html lang="XX"> we can only hope that the bot will send the corresponding accept language so that the not the wrong content is served. All my tests with lynx where negative so far but maybe lynx has the same accept-languages than my OS or whatever.

 

But anyway when I think about it is a bug. I am not sure if google crawls the pages correct and there might be visitors that have misconfigured browsers but as my shop instance has only one language they will not be able to switch to their mother tonque language ergo chances are high that they will leave the site.

Thanks in advance, Trip

Edited by Trip (see edit history)
Link to comment
Share on other sites

Hi, I hope Remi from the PS team sees the problem now. You can test it yourself if you want by changing the language settings in your browser. With firefox you find the settings under preferences/content/languages. For a single shop instance this is a good way to determine the users language as he can change it afterwards but in multishop mode this can lead to unwanted results. It could be a real (SEO) burner if they would implement the

rel="alternate" hreflang="x"

in case there are products shared over different shop instances.

You can read about it here https://support.google.com/webmasters/answer/189077

 

All the best, Trip

Link to comment
Share on other sites

Hi Guys,

 

I appreciate your efforts in trying to solve this problem.

 

However, I still have a question regarding default language for multistores.

 

My question is quite simple: setting the default language should override whatever browser setings don't you think???

 

I.e: if the default language for my shop is French, hence my shop / website should display in French, regarless of the browser settings or the location of the potential customer?

 

Do you understand what I'm saying?

 

Eric

Link to comment
Share on other sites

I just made a short test but the problem seems to be fixed.

Remi commited the changes in the Tools Class here

https://github.com/PrestaShop/PrestaShop/commit/198e75245d83ff11bb29dfdc1095a91a56fd83cf

Everyone with this problem who is able to test it.. please verify it :)

All the best, Trip

 

Hi Trip, thank you very much for your activity on the forge report here, http://forge.prestashop.com/browse/PSCFV-10273

 

This will automatically show users the default language of the shop correct? I think that is what Eric is talking about. 

Link to comment
Share on other sites

Hi Guys,

 

I appreciate your efforts in trying to solve this problem.

 

However, I still have a question regarding default language for multistores.

 

My question is quite simple: setting the default language should override whatever browser setings don't you think???

 

I.e: if the default language for my shop is French, hence my shop / website should display in French, regarless of the browser settings or the location of the potential customer?

 

Do you understand what I'm saying?

 

Eric

 

Have you used the fix from Github that Trip posted? Make sure to backup everything before making changes. Thanks

Link to comment
Share on other sites

Hi Benjamin,

 

I not really a 'tech' guy (have a degree in Business Studies & Marketing), so I'm kinda looking at things from the cutomer's side...

 

I can try to make the changes myself though hopefully w/o creating another bug or wiping out my stocks....

 

Eric

 

p.s: if you go into > Localisation > Localisation - you will notice that at the bottom of the page the

 

Advanced > language locale

                 > country locale

 

have both been disabled - if we could access these and make changes it should solve the problem?

Edited by Eric_Devos (see edit history)
Link to comment
Share on other sites

Hi Trip,

 

Thanks for you e-mail and you input.

 

However, I still believe that the 'fix' offered is still NOT what I'm looking for.

 

I checked your webs site out (nice layout, best of luck btw), however, giving the possibility to my customers to choose their language is not what I am trying to do.

 

I'll explain:

 

I've bought several domain names for each country where I want my shop to be present.

 

To keep things simple, I'll explain with just 2 domain names:

 

fishingfever.ie > for the Irish market

fishingfever.fr > for the French market

 

 

The only thing I want is set the default language for my French shop to French - and this shop to be fishingfever.fr

 

 

Do you understand what i'm trying to do & do you agree that this is a different set up to yours??

 

Eric

 

ps: I came accross a post while trying to find more information from El Patron (quite a prolific 'poster'...) also justifying the use of multi-domain names per country for SEO optimization as well

Link to comment
Share on other sites

Hi Benjamin,

 

I not really a 'tech' guy (have a degree in Business Studies & Marketing), so I'm kinda looking at things from the cutomer's side...

 

I can try to make the changes myself though hopefully w/o creating another bug or wiping out my stocks....

 

Eric

 

p.s: if you go into > Localisation > Localisation - you will notice that at the bottom of the page the

 

Advanced > language locale

                 > country locale

 

have both been disabled - if we could access these and make changes it should solve the problem?

 

 

Hi, when you go to localization/localization make sure that you have the configuration for only your French shop. The options will be grayed out but you can check the little checkbox to the left of each box to enable the settings to be changed. From there you should change the "Default Language" to French. Remember to save. 

Link to comment
Share on other sites

Hi Benjamin,

 

copy from my previous message

 

Regards,

 

Eric

 

p.s: if you go into > Localisation > Localisation - you will notice that at the bottom of the page the

 

Advanced > language locale

                 > country locale

 

have both been disabled - if we could access these and make changes it should solve the problem?

Link to comment
Share on other sites

@Eric, in your page header the language is set to french. Are you sure you've all translations available for your theme? Please look in themes/name_of_theme/ if there is a file fr.php? If not you can copy it from the default template. Please take a look here http://doc.prestashop.com/display/PS15/Understanding+Local+Settings#UnderstandingLocalSettings-Copy at the bottom of the page.

 

My shops are not running in Multishop Mode but I would say I am testing that now for hundreds of hours so yes .. what you want is possible but I can only recommend to test such stuff on a demo installation and write down the necessary stuff. If you will not succeed you can PM your BO credentials so I can have a look at it. Without seeing your installation we can only guess what might be wrong.

All the best, Trip

Link to comment
Share on other sites

Hi Trip,

 

sorry for late reply - was trying to get you the access code, so you could take a look at the code - but didn't get them yet.

 

I checked (via dreamweaver) and the fr language / folder is there (i've put a screenshot here - http://www.fishingfever.fr/fishing-floats/769-test.html)

 

Eric

 

p.s: really appreciate your help with this and REALLY need to get the site up and running.... been investing quite a lot in stocks... and it's just lying there... 'til I can sell via my website...

Edited by Eric_Devos (see edit history)
Link to comment
Share on other sites

@Eric, as said it is hard to guess what you did.

May I ask a few questions/give suggestions?

I assume you use 2 templates because you have different page headers?!

Can you write in your test product "test english" and "test french" instead of "test" for the different english and french translation of the product so we can see which translation is served?

Can you enable english language for the french shop so we can switch between the languages with the language selector to see what happens in the store?

When you do that we can determine if the problem is that french is not served at all or the problem is within the template translation which will bring us a lot closer to find the error. I hope you get the point.

All the best, Trip

Link to comment
Share on other sites

Just found out that the ISO code was in capital letters instead of lower case.

 

Still, the French version of the webiste is only accessible if I enable English for the French website.

 

What i'd like to do is disable English alltogether for the French website.

 

Eric

Link to comment
Share on other sites

Hi Trip,

 

I've made the changes.

 

This is now what it looks like:

 

360  if (Validate::isLoadedObject($lang) && $lang->active && $lang->isAssociatedToShop())
        {
          Context::getContext()->language = $lang;
        $cookie->id_lang = (int)$lang->id;
        }
        }
366  }
 
 
--------------------------------------
Now, when I disabled English for the French shop, I still get a some amount of English showing in the menus: 
>Specials
>Search,
etc...
 
Guess I'm almost there!
 
Eric
Link to comment
Share on other sites

Hello,

 

looks like im a little bit stuck, i have replaced all code from file tools.php with this one: 

 

https://github.com/PrestaShop/PrestaShop/blob/198e75245d83ff11bb29dfdc1095a91a56fd83cf/classes/Tools.php#L7

 

but im still having the same problem, i have tried to disable english language and still nothing

 

Here is my website http://rhinestone-sv.com/shop

Link to comment
Share on other sites

I have Mozilla Firefox and I cant see your webpage in Germany,

 

it works, my bad, chrome was on english, tried with opera on german language and its ok now

 

 

And I have the same problem with my own webpage - default language is Estonian, but it opens in English  :(

 

What can i do?

Link to comment
Share on other sites

  • 3 weeks later...

Hello,

 

for me is strange at least, i have romanian and english, i want romanian as default which is already set from prestashop (it is not set as multistore from what i know), i tried what someone suggested on the thread in the first page, to try http://anonymouse.org , i've tried it and the default language is romanian and if i am trying with chrome, firefox, internet explorer, safari, is showing english, for chrome and firefox I tried with private sessions because of cookies...and it is english

 

here is the website that i am administrating it http://www.minimecraft.ro

 

for the .com domain is redirected to the english version but for .ro.

 

I want to be sure that the default language is romanian, thank you!

Edited by Cata100 (see edit history)
Link to comment
Share on other sites

Hello,

 

for me is strange at least, i have romanian and english, i want romanian as default which is already set from prestashop (it is not set as multistore from what i know), i tried what someone suggested on the thread in the first page, to try http://anonymouse.org , i've tried it and the default language is romanian and if i am trying with chrome, firefox, internet explorer, safari, is showing english, for chrome and firefox I tried with private sessions because of cookies...and it is english

 

here is the website that i am administrating it http://www.minimecraft.ro

 

for the .com domain is redirected to the english version but for .ro.

 

I want to be sure that the default language is romanian, thank you!

 

you default language, makes less impact now in 1.5.6.0...because it detects the browser language, for example when I go to your store I see the English version.  To test that default works...is set your browser languge (just the top one as you can set them by priority) to a language not defined to your shop...then you should see your default shop language

Link to comment
Share on other sites

No I have a multishop setup where some of the shops in the group should contain only a single language. So instead of having one with the possibility to change between five languages I have one with 3 languages and then 2 different shops with single language more customized for only a single country. Is that not possible right now?

Link to comment
Share on other sites

  • 1 month later...

Hi all, i had the same problem and managed to make it work (still issues when i disable canonical URL!) in 1.5.6.1

 

I removed some part from Tools.php, which makes the language selection fall back to the default in the shop.

 

 

    if ((!$cookie->id_lang || isset($cookie->detect_language)) && isset($_SERVER['HTTP_ACCEPT_LANGUAGE']))
        {
            $array = explode(',', Tools::strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE']));
            if (Tools::strlen($array[0]) > 2)
            {
                $tab = explode('-', $array[0]);
                $string = $tab[0];
            }
            else
                $string = $array[0];
            if (Validate::isLanguageIsoCode($string))
            {
                $lang = new Language(Language::getIdByIso($string));
                if (Validate::isLoadedObject($lang) && $lang->active && $lang->isAssociatedToShop())
                {
                    Context::getContext()->language = $lang;
                    $cookie->id_lang = (int)$lang->id;
                }
            }
        }
        
        if (isset($cookie->detect_language))
            unset($cookie->detect_language);

        /* If language file not present, you must use default language file */
        if (!$cookie->id_lang || !Validate::isUnsignedId($cookie->id_lang))

Link to comment
Share on other sites

What i would really like is a connection between URL and (default) language.

 

1. make languages available per store. Now they are available for all stores

2. set a default language per URL instead of per store.

3. make it possible to set no default URL if i use multiple URL's per store. Dont know if that is already possible.

 

  This would give max. flexibility

 

Example:

 

Shop 1.:

petstore.co.uk

dogstore.co.uk

dogstore.nl

 

Shop 2:

 

chienstore.fr

 

Settings:

 

Store 1: activate EN AND NL language. Default for first 2 shops is EN, third is NL

Store 2: Activiate FR language. Default is FR (only available)

etc.

 

For store 1, there is no default URl, so vistors are stayin on the URL they entered. (as i write it down, it wold be best to define PER URL if it should lead to another URL from this store, so: redirect only dogstore.co.uk to petstore.co.uk, and leave the other URL.

 

 

In this way, we do not have to create shops if we want to change language or URL.

Link to comment
Share on other sites

×
×
  • Create New...