Spanish URLs

Popular automatic website translation tool

Spanish URLs

Postby YaegerDesign » Sat Aug 31, 2013 6:31 pm

Take a look at the links in the Spanish site:
http://semyx.com/es/

Notice they are all in Spanish. We have this manual translation running alongside the GTranslate for other languages. I have been able to write redirects for the Spanish URLs so that language switcher knows what is the correct URL:
Code: Select all
RewriteBase /es/
RewriteRule ^company.html$ empresa.html? [R=301]


However, if you go to the Spanish site and then try to go to any other language, GTranslate tries to translate the Spanish URL from English: http://semyx.com/da/empresa.html

I've tried to write redirects for those Spanish pages back to the English URLs, but I get the 301 Moved Permanently page for every URL: moved-permanently-error-t3183.html
YaegerDesign
 
Posts: 19
Joined: Tue Jun 11, 2013 1:27 am

Re: Spanish URLs

Postby Yana » Mon Sep 02, 2013 2:10 pm

Hi,

The URL translation feature is available only in GTranslate enterprise version.
You can try to enable follow_location option in the gtranslate/config.php file. Hope this will help you.
Regards,

Yana Ghahramanyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Yana
 
Posts: 4135
Joined: Thu Jan 12, 2012 6:21 pm

Re: Spanish URLs

Postby YaegerDesign » Thu Sep 05, 2013 1:44 am

I am not doing URL translation via GTranslate. That was done in our manual translation in Spanish.

I have the following snippet of code in the .htaccess file of the /es/ sub-folder:

Code: Select all
# English -> Spanish redirects
RewriteBase /es/
RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^company.html$ empresa.html? [R=301,L]
RewriteRule ^products.html$ productos.html? [R=301,L]
# etc...


This works well at making sure the translation widget pulls up the correct Spanish page (actual files on the server). However, if using the widget to switch from the Spanish pages to another language, I need to make sure the English URLs are used for translation instead of the Spanish URLs. Thus, I have the following code in the .htaccess file of the root directory:

Code: Select all
# Spanish -> English redirects
RewriteCond %{REQUEST_URI} !^/es
RewriteRule ^empresa.html$ company.html? [R=301,L]
RewriteRule ^productos.html$ products.html? [R=301,L]
# etc...


The problem is that I am getting an infinite redirect loop when visiting any of the Spanish URLs. If I remove the ES->EN redirects in the root, everything in the /es/ dir works fine. However, I can't seem to get the rewrites of the URLs in the root directory from Spanish -> English. I want to make sure the Spanish URLs are only showing in the ES folder and root and every other (virtual) folder uses the English URLs.

I should note that the ES->EN rewrites are above the GTranslate rewrites, though I have tried both ways.
YaegerDesign
 
Posts: 19
Joined: Tue Jun 11, 2013 1:27 am

Re: Spanish URLs

Postby YaegerDesign » Tue Sep 10, 2013 8:46 pm

Any suggestions?
YaegerDesign
 
Posts: 19
Joined: Tue Jun 11, 2013 1:27 am

Re: Spanish URLs

Postby Edvard » Wed Sep 11, 2013 2:40 pm

Hi,

Please try to add the rewrite rules below before #gtranslate config block.

RewriteRule ^([a-z]{2}|zh-CN|zh-TW)/empresa.html$ /$1/company.html [R=301,QSA,L]
etc...

So when you access to /da/empresa.html it will first redirect to /da/company.html then translate it.

Hope that makes sense.

Thank you!
Regards,

Edvard Ananyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Edvard
Site Admin
 
Posts: 4185
Joined: Mon Jun 28, 2010 1:54 pm
Location: Yerevan, Armenia

Re: Spanish URLs

Postby YaegerDesign » Thu Sep 12, 2013 10:20 am

That makes sense, but I need to exclude the /es/ folder. I think that is what is causing the redirect loop.

/es/empresa.html is correct.
/da/empresa.html should redirect.
YaegerDesign
 
Posts: 19
Joined: Tue Jun 11, 2013 1:27 am

Re: Spanish URLs

Postby Yana » Thu Sep 12, 2013 3:09 pm

Hi,

You can try replace [a-z]{2}|zh-CN|zh-TW with the language codes which you want to use .
for example fr|de|ru|xh-CN|zh-TW
Regards,

Yana Ghahramanyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Yana
 
Posts: 4135
Joined: Thu Jan 12, 2012 6:21 pm

Re: Spanish URLs

Postby YaegerDesign » Fri Sep 13, 2013 12:01 am

Do you have a full list of all available languages? Would I need to update this every time a new language is added, or our current version will never get any more languages?

Also, wouldn't it be easier to just specify the languages NOT to be included instead of all that are? Or, is that not possible?
YaegerDesign
 
Posts: 19
Joined: Tue Jun 11, 2013 1:27 am

Re: Spanish URLs

Postby Yana » Fri Sep 13, 2013 12:11 pm

Hi,
Here are the language codes:
af - Afrikaans, sq - Albanian, ar - Arabic, hy - Armenian, az - Azerbaijani, eu - Basque, be - Belarusian, bg - Bulgarian, ca - Catalan, zh - CN - Chinese - (Simplified), zh - TW - Chinese - (Traditional), hr - Croatian, cs - Czech, da - Danish, nl - Dutch, en - English, et - Estonian, tl - Filipino, fi - Finnish, fr - French, gl - Galician, ka - Georgian, de - German, el - Greek, ht - Haitian - Creole, iw - Hebrew, hi - Hindi, hu - Hungarian, is - Icelandic, id - Indonesian, ga - Irish, it - Italian, ja - Japanese, ko - Korean, lv - Latvian, lt - Lithuanian, mk - Macedonian, ms - Malay, mt - Maltese, no - Norwegian, fa - Persian, pl - Polish, pt - Portuguese, ro - Romanian, ru - Russian, sr - Serbian, sk - Slovak, sl - Slovenian, es - Spanish, sw - Swahili, th - Thai, tr - Turkish, uk - Ukrainian, ur - Urdu, vi - Vietnamese, cy - Welsh, yi - Yiddish
Regards,

Yana Ghahramanyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Yana
 
Posts: 4135
Joined: Thu Jan 12, 2012 6:21 pm

Re: Spanish URLs

Postby YaegerDesign » Fri Sep 13, 2013 7:24 pm

Would I need to update this every time a new language is added, or our current version will never get any more languages?

Also, wouldn't it be easier to just specify the languages NOT to be included instead of all that are? Or, is that not possible?
YaegerDesign
 
Posts: 19
Joined: Tue Jun 11, 2013 1:27 am


  • Related Topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 0 guests

2GLux