News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Disable english language (site)

Started by EvanGR, November 05, 2018, 09:21:12 AM

Previous topic - Next topic

EvanGR

Hello,

Our VM site is in the Greek language (front-end). English is 'disabled' for the front-end.

However, if one types in the URL "?/language=en-GB"
then the English strings are loaded (or attempt to be be loaded) in the website.

Google has picked this up. And strings like "COM_VIRTUEMART_CHECKOUT" show up in the site and the search result.

Any idea how to fix this? Thanks

PS. The administrator backend is in English, and we want it that way.


[VM3.2.15/J3.8.10]

Jörgen

You could copy all the greek language files to their GB versions. At least You would get greek text instead of english.
Maybe there is a more kosher way to stop finding english text, perhaps inactivate the english front end language ?

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

kishoreonwork

#2
A better approach will be 301 redirect to greek language url  when ever  current url contains  english lang.

It can be done through .htaccess  , a system plugin or sef plugin which allow redirection based on condition.

Or simple add below code to you template index.php at the top




<?php 
$jinput
=JFactory::getApplication()->input;

$lang $jinput->get('language');

if (
$jinput->getMethod() === 'POST'
|| count($jinput->post) > 0
|| count($jinput->files) > 0)
{
// If it is post request skip
 }else{

if($lang=='en-GB' ){
// we need to do redirection  when it is english

$current_urlJUri::getInstance()->toString(); 

$greek_uri=str_replace('en-GB','el-GR',$current_url); // change your language constant

header("HTTP/1.1 301 Moved Permanently"); 
header("Location: $greek_uri"); 
exit;

}

}

?>





Thanks
Kishore
I am available for paid joomla and virtuemart consulting.
http://www.kishoreweblabs.com/
skype kishore2607

Studio 42

Because you have only 1 language, it's better to redirect all to greek index when language is set

<?php $app JFactory::getApplication();
$lang $app->input->get('language');
if(!empty(
$lang) && $lang !=='el-GR') {
  
$app->redirect(JRoute::_('index.php&lang=el-GR'));
}
?>

This should prevent google indexing the pages and redirect to home for all users. You can set this code on the top of your template index.php file for eg.

EvanGR