Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-11-28 19:49:10

fpradignac
Plugin Author
From: France near Cognac
Registered: 2005-01-29
Posts: 359
Website

Switch language menu for all users

Hello,

Is there’s a way to simply add the list_language menu for everyone : then all users can choose there admin language interface ?
The problem with a plugin and a new extention tab is that only 1 and 2 privileges can see the extention tab.

thanks.

Last edited by fpradignac (2007-12-12 20:42:30)


françois

Offline

#2 2007-11-28 20:48:05

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Switch language menu for all users

what list_language menu do you mean… the one in the advanced preferences?

Offline

#3 2007-11-28 21:01:15

fpradignac
Plugin Author
From: France near Cognac
Registered: 2005-01-29
Posts: 359
Website

Re: Switch language menu for all users

Yes, the drop down menu that let you choose the “Currently active language” : admin >> preference >> language.


françois

Offline

#4 2007-11-28 22:15:49

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Switch language menu for all users

Yes, the drop down menu that let you choose the “Currently active language” : admin >> preference >> language.

Actually, it will change the whole site’s language, including the public txp-tags that use pre-made texts, not only the admin side.

Cheers!

Offline

#5 2007-11-29 03:08:58

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

Re: Switch language menu for all users

fpradignac

Check out the MLP Pack, it allows you to do this already. However, it’s overkill if all you want is an admin-side language switcher.


Steve

Offline

#6 2007-11-29 05:51:39

fpradignac
Plugin Author
From: France near Cognac
Registered: 2005-01-29
Posts: 359
Website

Re: Switch language menu for all users

Gocom

Actually, it will change the whole site’s language, including the public txp-tags that use pre-made texts, not only the admin side.

Yes… that’s what I need ;-)

net-carver

However, it’s overkill if all you want is an admin-side language switcher.

Yes, it’s my problem : MLP is a bit heavy for my need.
I’ll try to “extract” the little part of MLP that do the switch and creat a plugin .. if I’m able to do so.

Last edited by fpradignac (2007-11-29 05:51:57)


françois

Offline

#7 2007-11-29 09:01:11

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Switch language menu for all users

Instead of trying to find what little piece of MLP does the language switching, you’re probably better of writing a plugin from scratch. Most of the work is in the user-interface (allowing the user to switch admin language), not in actually switching the language. Instead of using the extensions tab, I’d go for the admin -> users tab and add an option there using javascript.

Offline

#8 2007-11-29 09:23:55

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

Re: Switch language menu for all users

Ruud

You beat me to the post!

fpradignac

The MLP Pack switcher separates the public and admin switching, making them both switch on a per-user basis. That’s great for bigger ML sites where you not only have visitors using several languages but potentially many admin users (copywriters/editors — those who do the actual translating) who, on an individual basis, might want to select to work with the TxP admin interface in their own language.

If you don’t need that per-user-admin-language selection feature then Ruud is right: don’t bother cutting from the MLP code — all it eventually does is call the TxP function load_lang anyway.


Steve

Offline

#9 2007-11-29 10:27:58

fpradignac
Plugin Author
From: France near Cognac
Registered: 2005-01-29
Posts: 359
Website

Re: Switch language menu for all users

Many thanks Steve and Ruud,
I’ll try to work on your suggestions.


françois

Offline

#10 2007-12-07 23:58:36

fpradignac
Plugin Author
From: France near Cognac
Registered: 2005-01-29
Posts: 359
Website

Re: Switch language menu for all users

I can’t find the way to call a TXP function in my admin side plugin :-(
Call to undefined function: … : is there a “rule” to re-use a function from txp_prefs.php for example ?

Last edited by fpradignac (2007-12-08 00:00:22)


françois

Offline

#11 2007-12-08 00:26:16

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Switch language menu for all users

What TXP function?

Offline

#12 2007-12-08 05:57:01

fpradignac
Plugin Author
From: France near Cognac
Registered: 2005-01-29
Posts: 359
Website

Re: Switch language menu for all users

… sorry : function languages($name, $val) in txp_prefs.php


françois

Offline

Board footer

Powered by FluxBB