Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#121 2007-03-02 14:53:25

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,276
Website GitHub

Re: MLP - The Multi-Lingual Publishing Pack

FireFusion wrote:

How many languages is too many?

I’m testing it under MySQL 4.0.27 (urk, the best this hoster can do) with 11 languages installed. Running sweetly, albeit somewhat cramped on the MLP>Articles pane! There’s always the option of a widescreen monitor I guess :-D

net-carver wrote:

I plan to address this duplication issue when possible so that the article table can include links to existing renditions so that they can be re-used across many languages.

Awesome! This pack just gets better and better. Truly remarkable.

P.S. I haven’t forgotten about modding <txp:l10n_lang_list /> to handle <select><option>. Hopefully I’ll get round to it today, but things keep cropping up in the office that require my attention. Annoying when work gets in the way of having fun…


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

#122 2007-03-02 20:52:11

stef25
Member
Registered: 2005-12-26
Posts: 88

Re: MLP - The Multi-Lingual Publishing Pack

i installed this extension, all went well. im just wondering how i can insert a link, say at the bottom of an individual article that says “switch to dutch”, the current article being english? or a link somewhere in the header that would switch all the contents of the site to the second language?

very impressed with this so far!


I need someone to protect me from all the measures they take in order to protect me

Offline

#123 2007-03-02 21:05:32

BigMick
New Member
From: Hungary
Registered: 2007-03-01
Posts: 2
Website

Re: MLP - The Multi-Lingual Publishing Pack

I installed the package on an other server (not Windows, it is Linux, Debian, APache 2.2. PHP 5.2, mysql 5.0.32) and the MLP Wizard run correctly. Everithing seemed OK, but the /textpattern/idex.php does not seem to work.
It call a getmicrotime() function, wich would like to work with two variables, $usec and $sec, but these vars have not got any value, and therefore the index.php stops, the page remain empty.
???

BigMick

Offline

#124 2007-03-02 21:20:36

FireFusion
Member
Registered: 2005-05-10
Posts: 698

Re: MLP - The Multi-Lingual Publishing Pack

That’s the same problem as me BigMick

Offline

#125 2007-03-02 22:41:35

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

Re: MLP - The Multi-Lingual Publishing Pack

ultramega (and anyone with sub-directory installations)…

My TXP is installed in subfolder, like this…

I’m working on subdirectory installations now. The current version of the Pack doesn’t do the URL processing/re-writes correctly when installed in a subdirectory. Please be patient — I’m sort-of on holiday with my family and we are going down to the south of England next week.

BigMick, Firefusion

Thanks for the feedback on that. That looks like a potential php problem as the MLP pack doesn’t touch that file; getmicrotime() is a standard Txp function found in lib/txplib_misc.php and it just calls php’s microtime() function.

Are you getting any error messages when you run things?

Bloke

That’s a record as far as I know!

stef25

Thanks for the feedback. Take a look at the l10n plugin help file from the Admin > Plugins tab. Specifically look at the l10n_lang_list tag. That generates links to the other languages available on the site. You can put it in any page template or even in a form that you include into pages. It will generate links to other sections and/or translations of an individual rendition.


Steve

Offline

#126 2007-03-03 00:20:55

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

Re: MLP - The Multi-Lingual Publishing Pack

Subdir installs coming, great :) Actually, my opinion at this very moment is, that my system is anyway working, regardless little bit messed urls.

Stef25, I guess you propably like to have same thing that I asked earlier, to be able to change navigation items too?

If so, make navigation inside a form and then translate it:

Make a form with code:
txp:text item=“snippet_to_be_translated”

Put it on your page template, where you want navigation to be.

Then make links and translation as needed at: MLP – snippets – forms – snippet_to_be_translated

Works for me.

Offline

#127 2007-03-03 09:10:22

FireFusion
Member
Registered: 2005-05-10
Posts: 698

Re: MLP - The Multi-Lingual Publishing Pack

net-carver wrote:

BigMick, Firefusion
Thanks for the feedback on that. That looks like a potential php problem as the MLP pack doesn’t touch that file; getmicrotime() is a standard Txp function found in lib/txplib_misc.php and it just calls php’s microtime() function.
Are you getting any error messages when you run things?

No everything with TXP was working fine before the install. After the install however I noticed I also couldn’t select an admin interface language from the top drop down, only “English GB” was available. All other tabs in TXP worked fine from the looks of it.

If I ran the uninstall wizard I could access the write tab again.

Last edited by FireFusion (2007-03-03 09:12:34)

Offline

#128 2007-03-03 11:38:15

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,276
Website GitHub

Re: MLP - The Multi-Lingual Publishing Pack

I’m including url references in some of my snippets. e.g. “Please <a href="<txp:site_url />register">login or register</a> to play the game.” It works a treat; and the fact it honours txp tags in snippets is marvellous.

[ btw, that snippet is displayed from a piece of PHP code included on every page. If the session vars indicate you’re not logged in, it translates the above snippet and tells you. Conversely, it displays a different snippet “You’re logged in as blah” with a link to a logout page if you’re logged in. Since it’s an external PHP file right now I’ve had to hack it to call the function _l10n_substitute_snippets() and pass it one of two variables that hold ##logged_in## or ##not_logged_in##. I might move it all to a form eventually… legacy code, meh! ]

Anyway, my (currently fictional) translators will be given the job of translating the snippets and pages. The docs say that when they’re given a rendition to work on, they translate it, clear the url_title, set the status to Live and publish. In this case, the page URL might become “enregistrer” in French. Then they’ll have to visit any snippets that mention the login page, translate them as usual and also adjust the French URL to point to ‘enregistrer’ instead of ‘login’.

Switching languages with just articles and forms is fine, because the url adjustments are all taken care of by MLP, but shared links in PHP included code, or URLs in snippets like this mean more work for me and the translators.

What if I tell them not to clear the url_title box? Then they only have to translate the snippet text but ignore any URLs embedded in them, which is less work. And I can be sure that when I code a URL link in PHP to go to the “register” page it will always go there, without having to write any fancy switch() or language detection.

Of course, when the rendition is saved TXP whinges that “The same URL-only title is used by xx different articles” but it doesn’t seem to mind, and no matter which language is currently shown, the link works without modification.

My questions:

1) Is this too much of a kludge?
2) Will I (or TXP) come unstuck when the system starts to fill up with articles?
3) Should I really be doing it some other way?

Any thoughts/pointers greatly appreciated.


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

#129 2007-03-03 16:30:38

stef25
Member
Registered: 2005-12-26
Posts: 88

Re: MLP - The Multi-Lingual Publishing Pack

netcarver – i should have rtfm! thanks, works now. very impressed

ultramega – yeah, so if i understand it right all content that should be available in two languages (including site navigation, footer, etc) should actually be an article – correct?


I need someone to protect me from all the measures they take in order to protect me

Offline

#130 2007-03-03 20:57:35

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

Re: MLP - The Multi-Lingual Publishing Pack

stef25: not correct :)

You translate articles, the content, but things which are belonging to your site’s “layout” or template or so on, like navigation items, those are best handled via forms. That way you can even drop some navigation items off, if you are not going to translate those parts of site at all, or you like to have special links for example to the outer world, depending the language. This is how I have it now and it works like a toalet.

You can use forms as “includes”, that was quite big inventing for me when I started to use txp. So you make a form, with code txp:text item=“to_be_translated_footer”, then include that form on your template. After that go to snippets translation and translate your footer for both languages.

Offline

#131 2007-03-03 22:38:19

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

Re: MLP - The Multi-Lingual Publishing Pack

Bloke wrote:

The docs say that when they’re given a rendition to work on, they translate it, clear the url_title, set the status to Live and publish. In this case, the page URL might become “enregistrer” in French. —SNIP— Switching languages with just articles and forms is fine, because the url adjustments are all taken care of by MLP, but shared links in PHP included code, or URLs in snippets like this mean more work for me and the translators.

What if I tell them not to clear the url_title box?

Perfectly fine — see below.

Then they only have to translate the snippet text but ignore any URLs embedded in them, which is less work. And I can be sure that when I code a URL link in PHP to go to the “register” page it will always go there, without having to write any fancy switch() or language detection.

Of course, when the rendition is saved TXP whinges that “The same URL-only title is used by xx different articles” but it doesn’t seem to mind, and no matter which language is currently shown, the link works without modification.

With the MLP Pack installed it is fine to have each rendition of an article have the same URL-only-title because each rendition is stored in a different, language-specific, textpattern table. It seems to me that the reason TxP complains about duplicate URL-only-titles is to try to ensure that it can always resolve URLs to articles in clean url modes such as section-title where no unique article ID exists in the URL. If two articles with the same URL-only-title existed in the same section then TxP wouldn’t be able to tell which one you were trying to access.

As the MLP pack totally separates content based on language it is OK to have an English and a French (and Italian, and Japanese… etc…) rendition with exactly the same URL-only-title — MLP will just select the correct language table to pull them from.

However, do make sure that the URL-only-titles differ across articles. Otherwise you will end up with an ambiguous URL problem. In other words, if you have two articles A and B on a site in (En)glish and (Fr)ench it is totally ok to do this…

URL-only-title-A(En) == URL-only-title-A(Fr)

but you have a problem if…

URL-only-title-A(En) == URL-only-title-B(En)

As the same URL-only-title will appear twice in the English version of the Textpattern table.

Hope that answers your question.


Steve

Offline

#132 2007-03-03 22:45:20

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

Re: MLP - The Multi-Lingual Publishing Pack

stef25

yes, ultramega is correct. You should be putting your layout or static content into pages or forms. Snippets (in both the txp:text and ##...name...## form) allow you to localise the content within your pages and forms.


Steve

Offline

Board footer

Powered by FluxBB