Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Quick language switch

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I use JForum and I want to implement a new feature :

A menu which allows users switching language quickly. This menu would be visible in each page of the forum.

May you have some clues to help me doing that ?

Regards.
[originally posted on jforum.net by zwibir]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It shouldn't be too hard. The one issue I can see is that the list of languages is basically hard coded into the user_form.htm template.

You probably should convert the options list into a separate "sub" template that can be included as needed (and maintained in one place).

To have a "change language" option box, you will have to add a form to the desired page(s) that includes a hidden user id and the language drop down box.

You'll probably need to add an "saveLanguage()" method to the UserAction class to act as the form action. One issue I see here is how to make sure you can redirect the user back to their original page. You may need to include the calling page URL as a hidden field.

Make sure you review the security methods used in the editSave() code (user profile update). You don't want to let hackers change everyone's language. Only admins and the user should be able to call the form action and have it work.
[originally posted on jforum.net by monroe]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for your response !

I tried to copy the list of languages coded into the user_form.htm to bottom.htm but I always get an error such



For information the code I put is like that:



I tried with only the user's id :



But I always get this error.


I can't understand why "u" is recognized in user_form.htm but not in "bottom_htm".

Do you know the solution ?


p.s : I forgot to thank you for this cool forum

bye !


EDIT : I found that "u" is put into context in the UserAction class but I'm still blocked
[originally posted on jforum.net by zwibir]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all

First, I'd like to thanks the JForum team for its work; a handy one for sure ;)

I'm also interessed in a "language-switching" mechanism. But, a little more precisely than zwibir (keep on guy, you'll get it ) a url-based one.

The idea of my boss (of our current customer in fact) is to setup something that could roughly look like:

http://www.ilovejforum.com/jforum-2.1.7-r4/forums/list.page?language=de_DE

For german users of the application and

http://www.ilovejforum.com/jforum-2.1.7-r4/forums/list.page?language=sp_SP

For spanish ones

Is this kind of evolution:
- planned ?
- possible ?
- hard to implement ?

Thanks for your coming answers, your work and your fancy Squirrel ;)
[originally posted on jforum.net by MathieuV]
 
Friends help you move. Good friends help you move bodies. This tiny ad will help:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic