11
DonXoop
Re: Language Changer


That just came out, I'm going to take a look.

Meanwhile, I put mine up again but this time in a Downloads module: Language Module

12
siweb
Re: Language Changer
  • 2005/3/5 8:58

  • siweb

  • Not too shy to talk

  • Posts: 150

  • Since: 2004/5/2 1


I think, that Language module should be included in core long time ago and now combined with GIJOE's The Easiest Multi-Language Hack. This combination is so simple and yet so powerful.

13
DonXoop
Re: Language Changer

Bingo! Nice to finally see talk about basic language switching. As you can see this module simply leverages the existing core language functions, but doesn't handle translation. The GIJoe hack does translation but doesn't handle the core language setting. Together we'd have proper multi language without a heavy hack.

The basic language switching should be a core function. The guts are already in the core, my module only gives a way to use it. Now to combine the two modules/hacks for the whole works.

Now I want to combine the two so that a single click switches the core language and allows for the translation to function.

14
Dave_L
Re: Language Changer
  • 2005/3/5 20:28

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


Don, are you working on this?

If so, will it also include language auto-detection, using the "Accept-language" HTTP header? I figured out how to do that for another script, and can contribute the code if you need it.

15
DonXoop
Re: Language Changer

All I did with the module is to make it work on XOOPS 2 (It was an old v1 module). It was a good compromise on my site since I didn't want to burden the server with not having cache (the downside of the ML hack). Adding auto language detection would be excellent. Is the code efficient, in that it doesn't re-evaluate on every page? The user should still be able to switch languages as needed.

So yes, pass along the auto detect code and I'll see if it can be slipped in. You are of course welcome to try as well.

Adding the auto detect and the GIJoe hack together in one module would be ideal. I still have to test the GIJoe hack and see if I can combine them for a one click switch.

16
Dave_L
Re: Language Changer
  • 2005/3/5 22:20

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


I think the code's reasonably efficient. It's used in my Browser Check script. It first checks whether the language is defined in a get/post variable. If so, it uses that choice. Otherwise it tries to auto-detect. The user can override the language selection with a menu.

Maybe it would be easier if I look at the final hack (the merged result of yours and GIJOE's), and then I'll see if I can add the auto-detect.

17
DonXoop
Re: Language Changer

Good idea. The first thing I did today was to modify my own module with more English defaults from the German (or was that Dutch?). The new version might be easier and has been uploaded.

I installed both hacks and made a custom block with links that set both option variables ($easiestml_lang & $sel_lang). That seemed to work. Next step is to unify the functions so that a single variable will do both. Then merge the two into a single module and hack.

Right now each one has a single hack in different files (mainfile.php for GIJoe's and include/common.php for mine). I'd like to simplify that a bit.

I'm a bit weak as a coder but can struggle when I need to. I needed multi language on my site but couldn't find simple solutions. The ML hack is great but is heavy on the hacks and presents upgrade and caching issues. I hope we can create a lighter version as an alternative.

18
siweb
Re: Language Changer
  • 2005/3/6 21:12

  • siweb

  • Not too shy to talk

  • Posts: 150

  • Since: 2004/5/2 1


I have noticed that cookie is not site specific. If I change language settings on one site, it is set for all sites that use your module.

19
Dave_L
Re: Language Changer
  • 2005/3/6 22:04

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


By "site-specific", do you mean "path-specific"? Cookies created from one domain cannot be read from another domain.

20
Peekay
Re: Language Changer
  • 2005/3/6 22:48

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


Not in the same league as the multi-language solution you are discussing, but for a *very* light workaround, the Google translator service may be useful to help foreign speaking site visitors find their way around a website?

Login

Who's Online

262 user(s) are online (172 user(s) are browsing Support Forums)


Members: 0


Guests: 262


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