Community Forums

language in url

Coding & concept discussion for OpenCart v1.x development

language in url

Postby banane » Mon Apr 12, 2010 5:55 am

I've appreciated in the last release (1.4.7) the possibility to setting the language from url appending the parameter &language=en
now I would like to know how to set opencart to have all the urls with the language parameter included by default (just a suggestion where to start).
Thanks!
User avatar
banane
 
Posts: 51
Joined: Fri Jul 31, 2009 10:30 am

Re: language in url

Postby Qphoria » Mon Apr 12, 2010 6:47 am

If you set it once, it will use that for the rest of the session so if you goto:

www.site.com/index.php?language=en
then
www.site.com/index.php (it will still be in en)

if you goto
www.site.com/index.php?language=de
then
www.site.com/index.php (it will still be in de)

So you shouldn't need to keep it there.
Image Image
Donate!|OpenCart Basics|GeoZones
Help me get more development cloud storage - Click Here to get DropBox
User avatar
Qphoria
Administrator
 
Posts: 18197
Joined: Mon Jul 21, 2008 7:02 pm
Donate to Qphoria

Re: language in url

Postby banane » Mon Apr 12, 2010 7:10 am

yes, but I would like to have a structure with unique urls
e.g. yahoo index the site in english, google in italian. I've provided the urls with the language parameter so they index also other languages but I've a lot of duplicated pages, so I was thinking that unique urls could simplify everything
User avatar
banane
 
Posts: 51
Joined: Fri Jul 31, 2009 10:30 am

Re: language in url

Postby Qphoria » Mon Apr 12, 2010 1:43 pm

With the old url library class, this could have been done easier. It was decided to remove the url class and now it limits things. So to do it, you will likely need to edit every single file and add it. So there is no longer a good way. I'll see about adding the url class back in as this is just one of many limitations that has occurred because of that decision and nobody has found any good in removing it.
Image Image
Donate!|OpenCart Basics|GeoZones
Help me get more development cloud storage - Click Here to get DropBox
User avatar
Qphoria
Administrator
 
Posts: 18197
Joined: Mon Jul 21, 2008 7:02 pm
Donate to Qphoria

Re: language in url

Postby banane » Mon Apr 12, 2010 6:42 pm

thank you Qphoria
people like you gives me hope for a better Opencart, I'll wait for news
User avatar
banane
 
Posts: 51
Joined: Fri Jul 31, 2009 10:30 am

Re: language in url

Postby banane » Tue Apr 27, 2010 7:36 am

does anyone know if we'll have back the old url library class in the next version?
thanks
User avatar
banane
 
Posts: 51
Joined: Fri Jul 31, 2009 10:30 am

Re: language in url

Postby Qphoria » Tue Apr 27, 2010 2:56 pm

I'd like to restore it and use it for SEO so that ALL links can be SEO'd dynamically. In ChromiumCart I added an SEO Generator that would actually generate the seo from the name

So
http://www.mysite.com/index.php?route=p ... duct_id=50
was something like:
http://www.mysite.com/product/product/ipod-nano

and
http://www.mysite.com/index.php?route=common/home
would be something like:
http://www.mysite.com/common/home

This would replace the model/tool/seo_url.php file which I've never liked anyway because it is very hardcoded and only works with products, categories, & information instead of being more universal.
Image Image
Donate!|OpenCart Basics|GeoZones
Help me get more development cloud storage - Click Here to get DropBox
User avatar
Qphoria
Administrator
 
Posts: 18197
Joined: Mon Jul 21, 2008 7:02 pm
Donate to Qphoria

Re: language in url

Postby i2Paq » Sat Jun 04, 2011 5:03 pm

How does this work with 1.5.0?

For front and Admin?
Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________
Our FREE search: Find your answer FAST!.

First Things First: Opencart Check List.
Documentation: Our Documentation section.
BUGs?: Known BUGS for All OC Versions.

Problemen met de BTW?: [How to] BTW + Verzend & betaalmethodes.
User avatar
i2Paq
Global Moderator
 
Posts: 9747
Joined: Mon Nov 09, 2009 11:00 am
Location: Winkel - The Netherlands

Re: language in url

Postby xtr3mx7 » Mon Jun 06, 2011 12:42 pm

Is Q giving back hope of having the URL class back, specifically, for multi site language users with SEO? That would be awesome if he can provide a guideline on how to restore it back! Cheers!
xtr3mx7
 
Posts: 43
Joined: Sun Jul 12, 2009 5:02 pm

Re: language in url

Postby mfive » Wed Jun 29, 2011 5:49 pm

Agreed. This is one of the main reasons I can't switch to OpenCart yet.

I need URLS like so:

http://www.domain.com/es/catalog
http://www.domain.com/fr/catalog
http://www.domain.com/it/catalog

for each language.

Having cookies dictate the language doesn't work for me, does this mean that I need to set up several separate stores? If so, can they tie into the same products database? Any suggestions?
mfive
 
Posts: 54
Joined: Sat Jan 29, 2011 1:49 am

Re: language in url

Postby cyjambo » Tue Jul 12, 2011 8:07 pm

mfive wrote:Agreed. This is one of the main reasons I can't switch to OpenCart yet.

I need URLS like so:

http://www.domain.com/es/catalog
http://www.domain.com/fr/catalog
http://www.domain.com/it/catalog

for each language.

Having cookies dictate the language doesn't work for me, does this mean that I need to set up several separate stores? If so, can they tie into the same products database? Any suggestions?


Hi,

Same here. Although I would need:

http://www.domain.com/en/catalog/product/apple
http://www.domain.com/de/kataloge/produkt/apfel
http://www.domain.com/hu/katalogus/termek/alma

Is this possible? I really want to use OpenCart but this is a problem for me as of now :(

Other than this OpenCart is awesome!!! :)
cyjambo
 
Posts: 4
Joined: Mon Jul 11, 2011 2:33 pm

Re: language in url

Postby levon » Tue Jul 12, 2011 9:49 pm

cyjambo wrote:
mfive wrote:Agreed. This is one of the main reasons I can't switch to OpenCart yet.

I need URLS like so:

http://www.domain.com/es/catalog
http://www.domain.com/fr/catalog
http://www.domain.com/it/catalog

for each language.

Having cookies dictate the language doesn't work for me, does this mean that I need to set up several separate stores? If so, can they tie into the same products database? Any suggestions?


Hi,

Same here. Although I would need:

http://www.domain.com/en/catalog/product/apple
http://www.domain.com/de/kataloge/produkt/apfel
http://www.domain.com/hu/katalogus/termek/alma

Is this possible? I really want to use OpenCart but this is a problem for me as of now :(

Other than this OpenCart is awesome!!! :)


+1
levon
 
Posts: 22
Joined: Fri Mar 05, 2010 1:36 pm

Re: language in url

Postby bull5-i » Thu Oct 13, 2011 1:03 pm

I'd also like to see such language switch support from OC.
bull5-i
 
Posts: 329
Joined: Tue Jan 11, 2011 12:49 pm

Re: language in url

Postby arames » Wed Apr 25, 2012 9:52 pm

Guys,

if the
index.php?language=en
or
index.php?language=de

is NOT switching to the language where could the error be?

I am using OpenCart 1.5.2.1

Pleeeeeeeeeeeeease any help on the right direction would mean a lot.

Thank you
arames
 
Posts: 45
Joined: Fri Mar 09, 2012 12:27 pm

Re: language in url

Postby Qphoria » Thu Apr 26, 2012 1:55 am

arames wrote:Guys,

if the
index.php?language=en
or
index.php?language=de

is NOT switching to the language where could the error be?

I am using OpenCart 1.5.2.1

Pleeeeeeeeeeeeease any help on the right direction would mean a lot.

Thank you


It was removed by daniel... I tried to fight him on it but he wouldn't budge.. I recommend complaining to him

For now you can follow this post to add it back
viewtopic.php?t=57516#p272365
Image Image
Donate!|OpenCart Basics|GeoZones
Help me get more development cloud storage - Click Here to get DropBox
User avatar
Qphoria
Administrator
 
Posts: 18197
Joined: Mon Jul 21, 2008 7:02 pm
Donate to Qphoria

Re: language in url

Postby strtfr » Thu Apr 26, 2012 3:30 pm

mfive wrote:Agreed. This is one of the main reasons I can't switch to OpenCart yet.

I need URLS like so:

http://www.domain.com/es/catalog
http://www.domain.com/fr/catalog
http://www.domain.com/it/catalog

for each language.

Having cookies dictate the language doesn't work for me, does this mean that I need to set up several separate stores? If so, can they tie into the same products database? Any suggestions?


I am currently investigating in how this could be (easily) achieved. Is someone able to give some leads to a possible solution?
strtfr
 
Posts: 34
Joined: Wed Dec 21, 2011 10:15 am

Re: language in url

Postby arames » Thu Apr 26, 2012 3:39 pm

I am also dying to have this
http://www.domain.com/es/catalog
http://www.domain.com/fr/catalog
http://www.domain.com/it/catalog


but ONLY QPHORIA can help us. And God of course O0

Hopefully one of them will post a message here to fix this, since it is very important for all of us to have google index our store in different languages / folders..
arames
 
Posts: 45
Joined: Fri Mar 09, 2012 12:27 pm

Re: language in url

Postby Qphoria » Thu Apr 26, 2012 3:49 pm

Well first you need to add the language url function back
that will give you
Code: Select all
http://www.mysite.com/index.php?language=de


Then I'm not sure but maybe using url rewrite to change
mysite.com/de/index.php
to
mysite.com/index.php?language=de

but I'm no pro on htaccess changes.
Image Image
Donate!|OpenCart Basics|GeoZones
Help me get more development cloud storage - Click Here to get DropBox
User avatar
Qphoria
Administrator
 
Posts: 18197
Joined: Mon Jul 21, 2008 7:02 pm
Donate to Qphoria

Re: language in url

Postby strtfr » Thu Apr 26, 2012 6:43 pm

If we want to rewrite the url we have to make sure the language query string is being kept present in the url. In 1.5.3 it is filtered out once the language selection is made. Lets see.
strtfr
 
Posts: 34
Joined: Wed Dec 21, 2011 10:15 am

Re: language in url

Postby strtfr » Thu Apr 26, 2012 9:12 pm

Well, haven't got the slightest idea where to look for. I should probably add the language query string in the url parameter of every page served.
strtfr
 
Posts: 34
Joined: Wed Dec 21, 2011 10:15 am

Next

Return to Concepts

Who is online

Users browsing this forum: Peter_Gould and 14 guests

Hosted by Arvixe Web Hosting