Textpattern Forum

You are not logged in. Register | Login | Help

#761 2008-06-17 05:12:15

net-carver
Admin
From: UK
Registered: 2006-03-08
Posts: 1,648

Re: MLP - The Multi-Lingual Publishing Pack

maniqui

hello again. Ok, I’ll look into those when I’ve finished my latest set of changes. FYI, I’m re-writing the mlp url handler at the moment to fix a bunch of problems Kjeld found some time ago. After that I intend updating sed_afu for 4.0.6+,

Stef

Already done in the source. In fact, I had already made a change to make sure mlp’s pretext() routine is always the first called, irrespective of plugin load order (even before there was such a thing.)


Steve
Textile | My plugins on GitHub | @netcarver

Offline

#762 2008-06-17 08:50:41

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,850
Website

Re: MLP - The Multi-Lingual Publishing Pack

net-carver wrote:

I had already made a change to make sure mlp’s pretext() routine is always the first called, irrespective of plugin load order

Way cool; didn’t realise but I should have figured you’d be several steps ahead of the game :-)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern.

Txp Builders – finely-crafted code, design and Txp

Offline

#763 2008-06-17 10:29:29

ultramega
Member
Registered: 2006-02-26
Posts: 221

Re: MLP - The Multi-Lingual Publishing Pack

Was there somewhere guide how to add languages to MLP? I installed german from txp-prefs, but next what? How the new table for it is created, what is correct mysql character set for that table and what should the lang code for german be?

Last edited by ultramega (2008-06-17 10:37:57)

Offline

#764 2008-06-17 13:47:17

net-carver
Admin
From: UK
Registered: 2006-03-08
Posts: 1,648

Re: MLP - The Multi-Lingual Publishing Pack

ultramega

You need to add the string “de-de” (without the quotes) to the Content > MLP > Preferences > Languages preference and then save it. That should take care of creating a new language table for you. Just take a look at the Content > MLP > Articles tab and you should then see a new column for German.

After that it’s a matter of either cloning existing renditions into German for translation or just starting a new rendition in German by visiting the Content > Write tab.


Steve
Textile | My plugins on GitHub | @netcarver

Offline

#765 2008-06-17 14:05:14

ultramega
Member
Registered: 2006-02-26
Posts: 221

Re: MLP - The Multi-Lingual Publishing Pack

Ahaa, ok! Does that create new table with right character settings too (not sure what it should be for german…)? Thanks for helping!

Offline

#766 2008-06-17 14:59:15

net-carver
Admin
From: UK
Registered: 2006-03-08
Posts: 1,648

Re: MLP - The Multi-Lingual Publishing Pack

ultramega wrote:

Ahaa, ok! Does that create new table with right character settings too (not sure what it should be for german…)? Thanks for helping!

Yes, it creates the new table using a utf8 character set.


Steve
Textile | My plugins on GitHub | @netcarver

Offline

#767 2008-06-17 15:19:09

ultramega
Member
Registered: 2006-02-26
Posts: 221

Re: MLP - The Multi-Lingual Publishing Pack

Thanks, thanks :)

Offline

#768 2008-06-18 10:16:10

ultramega
Member
Registered: 2006-02-26
Posts: 221

Re: MLP - The Multi-Lingual Publishing Pack

Possible to somehow hide languages which are being worked on the background? Meaning how to hide one language-link from articles and sitewide lang selector until all snippets and articles are translated?

Offline

#769 2008-06-18 12:51:37

net-carver
Admin
From: UK
Registered: 2006-03-08
Posts: 1,648

Re: MLP - The Multi-Lingual Publishing Pack

ultramega wrote:

Possible to somehow hide languages which are being worked on the background?

Not at present. That does sound like a useful feature for those who grow their site a language at a time. Will think about it.


Steve
Textile | My plugins on GitHub | @netcarver

Offline

#770 2008-06-18 13:21:43

net-carver
Admin
From: UK
Registered: 2006-03-08
Posts: 1,648

Re: MLP - The Multi-Lingual Publishing Pack

ultramega

Turned out to be very easy. Feature added in the development code. If you want to make the change to your installation just edit the plugin and look for this code block…

function l10n_lang_list( $atts )
	{
	global $thisarticle , $l10n_language, $is_article_list , $pretext, $prefs;

	extract(lAtts(array(
		'title'		=> '',					#	Title will be prepended as a paragraph.
		'on404'		=> '', 					#	Set this to non-blank to force special 404 processing

… replace it with this …

function l10n_lang_list( $atts )
	{
	global $thisarticle , $l10n_language, $is_article_list , $pretext, $prefs;

	extract(lAtts(array(
		'title'		=> '',				#	Title will be prepended as a paragraph.
		'surpress_langs'	=> '',			#	Comma separated list of site languages to hide
		'on404'		=> '',				#	Set this to non-blank to force special 404 processing

Then look for this a little farther down (maybe a page or two) the file…

	$list = array();
	static $alangs;
	$slangs = MLPLanguageHandler::get_site_langs();

… and replace with…

	$list = array();
	static $alangs;
	$slangs = MLPLanguageHandler::get_site_langs();

	$surpress_langs = do_list( trim( $surpress_langs ) );
	$slangs = array_diff( $slangs , $surpress_langs );

… and save the changes.

Next: edit your page or form that uses the l10n_lang_list tag. Add surpress_langs="your-lang" to it’s attributes, save the form and view the result.

Hope that helps.


Steve
Textile | My plugins on GitHub | @netcarver

Offline

Board footer

Powered by FluxBB