Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: problem when direct linking to specific language on website

  1. #1
    Join Date
    Dec 2008
    Posts
    27

    Default problem when direct linking to specific language on website

    Hi every1!

    Im having a problem when using ump..

    What I did is removed all the hardcoded page_main_#.html and created them with the page editor, so my client could modify them inside OR on both languages..

    BUT when I try to change the language either cliking on the flags or from the index, it only changes the content but the header is still in the other language..
    dont know if there is a way to fix this??


    thanks a lot!
    Last edited by FaQ3D; 02-18-2009 at 03:15 PM. Reason: privacy reasons..

  2. #2
    Join Date
    Jul 2005
    Location
    Sao Paulo, BRAZIL
    Posts
    3,763

    Default Re: problem when direct linking to specific language on website

    Quote Originally Posted by FaQ3D View Post
    ...What I did is removed all the hardcoded page_main_#.html and created them with the page editor, so my client could modify them inside OR on both languages...
    You removed the page#_main.html files... Put them back and there is more to do:
    Start making all them a exactly copy of main.html file (they will have the {content} tag).
    At Spanish Site, if you load the pageID 4 and wants to change to English, the way you did the site will keep loading pageID 4 wich content is always the same - of course! So wich is the solution? You need to have the translation of pageID 4 at a different pageID and you need to hardcode at your English page4_main.html a simple HTML redirect to the correspondent English pageID. In other words: at Spanish, if you are reading pageID 4 (page4_main.html) and click at English, the site need to load (for example) pageID 104 (page104_main.html - redirected from page4_main.html at the SAME template folder). At vice-versa... at the OTHER template folder you will have a page104_main.html redirecting to page4_main.html at the same template folder.

    Got it?
    Eduardo

    Open-Realty® DOCs
    We can easily forgive a child who is afraid of the dark; the real tragedy of life is when men are afraid of the light. (Author Unknown)

  3. #3
    Join Date
    Dec 2008
    Posts
    27

    Default Re: problem when direct linking to specific language on website

    edited this message cause its fixed..
    Last edited by FaQ3D; 02-18-2009 at 03:14 PM. Reason: already fixed that!

  4. #4
    Join Date
    Dec 2008
    Posts
    27

    Default Re: problem when direct linking to specific language on website

    All right! finally I understood the concept!! took a while to understand! but now its clear as water!

    I got it working smooth now! its an awesome concept! Why dont you implement it on UMP??


    I want to thanks Eduardo, without you this forum wouldnt be as helpful as it is!!!

    Thanks again!

  5. #5
    Join Date
    Dec 2008
    Posts
    27

    Default Re: problem when direct linking to specific language on website

    Ok.. I got everything setup and running

    One more thing is

    why cant I direct link from www.domain.com to www.domain.com/home/index.php?lg=es or www.domain.com/home/index.php?lg=en

    the OR installation is located at www.domain.com/home/

    how can i direct link to a specific language ??

    thanks a lot for the help!

  6. #6
    Join Date
    Jul 2005
    Location
    Sao Paulo, BRAZIL
    Posts
    3,763

    Default Re: problem when direct linking to specific language on website

    Quote Originally Posted by FaQ3D View Post
    One more thing is why cant I direct link from www.domain.com to www.domain.com/home/index.php?lg=es or www.domain.com/home/index.php?lg=en the OR installation is located at www.domain.com/home/ how can i direct link to a specific language ??
    This is a known issue and we had no time to change the PHP code at the multilingual add-on.

    That's because the multilingual add-on (around line 292) uses "$ _SERVER['HTTP_REFERER']" to change the session language and to keep at the same page where you requested to change it. You may disable this feature and test if the add-on still works fine (commenting lines 287 to 297).

    After Brazilian Carnival... ...I will be back coding UMP.

    Eduardo

    Open-Realty® DOCs
    We can easily forgive a child who is afraid of the dark; the real tragedy of life is when men are afraid of the light. (Author Unknown)

  7. #7
    Join Date
    Dec 2008
    Posts
    27

    Default Re: problem when direct linking to specific language on website

    Hi Eduardo! have fun in the carnavales!! I know you will xD

    Ok i tried commenting the lines on the addon but still wont work..

    I commented this lines:

    Code:
    	// pbflash code from his Template Changer Add-on
    /*	if (isset($_GET['lng'])) {
    		$set = $_GET['lng'];
    		$set = preg_replace('#[^a-zA-Z0-9_-]#', '', $set);
    		$_SESSION['lng'] = $set;
    		if (isset($_SERVER['HTTP_REFERER'])) {
    			$location = $_SERVER['HTTP_REFERER'];
    			} else {
    			$location = $config['baseurl'] . '/index.php';
    			}
    		header('Location: ' . $location);
    		}*/
    	return $display;
    	}
    did I commented the right lines?

    Thanks a lot for the help..

  8. #8
    Join Date
    Jul 2005
    Location
    Sao Paulo, BRAZIL
    Posts
    3,763

    Default Re: problem when direct linking to specific language on website

    Quote Originally Posted by FaQ3D View Post
    did I commented the right lines?
    Nope... Try this:
    PHP Code:
    if (isset($_GET['lng'])) {
    $set $_GET['lng'];
    $set preg_replace('#[^a-zA-Z0-9_-]#'''$set);
    $_SESSION['lng'] = $set;
    /*if (isset($_SERVER['HTTP_REFERER'])) {
    $location = $_SERVER['HTTP_REFERER'];
    } else {
    $location = $config['baseurl'] . '/index.php';
    }
    header('Location: ' . $location);*/

    Eduardo

    Open-Realty® DOCs
    We can easily forgive a child who is afraid of the dark; the real tragedy of life is when men are afraid of the light. (Author Unknown)

  9. #9
    Join Date
    Dec 2008
    Posts
    27

    Default Re: problem when direct linking to specific language on website

    I cant stop saying thank you Eduardo!

    now its working like a charm!

    You going to fix it on the next release maybe??

    thanks!

  10. #10
    Join Date
    Dec 2008
    Posts
    27

    Default Re: problem when direct linking to specific language on website

    Buenas! aqui estoy de vuelta molestando un poco..

    Resulta que la solucion anterior si funciona, pero mis clientes se quejan de que al pasar de idioma se regresa a la pagina principal y no se mantiene en la pagina actual como seria normalmente..

    No habra alguna otra manera de mantener esta opcion y a la vez poder linkear desde una pagina externa a un idioma en especifico??

    Espero q haya una solucion a este problema, ya que todas las paginas que hago necesitan de una pagina de inicio donde se selecciona el idioma..

    saludos!!

Similar Threads

  1. Replies: 6
    Last Post: 01-26-2009, 08:08 AM
  2. Linking to specific searches...
    By james_germany in forum General Help (CLOSED)
    Replies: 2
    Last Post: 10-30-2006, 05:28 PM
  3. Language problem in the DB
    By keksy in forum General Help (CLOSED)
    Replies: 3
    Last Post: 10-27-2006, 04:13 AM
  4. Language file to direct to a page?
    By Adamck in forum General Help (CLOSED)
    Replies: 0
    Last Post: 05-22-2006, 01:43 PM
  5. Problem linking to custom pages
    By notmyrealemail in forum General Help (CLOSED)
    Replies: 2
    Last Post: 12-10-2005, 09:59 PM

Bookmarks

Posting Permissions

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