Snippet: Easy Multilanguage Link

crnogorac081

Hi,

First - Just dont forget to install the patch files..

No, as it is mentioned in first post, you do not need to have same pages on different languages.

For example:

EN                                ES
Home    <home>           Home es
Page 1    <page1>         Pagina 1
Page 2     <seccond>     Paggina 2
Page 3

In <> is page code which needs to be inpuded in page settings. In this example, you see that Page 3 has no match page on spanish. When you click on flag image while you are on that page, you will be redirected to page where you set "home" page code.

Cheers

Web developer

renjithtk07

Hi,

I am trying to add the multilanguage to my site. I have installed the multilanguage module. I have added the code to display the multilanguage icons to the index.php page.

My site have 4 pages in english. Now do I need to create another four pages for spanish? I am not getting a clear idea about how I need to set it. Could you please provide a basic documentation by which a user who is not so much familiar with website baker and multilanguage can get a better idea to use it.

Thanking you..

crnogorac081

Hi Frank,

Please see the image attached. I noticed I ask few questions in same sentence :) So I'll split them:

1. I have menu tree like this:
ME
- ME page 1
- ME page 2
- ...
EN
- EN page 1
- EN page 2
- ..
RU
- RU page 1
- RU page 2
- ...

I understand that it is a little non usual, but is it possible, if you would do any further development for this module, that flags (like on my screenshoot ) use order from menu tree ?

2. My defult language in backend is set to ME, so I would like first flag to be ME, and not EN (like on my screenshoot ) , is it possible ? Does the snippet use alphabet order to set order for flags ?

all best,
I.

[gelöscht durch Administrator]
Web developer

FrankH

Hi Ivan,

you would need to make some code changes.
But would it be a good idea?
Usually users expect the same link to stay on the same position. It would annoy most people when they have to start searching a link after it changed its position, I think.
Ochs und Esel in ihrem Lauf
halt ich leider auch nicht auf

crnogorac081

Hi Frank,

Is there a way to define order of flags ?

For example in my menu tree I have me, en, ru languages

In snippet flag order is en, me , ru ... And If I change defult frontend language in settings, it doesnt change the order.... I would like to set me flag first..

is it possible ?

cheers
Web developer


crnogorac081

in <div><?php easymultilang_menu(); ?> </div> of index.php file where you want multilanguage menu to appear..

cheers
Web developer

mava100

due to my poor skill on php, html, ecc.
where i can put "<?php easymultilang_menu(); ?>"?

in index.php
in *.css?

thanks

crnogorac081

nice nice, I really like this module.

Also on thi thread: https://forum.websitebaker.org/index.php/topic,14555.0.html  you can find how to adapt your search funcion.

cheers

Web developer

FrankH

Quote from: crnogorac081 on July 18, 2009, 03:29:53 PM
what is the difference between 0.3.0 and 0.4.0 ?


  • 0.4 comes not only with 3 patch files for WB 2.7, but also with 5 patch files for WB 2.8
  • HowTo is now html instead of txt
Ochs und Esel in ihrem Lauf
halt ich leider auch nicht auf

crnogorac081

Hi FrankH,

what is the difference between 0.3.0 and 0.4.0 ?
Web developer

FrankH

For all those who do not want to wait for WB 2.9 to come with better multilanguage support:
I just released version 0.4 of the snippet.
It comes with patched files for WB 2.8 and a help file explaining how to patch (it is just as easy as moving some files).
After you installed the module:

  • go to Add-ons - Modules
  • select Easy Multilanguage Link in Module Details
  • click View Details
  • now you have a link to the help file

For security reasons, do not forget to delete both patch directories after you patched the installation!
Ochs und Esel in ihrem Lauf
halt ich leider auch nicht auf

crnogorac081

ok, Im just sayin this is better way to create multilanguage sites :))

Anyway, I'll post the ticket :)
Web developer

BerndJM

#14
@crnogorac081:

QuoteDevelopers, it would be nice to include this to 2.8
nope ... 2.8 is RC1 where RC1 means "feature freeze only bug fixing".
But nevertheless feel free to open a feature request for 2.9
http://project.websitebaker2.org/newticket

Regards Bernd
In theory, there is no difference between theory and practice. But, in practice, there is.

crnogorac081

Nice, just tested it and now it automaticly updates the database :)) great  :-D :-D


I tested it with WB 2.8 RC1 , its working great :)

Just to mention, that "home" page code should be defined, in order to avoid  {l_loop} text whch happened to me :))

Developers, it would be nice to include this to 2.8

Once again Frank, great job.. I really like this :)
Web developer

FrankH

Quote from: crnogorac081 on July 17, 2009, 03:18:10 PM
Also I noticed even on your page, the language is allways selected EXCEPT on the search page, where current language is not "selected" (on your page marked with yellow background)

Can it be marked on search page too ? I tried to change your php code but had no luck :)

I just relaesed version 0.3.0 which does not have the problem with the search page anymore :-)
A search page does not have a language, this is why no language is marked as current.
This way you can jump to the start pages of any language from search.

Quote
Also, I think that this module should me integrated into WB 2.8..

Say this to the developers...
Ochs und Esel in ihrem Lauf
halt ich leider auch nicht auf

crnogorac081

#11
I found it, i had nowhere "home" --as  PAGE CODE set , and now flags are visible now :))


Also I noticed even on your page, the language is allways selected EXCEPT on the search page, where current language is not "selected" (on your page marked with yellow background)

Can it be marked on search page too ? I tried to change your php code but had no luck :)


Also, I think that this module should me integrated into WB 2.8..

Here is EXAMPLE:

CASE 1 , OLD Multilanguage way:

EN
- Page 1
- Page 2
-- Sub page 1
DE
- Page 1
- Page 2
-- Subpage 1


CASE 2, With this module:

Home                          --- EN. language
Galery                          --- EN language
- Video galery                --- EN language
GermanHome                --- DE language
GermanGalery                --- DE language
- German Video Galery     -- DE language


good things I found are:

I noticed that you can place pages with different languages in ROOT, and only the pages of selected languages will be displayed. (if Defult language is EN, pages in root and root+1,2,3.. levels in DE language will not be displayed )

That means that you do not have to make separate /en and /de...  folders for different languages, which would be the root menu ( like in CASE 1) as most people did before. So you will not loose menu when you search -- which was bug , as your root will be displayed after search. (the bug was when you searched, on search page, only root meny was displayed and because your root menu was flags to change the language - CASE 1, menubar was empty)


And what is most important, by clicking on flags, you will be redirected to exact page on different language, and not on the root of /en or /de if you had page structure like in CASE 1..


Guys, please reconsider this :))

cheers

Web developer

FrankH

Quote from: crnogorac081 on July 16, 2009, 08:38:24 PM

Also, sometimes I get:   {l_loop}   text, which is also in the source..


Is this reproducable? How?
Ochs und Esel in ihrem Lauf
halt ich leider auch nicht auf

crnogorac081

#9
In case I didnt explain it well, on the search result page:  /search/index.php  the flags dissapeared.. and there is no html code for them when I view source..

Also, sometimes I get:   {l_loop}   text, which is also in the source..

So basicly the question now is, how to link this {l_loop}  from module and search page :)

cheers
Web developer

FrankH

Quote from: crnogorac081 on July 15, 2009, 09:34:49 PM
Please check this link, I put MY in search box:


http://wbdemo.heysoft.de/search/index.php?string=my&submit.x=0&submit.y=0&submit=Search&search_path=/en


The menu on the left is not visible..

This is correct, and in my last post I explained why it is. This is not a bug, but a feature :-)
But I just found something strange you did not mention:
When I call search on the page, the language menu is still available.
But when I follow an external link to the search page, the language menu is not available.
Despite there is no much sense in a link to a search page, it is really strange. I will check this as soon as I find some time.

QuoteCan you guide me how to keep the flags dissapearing

???

Quotedid you modified anything more in the search page or something ?

No, why should I?
Ochs und Esel in ihrem Lauf
halt ich leider auch nicht auf

crnogorac081

#7
I tried to include this into search/index.php page but no luck, the language are still gone...


include_once(WB_PATH."/modules/easymultilang/include.php");



Maybe someone else can help, How to include function easymultilang_menu()    from file /modules/easymultilang/include.php    into /search/index.php page ?
Web developer

crnogorac081

did you modified anything more in the search page or something ?
Web developer

crnogorac081

Please check this link, I put MY in search box:


http://wbdemo.heysoft.de/search/index.php?string=my&submit.x=0&submit.y=0&submit=Search&search_path=/en


The menu on the left is not visible..

I kinda fixed this problem by putting both languages in root, and it is working, so there is no need to put english pages in /en and germans in /de   as language flags can separate them..

Now I have other problem, when I search something on my test site, I lose FLAGS, and I get {l_loop} text

I removed text next to flags, like you have FLAG English, Flag German.

.htt file looks like this:


<!-- BEGIN l_block -->
<span class="{CLASS}">
       {ASTART}<img src="{IMG}" /> {AEND}
</span>
<!-- END l_block -->


Can you guide me how to keep the flags dissapearing :)
Web developer

FrankH

Quote from: crnogorac081 on July 15, 2009, 06:50:59 PM
Hi,

I found the bug when you use search, the menu dissapears.. ??? Did you find the solution for this ?

You can see the example: http://wbdemo.heysoft.de/pages/en/multilingual-sites.php

cheers



This has nothing to do with the snippet.
It is because my menu (sm2) does not show the root level.
If you are on a german language page, it does show all what is beneath http://wbdemo.heysoft.de/pages/de/
If you are on a english language page, it does show all what is beneath http://wbdemo.heysoft.de/pages/en/
If you are on the search page, it does show all what is beneath http://wbdemo.heysoft.de/search/
Because there are no subpages in the last case, the menu correctly does show nothing.
So if I would want to show the menu always, I would need to include the root level, that's all.

Ochs und Esel in ihrem Lauf
halt ich leider auch nicht auf

crnogorac081

Hi,

I found the bug when you use search, the menu dissapears.. ??? Did you find the solution for this ?

You can see the example: http://wbdemo.heysoft.de/pages/en/multilingual-sites.php

cheers

Web developer