1
Elena123
Language selection
  • 2003/6/27 8:35

  • Elena123

  • Just popping in

  • Posts: 27

  • Since: 2003/6/24


I would like to let users choose the language, exist some way to make it?
I've seen an old post that speaks about the hack
"languageonthefly" but it was for XOOPS 1.0.

Something for XOOPS 2?


2
Elena123
Re: Language selection
  • 2003/6/28 11:13

  • Elena123

  • Just popping in

  • Posts: 27

  • Since: 2003/6/24


No one can answer me?


3
Chado
Re: Language selection
  • 2003/6/30 2:15

  • Chado

  • Not too shy to talk

  • Posts: 113

  • Since: 2003/6/6 7


There have been several questions recently about using the language hack by Adi Chiributa in XOOPS 2.x. It was originally hacked for XOOPS 1, but I tweaked it just a bit and have been able to get it to work in my test environment using the two languages that I will be targeting (Japanese and English). It seems to work just fine. (I am not a programmer though so I may be missing something) Just remember, as the author says, this is only for the interface and not content. You can get the hack here from ModsCentral.

In the author's readme he gives instructions on how to install the hack. Basically everything works except for the hack to the XOOPS/include/common.php. Instead of including the hack at the place where he said, include it just BEFORE the “include site-wide lang file” section:

// ############ Include function for language selection ##############
include(XOOPS_ROOT_PATH."/modules/language/common/functions.php");

// #################### Include site-wide lang file ##################

The SPACE character that is part of the default setup shows up strange in the block if you are using the flags, so you will have to change that by selecting edit on the admin blocks page.

If you are going to be using a multi-byte language (like Japanese), you may need to change the character encoding for English or other single-byte languages so that people coming with English browsers will be able to see the content that is in Japanese. If you need to change the character encoding for any of your languages, that setting can be found toward the bottom of the global.php file for each language. It took me a lot of hunting to find that.

I hope this works for you.

4
Elena123
Re: Language selection
  • 2003/6/30 11:55

  • Elena123

  • Just popping in

  • Posts: 27

  • Since: 2003/6/24


Thank you very much. I've tried it and it works

5
swisslyons
Re: Language selection
  • 2003/6/30 12:14

  • swisslyons

  • Just popping in

  • Posts: 43

  • Since: 2002/6/23


language selection is useless if the language of the content does not change in my opinion. I mean, what good does it really do if the menu and title change but you cant read the news?

osCommerce has an excellent solution to handle multiple languages. The content changes and the menus etc. This is accomplished by having additional language tables in the database. Admin can then choose which languases he wants to display on the site, and for each new article input, the admin is given input fields for each of the multiple languages he has selected to display on the site.

This would probably require some pretty heavy hacking to make it work in Xoops, but a worthwhile venture if anyone has the time and knowhow to tackle it. I dont


6
josecruz
Re: Language selection
  • 2003/6/30 13:04

  • josecruz

  • Just popping in

  • Posts: 68

  • Since: 2003/3/28


Fantastic!!!

This is exactly what I was looking for!. The hack works as advertised. I've had it on my site for a couple of hours now and it switches back and forth (Japanese / English) flawlessly.

One warning, it also changes the administration interface language according to the selection made in the user interface block. But this is great!

Jose

7
Chado
Re: Language selection
  • 2003/7/1 15:20

  • Chado

  • Not too shy to talk

  • Posts: 113

  • Since: 2003/6/6 7


Elena, Jose: I am glad the hack worked for you.

I wonder if anyone has tried to make their articles bilingual. I mean, would it be possible to do something like this:
<{if $xoops_langcode =='ja'}> Include my Japanese article here <{else}> Put my English one here <{/if}>

In other words, if the selected language is Japanese, it would only show the Japanese text, or English then only English.
This actually works on my theme.html file, but I can't seem to get it to work form within an article. Can someone who understands coding and XOOPS articles give me a pointer on this.

Thanks!
Chad

8
johny
Re: Language selection
  • 2003/11/7 12:59

  • johny

  • Just popping in

  • Posts: 23

  • Since: 2003/8/25


Hello.

I've installed the module and tweaked the include/common.php file, and it works great. If I turn on debugging feature, though, I get this message displayed:

Quote:
Notice [PHP]: Undefined index: sel_lang in file modules/language/common/functions.php line 2


Any idea what that is all about?

9
johny
Re: Language selection
  • 2003/11/7 12:59

  • johny

  • Just popping in

  • Posts: 23

  • Since: 2003/8/25


(the upper message got posted twice and since I can't delete it, I edited the content out in this message)

10
Daigoro
Re: Language selection
  • 2003/11/7 16:10

  • Daigoro

  • Quite a regular

  • Posts: 223

  • Since: 2003/7/3 2


You should try to check out this thread.

It's pretty long, but mCity makes a pretty good sum-up after the first aproximately 65 posts.



Login

Username:
Password:

Lost Password? Register now!

Who's Online

46 user(s) are online (27 user(s) are browsing Support Forums)


Members: 0


Guests: 46


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits