Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-02-07 11:32:22

planeth
Plugin Author
From: Nantes, France
Registered: 2009-03-19
Posts: 238
Website GitHub Mastodon

how do i translate user interface of a site

Hi,

i had a look at many solutions to display multi-language content, and they are really fine.

But my question is : how do i trigger the right language for all the menus and links title ?
I plan to use the built-in gTxt() function but i can’t figure out how to switch the value of <txp:lang />.
As i understood this value is set in the admin prefs.
What is the way when you want to change it in the site side ?
And i don’t want to use the MLP as it’s way over-kill for just a couple of pages.

Thanks for any hint about how i could do that.

Offline

#2 2010-02-07 13:02:37

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: how do i translate user interface of a site

Offline

#3 2010-02-07 14:31:48

planeth
Plugin Author
From: Nantes, France
Registered: 2009-03-19
Posts: 238
Website GitHub Mastodon

Re: how do i translate user interface of a site

Nope, as i said it’s only for content . Not for strings used in navigation menus.

Offline

#4 2010-02-07 15:13:37

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: how do i translate user interface of a site

As far as I can see it can be used for anything, not just articles.

Offline

#5 2010-02-07 15:39:24

planeth
Plugin Author
From: Nantes, France
Registered: 2009-03-19
Posts: 238
Website GitHub Mastodon

Re: how do i translate user interface of a site

Meaning that i have to make 2 differents output forms for the nav just because the language of the title is different ?
Not very maintainable.
I hope to find a cleverer way to do it !

Offline

#6 2010-02-07 17:39:05

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: how do i translate user interface of a site

One more try. What do you want to do? Just this:

…switch the value of <txp:lang />

You can’t. Don’t use <txp:lang />, but Robert’s php snippet instead.

If that’s not what you’re trying to do, I just don’t get it, sorry.

Offline

#7 2010-02-08 07:17:45

planeth
Plugin Author
From: Nantes, France
Registered: 2009-03-19
Posts: 238
Website GitHub Mastodon

Re: how do i translate user interface of a site

hi Els, sorry for my late reply.

Yes , i want to be able tu use the gTxt function which i understood is tied to the <txp:lang /> value.
I want to be able to acces a language-file depending of the language the site visitor is using.

It doesn’t make sense to me that you can choose the admin language and not the viewing language of the site you’re browsing (providing the content is multi-langage).
Plus you need a way for your visitor to choose the language he want, and not only rely on the detection of the ACCEPT_LANGUAGE.

Offline

#8 2010-02-09 13:32:58

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,000
Website GitHub

Re: how do i translate user interface of a site

If I recall correctly, there’s not a way to set the admin and public side languages separately. wet_native allows you to set it per admin-side user but that’s not the same thing as you want. It sounds like what you want is a language attribute for txp:text. Maybe one could write that as a plugin.

FWIW I simply work around it for the front end. In many cases you can override or avoid messages created by txp by crafting your forms accordingly – lots of tags you can use as a container tag with your own text. There are many different ways of structuring multiple-language websites depending on how it is to be used and how the site is structured – per-language categories or sections, article cross-references as a custom field in each article, a mapping table using adi_variables, dual language articles with split content using jcb_columnize and jquery tabs … as well as MLP. Each has a trade-off. It’s a matter of finding one that works best use-wise and design/maintenance-wise.


TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB