Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

change language text myself?


qwertyjjj

Recommended Posts

If I want to change the language of all text, can I just copy the english folder and call it french and then change everything myself in each phhp file?

 

Also, how does OSC determine whether to list English or another language based on IP address?

Link to comment
Share on other sites

1. Yes, but you also need to copy the english.php file and translate that.

 

2. It is based on the visitor's browser settings, not the IP address.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

1. Yes, but you also need to copy the english.php file and translate that.

 

2. It is based on the visitor's browser settings, not the IP address.

 

Regards

Jim

 

Is it built into the standard application.top?

If I wanted to check the PHP SELF afterwards to check mysite.eu or mysite.com etc. how could I do that?

 

Also, I would like to keep the URL the same.

For example, if someone accesses mysite.com or mysite.eu or mysite.net they will remain within that domain the entire time.

 

ANy idea show to change this and will that mess up any sessions?

 

RewriteEngine On

RewriteCond %{HTTP_HOST} !^(www\.mysite\.co\.uk)?$

RewriteCond $1 !^cart/updateorders\.php$

RewriteCond $1 !^IntegrityCheck\.php$

RewriteRule ^(.*)$ http://www.mysite.co.uk/$1 [R=302,L]

 

I also have this as the index.php page but I'm not sure if the htaccess bypasses it? I was told it was better to have this for Google listings.

 

<?php

header( "HTTP/1.1 302 Temporarily Moved" );

header('Location: http://www.mysite.co.uk/cart/index.php');

?>

Link to comment
Share on other sites

Is it built into the standard application.top?

Everything is built into application_top.php. Well, nearly. The part you want is this:

// set the language
 if (!tep_session_is_registered('language') || isset($HTTP_GET_VARS['language'])) {
   if (!tep_session_is_registered('language')) {
     tep_session_register('language');
     tep_session_register('languages_id');
   }

   include(DIR_WS_CLASSES . 'language.php');
   $lng = new language();

   if (isset($HTTP_GET_VARS['language']) && tep_not_null($HTTP_GET_VARS['language'])) {
     $lng->set_language($HTTP_GET_VARS['language']);
   } else {
     $lng->get_browser_language();
   }

   $language = $lng->language['directory'];
   $languages_id = $lng->language['id'];
 }

If I wanted to check the PHP SELF afterwards to check mysite.eu or mysite.com etc. how could I do that?

You can't; $PHP_SELF returns the name of the file, not the domain.

 

Also, I would like to keep the URL the same.

For example, if someone accesses mysite.com or mysite.eu or mysite.net they will remain within that domain the entire time.

 

ANy idea show to change this and will that mess up any sessions?

 

RewriteEngine On

RewriteCond %{HTTP_HOST} !^(www\.mysite\.co\.uk)?$

RewriteCond $1 !^cart/updateorders\.php$

RewriteCond $1 !^IntegrityCheck\.php$

RewriteRule ^(.*)$ http://www.mysite.co.uk/$1 [R=302,L]

That's really difficult, if it's even possible to do at all. osCommerce uses the HTTP_SERVER value from configure.php. Changing that on the basis of the domain the visitor lands on would mean changing the code everywhere HTTP_SERVER is used, as well as storing the domain in some sort of variable that is persistent in the visitor's session. Not an easy task.

 

I also have this as the index.php page but I'm not sure if the htaccess bypasses it? I was told it was better to have this for Google listings.

 

<?php

header( "HTTP/1.1 302 Temporarily Moved" );

header('Location: http://www.mysite.co.uk/cart/index.php');

?>

That's a temporary redirect, which is very bad for Google as it doesn't change the original domain. This leaves you with two identical sites, and Google has to figure out which one is the duplicate and which one to keep. This never ends well.

 

BTW, asking multiple questions in a post greatly reduces your chances of getting an answer. Keep it to one at a time and you'll get faster answers.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

1/

It was someone on the Google forum who told me to do that! :)

So, if my site landing page is www.mysite.com/cart/ - what should I use to redirect the googlebot?

 

2/

So, determining the language from the browser is the best solution? Is there a way to take out the domain mysite.co.uk form that htaccess so it is relative to the actual domain used?

 

3/

Is there a way to change the language of the page title as I thought that was contained in the config files?

 

Yes,, sorry about all the questions but I felt they were all related to the language changes.

Link to comment
Share on other sites

1. Use 301 Moved Permanently.

 

2. Again, it would be very difficult to maintain two domain names on one site. This will require modification to the osCommerce code. You can't do it with a simple .htaccess command.

 

3. The page titles are in the language files. Look in includes/languages/<name of your language>/<file name>

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

1. Use 301 Moved Permanently.

 

2. Again, it would be very difficult to maintain two domain names on one site. This will require modification to the osCommerce code. You can't do it with a simple .htaccess command.

 

3. The page titles are in the language files. Look in includes/languages/<name of your language>/<file name>

 

Regards

Jim

 

So, the best way would be to duplicate the cart folder and copy it to a different folder connected to the .eu domain with a config file that has different email addresses, etc.?

eg mysite.org points to mysiteorg folder

mysite.eu points to mysiteeu folder

That's going to make it a little messy when changing code I suppose.

Now, if I do that is there anyway to select French as the default language instead of English or will it always be picked up from the browser language?

Link to comment
Share on other sites

You can duplicate the site that way. If you keep the page layout the same on both sites, Google will consider them duplicates and will probably ignore one of them. Or possible ignore some of the pages from each site. In either case, it may hurt your rankings.

 

You can always select a default languages in your Admin, but it will be used only if osC can't determine the language from the browser or does not have the browser's default language.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

You can duplicate the site that way. If you keep the page layout the same on both sites, Google will consider them duplicates and will probably ignore one of them. Or possible ignore some of the pages from each site. In either case, it may hurt your rankings.

 

You can always select a default languages in your Admin, but it will be used only if osC can't determine the language from the browser or does not have the browser's default language.

 

Regards

Jim

 

How do the big companies cope when they have domains in every country?

Is there anyway to run oscommerce within an iframe for example?

Would google really consider them duplicates if the pages were in different languages?

Link to comment
Share on other sites

1. I suspect that the big companies have several people assigned to keeping their sites high in the rankings, as well as social networking and advertising. Their methods are considered highly confidential trade secrets. Good luck finding ouit.

 

2. I'm sure there is, but why would you want to?

 

3. Probably not, if googlebot retrieves all of the pages on the two sites in different languages.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

1. I suspect that the big companies have several people assigned to keeping their sites high in the rankings, as well as social networking and advertising. Their methods are considered highly confidential trade secrets. Good luck finding ouit.

 

2. I'm sure there is, but why would you want to?

 

3. Probably not, if googlebot retrieves all of the pages on the two sites in different languages.

 

Regards

Jim

 

except googlebot's default is probably english and when it searches the French site with a french domain, oscommerce is going to default the language to English?

Can I get round that by replacing the english folder entirely in the French site so the only language will be French?

It gets a bit complicated when trying to combine sales history, invoices, etc.

Is there a way to add the letters FR to every invoice on the French site? I'm assuming I can't use the same backend database?

Link to comment
Share on other sites

Googlebot doesn't request a language. It takes whatever your default is. You can have one language or 20 and it won't make any difference to googlebot.

 

osCommerce doesn't save the language in the orders tables, so you'll need to make any changes before the order is saved.

 

You can have two (or more) sites using the same database and the same Admin. Look for Multi-Shop in the Addons section. I don't know how that handles languages, but it does have the rest of the features you seem to want.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Googlebot doesn't request a language. It takes whatever your default is. You can have one language or 20 and it won't make any difference to googlebot.

 

osCommerce doesn't save the language in the orders tables, so you'll need to make any changes before the order is saved.

 

You can have two (or more) sites using the same database and the same Admin. Look for Multi-Shop in the Addons section. I don't know how that handles languages, but it does have the rest of the features you seem to want.

 

Regards

Jim

 

Thanks, is it the multi stores add on or another? http://addons.oscommerce.com/category?search=multi-shop

These modifications allow you to assign specific products and categories to multiple stores that you define in the administration panel. The products and categories

will not be able to be manipulated via the web-browsers address bar (like in most

other multi-shop implementations). Also, there is no "one store to rule them all".

You decide which categories you want displayed on which store-front. You decide

which products in that category you want displayed on which store-front. Shopping

carts are NOT shared between the sites.

 

I assume I could check the $_SERVER['SERVER_NAME'] and default the language from that as well to "trick" the googlebot for the 2 domains?

Link to comment
Share on other sites

There are several multi-store Addons. I have no experience with any of them. I suggest you ask in the support thread for each Addon.

 

Yes, you can change the code to handle languages differently. Be careful of "tricking" googlebot; if your store returns a different page than what googlebot sees you will be banned by Google.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

// set the language
 if (!tep_session_is_registered('language') || isset($HTTP_GET_VARS['language'])) {
   if (!tep_session_is_registered('language')) {
     tep_session_register('language');
     tep_session_register('languages_id');
   }

   include(DIR_WS_CLASSES . 'language.php');
   $lng = new language();

   if (isset($HTTP_GET_VARS['language']) && tep_not_null($HTTP_GET_VARS['language'])) {
     $lng->set_language($HTTP_GET_VARS['language']);
   } else {
     $lng->get_browser_language();
   }

   $language = $lng->language['directory'];
   $languages_id = $lng->language['id'];
 }

 

So, to change this to an English default, do I set the directory and language id?

Is the language ID from the database?

 

So, I would do:

if $_SERVER['SERVER_NAME'] == '.co.uk' then $language = 'english';

if $_SERVER['SERVER_NAME'] == '.eu' then $language = 'francais';

Link to comment
Share on other sites

$lng = new language();

 

check this class and you will get idea on how language is selected.

Make sure you clear your session before you start checking as flow of code changes once language session var is set.

 

Satish

 

Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site.

 

Check My About US For who am I and what My company does.

Link to comment
Share on other sites

  • 3 weeks later...

OOI, why do I need a multi store addon to use 2 shops with the same back end database?

For example www.shop1.com and www.shop2.net

Why can't their config files point to the different web addresses and then use the same connection settings for the database?

Link to comment
Share on other sites

osCommerce stores most of the configuration data in the database. This includes the store name, email, images sizes, etc. You would want at least some of that to be different for each store.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...