Thread: Force Language

Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17
  1. #11
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Force Language

    You may need to do the flip for the language to avoid this ...

    In theory if you have no direct link to language changes, then there should not be a way to switch ... as DrByte indicated ...

    However to make life easier on upgrades etc. it is recommend not deleting english or you will be very very sad on upgrades ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  2. #12
    Join Date
    Sep 2006
    Posts
    10
    Plugin Contributions
    0

    Default Re: Force Language

    exist simple solution:

    meta_tags.php in EN

    PHP Code:
    // Define REFRESH_ADDRESS
    define('REFRESH_ADDRESS''http://localhost/zen/index.php?main_page=index&language=cz'); 
    ---------------------------

    add in template
    -------------------------------------------
    PHP Code:
    <?php if (defined('REFRESH_ADDRESS')) { ?>
    <meta http-equiv="refresh" content="1;url=<?php REFRESH_ADDRESS?> " />
    <?php //endif REFRESH-ADDRESS ?>
    ----------------------------

    this force customer in CZ shop, but only on mainpage.
    I would like force on the same page.

    (customer find product via ex. gooogle. Go on product page. But page is in En lang. without many texts. And metatag redirect to same page in default lang. (CZ lang.) or not only on mainpage in def. lang..)

    Its the same function like laguage flags. But i am not able edit code for this case (mean edit for use in metatag ). (low php and mysql skill)

  3. #13
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: Force Language

    Quote Originally Posted by tripleTTT
    customer find product via ex. gooogle. Go on product page. But page is in En lang.
    The page should not be in english if the customer has not set a language. Doesn't matter if it comes from Google or not.

    ...unless you have changed the setting for "Admin->Configuration->My Store->Language Selector". It should be set to "Default".
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  4. #14
    Join Date
    Sep 2006
    Posts
    10
    Plugin Contributions
    0

    Default Re: Force Language

    this is alredy set and still is going to happen.

    with metatag customer never get lost in translation.

  5. #15
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Force Language

    Have you tried it and it DOES happen? If so, you have a problem that needs to be addressed. If not, listen to DrByte.

  6. #16
    Join Date
    Nov 2003
    Posts
    1,987
    Plugin Contributions
    15

    Default Re: Force Language

    I got the same issue I think.

    Some products are indexed by google with the "language=en" parameter. I think it started because I have had languages box displayed in the beginning (as far as I can see it only happens with "old" products, and all defaults are set to Dutch, and not to browser language).

    I think I can come up with a solution myself, but I found this thread while looking if it already had been done by someone else ;-)

    Maybe I will just add a:
    Code:
    if(isset ($_GET['language'])){
    $_GET['language'] = 'nl';
    }
    or:
    Code:
    if(isset ($_GET['language'])){
    $_GET['language'] = DEFAULT_LANGUAGE;
    }
    somewhere as a quick fix?

  7. #17
    Join Date
    Nov 2003
    Posts
    1,987
    Plugin Contributions
    15

    Default Re: Force Language

    For now I added this to my init overrides/ folder (1.3.5):
    <?php
    /**
    * initialise language handling
    * see {@link http://www.zen-cart.com/wiki/index.p...als#InitSystem wikitutorials} for more details.
    *
    * @package initSystem
    * @copyright Copyright 2003-2005 Zen Cart Development Team
    * @copyright Portions Copyright 2003 osCommerce
    * @todo ICW(SECURITY) is it worth having a sanitizer for $_GET['language'] ?
    * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
    * @version $Id: init_languages.php 2753 2005-12-31 19:17:17Z wilt $
    */
    if (!defined('IS_ADMIN_FLAG')) {
    die('Illegal Access');
    }
    if (!isset($_SESSION['language']) || isset($_GET['language'])) {
    $lng = new language();
    if (isset($_GET['language']) && zen_not_null($_GET['language'])) {
    $lng->set_language($_GET['language']);
    } else {
    if (LANGUAGE_DEFAULT_SELECTOR=='Browser') {
    $lng->get_browser_language();
    } else {
    $lng->set_language(DEFAULT_LANGUAGE);
    }
    }
    $lng->set_language(DEFAULT_LANGUAGE);
    $_SESSION['language'] = (zen_not_null($lng->language['directory']) ? $lng->language['directory'] : 'english');
    $_SESSION['languages_id'] = (zen_not_null($lng->language['id']) ? $lng->language['id'] : 1);
    $_SESSION['languages_code'] = (zen_not_null($lng->language['code']) ? $lng->language['code'] : 'en');
    }
    ?>
    The red line is the difference with the default lang init file. Might add a switch later on, and change the red line to:
    if(FORCE_DEFAULT_LANGUAGE == 'true'){
    $lng->set_language(DEFAULT_LANGUAGE);
    }
    (or just remove it when I ever need more than one language again)

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Parcel Force
    By Nick1973 in forum Addon Shipping Modules
    Replies: 4
    Last Post: 6 Oct 2011, 11:59 PM
  2. Multiple language, can only see english language
    By stefanl in forum General Questions
    Replies: 2
    Last Post: 2 Oct 2011, 04:54 PM
  3. How to set a default country per language for multi language sites
    By lacabessa in forum Addon Language Packs
    Replies: 2
    Last Post: 18 Nov 2006, 11:00 PM
  4. Issues with French language (or alternate language) packs
    By mommydesigns in forum Addon Language Packs
    Replies: 1
    Last Post: 23 Aug 2006, 05:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg