Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#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
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 thepublic
group. Included on the page. - The translation string for
sections
is in thesection
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
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.
Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.
Offline
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?
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:
- Public-side URLs
- The multi-lingual Txp experience
- Multilingual article support
- Multilingual site the simple way
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
Re: <txp:text item="sections" /> don't print translated data from DB
Patrick.
Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.
Offline