Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2016-12-29 19:31:33

Eugen
Member
Registered: 2016-12-25
Posts: 10

<txp:text item="sections" /> don't print translated data from DB

Page language: German

Code: <txp:section_list include_default="0" wraptag="ul" class="menu" break="" sort="name" label='<txp:text item="sections"/>' exclude='page' labeltag="a">

Result: <a>sections</a>

All other <txp:text> items are printed fine, for example:

<txp:category_list wraptag="ul" class="menu" break="" sort="name" children="0" label='<txp:text item="categories"/>' labeltag="a" section="">

prints: <a>Kategorie</a>

Offline

#2 2016-12-29 20:06:50

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 7,498
Website

Re: <txp:text item="sections" /> don't print translated data from DB

On the public site, only language strings from the two groups public and common are made available for translation:

  • The translation string for categories is in the public group. Included on the page.
  • The translation string for sections is in the section group. Not downloaded. Not available on the page.

The closest matching string you can get that is in one of the public-facing groups (though for the life of me I don’t know why!) is tab_sections.

We probably ought to make <txp:text> more clever and able to either fetch (and cache) on-demand any strings that have not been downloaded already, or simply permit you to force a database fetch via a tag attribute. If anyone has any views on this, 4.7.0 would be a good time to improve this area.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#3 2016-12-29 21:17:34

Eugen
Member
Registered: 2016-12-25
Posts: 10

Re: <txp:text item="sections" /> don't print translated data from DB

Ok, understand, it works. Thank you!

Offline

#4 2016-12-30 07:31:35

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,146
Website

Re: <txp:text item="sections" /> don't print translated data from DB

Bloke wrote #303436:

We probably ought to make <txp:text> more clever and able to either fetch (and cache) on-demand any strings that have not been downloaded already, or simply permit you to force a database fetch via a tag attribute. If anyone has any views on this, 4.7.0 would be a good time to improve this area.

+1

Yep! Stef, did you project to add an attribute <txp:text item="something" lang="en-gb" /> for multilingual websites conveniences?


Patrick.
Txp Tricks & Tips by french users : http://txp-fr.net | G+
Github

Offline

#5 2016-12-30 09:28:44

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 7,498
Website

Re: <txp:text item="sections" /> don't print translated data from DB

Pat64 wrote #303441:

did you project to add an attribute <txp:text item="something" lang="en-gb" /> for multilingual websites conveniences?

Absolutely!

If you wished to grab a portion of the URL (e.g. fr.example.org) you could plug the language portion into the tag to get some way towards a multilingual site experience. All that then remains is content. Once the textpattern table is altered to include a ‘language’ column you could also plug that value into an article_custom tag to drag out content in the given language. A native way of doing so (i.e. automatically reading the language) has been sketched in my head.

But that’s not planned just yet. All in good time…

Related discussions:

I’m sure there’s a big post I made on a simplistic plan for a way to implement multi-linguality, including how to change the table structures to do it, but I can’t find the post :-(


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#6 2016-12-30 12:39:42

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,146
Website

Re: <txp:text item="sections" /> don't print translated data from DB

Bloke wrote #303442:

Absolutely!

Hip Hip Hurray for Stef!

:)


Patrick.
Txp Tricks & Tips by french users : http://txp-fr.net | G+
Github

Offline

Board footer

Powered by FluxBB