Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1093 2008-12-14 08:54:13

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

Re: MLP - The Multi-Lingual Publishing Pack

This new release rocks, thanks Steve.

One tiny thing I’ve noticed running r3039 with 0.9.10dev — and this may be stupidity on my part — is that if I put, say, a <txp:thumbnail id="3" /> when there is no thumbnail for that image, I get the white screen of death; even in Live mode.

I know that TXP (sometimes annoyingly, imo) generates an “Unknown image” error if the ID doesn’t exist, but there are times — in galleries for instance — you really don’t care and want it to show the rest of the output, silently ignoring the missing thumbs. In Live mode without MLP the error is gobbled up and the page renders with missing thumbs. With MLP in Live mode, it’s white screen city.

I even tried outputting the contents of the <txp:thumbnail /> into a <txp:variable /> and displaying the value to see if it gave me an inkling as to what was going on, but it still white-screened me. In the absence (yet) of a <txp:if_thumbnail /> to catch this kind of thing, how can I render a gallery with missing thumbs inside MLP? Is there some trick I can employ? (aside from making sure every image has a thumb of course!)

Many thanks for your continued work on this amazing feat of engineering.

Last edited by Bloke (2008-12-14 08:55:09)


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

#1094 2008-12-14 15:59:23

kvnmcwebn
Member
From: Ireland
Registered: 2007-01-27
Posts: 724
Website

Re: MLP - The Multi-Lingual Publishing Pack

Hi,
I’d like to omit one item from a list menu navbar in the second language redition.
But a snippett cant be created around around a txp tag only-correct?. so im not sure how to proceed.

Example:
<li class=“business” id=“business”><txp:section link=“1” title=“1” name=“services” /></li>

<—## (dont show contact li in the second language)
<txp:section link=“1” title=“1” wraptag=“li” name=“contact” class=“contact” id=“contact”/>##—>

Any tips?

Cheers
-kevin

Last edited by kvnmcwebn (2008-12-14 15:59:51)


its a bad hen that wont scratch itself.
photogallery

Offline

#1095 2008-12-14 17:21:25

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

Re: MLP - The Multi-Lingual Publishing Pack

Kevin, something like this?

<li class="business" id="business"><txp:section link="1" title="1"  name="services" /></li>
<txp:l10n_if_lang lang="xx-xx">
<txp:else />
   <txp:section link="1" title="1" wraptag="li" name="contact" class="contact" id="contact"/>
</txp:l10n_if_lang>

Offline

#1096 2008-12-14 17:54:20

kvnmcwebn
Member
From: Ireland
Registered: 2007-01-27
Posts: 724
Website

Re: MLP - The Multi-Lingual Publishing Pack

fantastic.
thanks els.


its a bad hen that wont scratch itself.
photogallery

Offline

#1097 2008-12-16 02:58:05

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: MLP - The Multi-Lingual Publishing Pack

@net-carver

another feature request: what do you think about integrating (as an optional plug-in) this i18n_IP2Country project?

This could add an option to override browser language and use the visitor’ss IP to tell TXP/MLP which language to serve.
If possible, there should be some kind of interface that lets you associate a country to a language.
So, you can set something like: “Argentina, Spain -> es”, “USA, UK -> en”, “France -> fr”, “Others -> en”.

Once the above associations are made, then, in pseudo-algorithm:

1) check the visitor’s IP address
2) define which country is the visitor coming from
3) look which language is associated for that country. If not defined, serve some default language.

Ideally, there should be another option that let you define which data (browser language or IP2country) should be honored.

I see also some possibilities for a txp:i10n_if_country name="..." tag/plugin… :D


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#1098 2008-12-16 08:51:07

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

Re: MLP - The Multi-Lingual Publishing Pack

maniqui wrote:

what do you think about integrating (as an optional plug-in) this i18n_IP2Country project?

Hmm, not wishing to put words in Steve’s mouth but from my own experiments with it before (spookily as an integration with an MLP site) I found:

  • it’s actually not that reliable — I got false negatives in France, for example
  • iirc it only supports IPv4
  • if it ever supports IPv6 it’ll probably need updating frequently as new tranches of IP are released to countries (I’m not sure how IPv6 are allocated so this might not be an issue)
  • the list itself is currently over 700kB as a file, which bloats the MLP download
  • the list has to be stored in the DB (a big table), since finding an entry from a file with over 87000 entries every time you view a page is impractical. That adds a good few Mb to your DB (longer backups/downloads/restores) for very little gain. From memory my 400kB TXP install went up to approx 7Mb with this installed; and that’s without any logs

Like I say, just personal experience with it. Others’ mileage may vary.

Last edited by Bloke (2008-12-16 08:57:10)


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

#1099 2008-12-16 22:09:13

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

Re: MLP - The Multi-Lingual Publishing Pack

All

just to say, I’ve made the MLP Pack repo on GitHub public read-only so anyone with great ideas and some PHP knowledge can now fork the project for themselves.

There are two branches — you can check either but watch the development branch commits if you want to keep up with the latest changes.


Steve

Offline

#1100 2008-12-16 23:34:05

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

Re: MLP - The Multi-Lingual Publishing Pack

Steve, thanks for your replay!

1. Another feature i think would be intersing for others:
Imaging we have article named ArticleCommon. It has two (or more) renditions, each name is ArticleRussian and ArticleEnglish. Imaging, we’re viewing ArticleRussian at site. How do i get the id of ArticleEnglish? I think new tag can be used, like

<txp:l10n_custom_rendition_id lang="en" /> – the idea is to output id of another rendition of required article.

This new (if you like the idea) tag can support such attributes:

  • id = if ommited must be used current articleid (<txp:article_id />)
  • lang = which rendition’s id to output. In my example it was set to en because i was viewing russian rendition. And for some safe parsing, if it is possible, this tag should use language another than viewing currently AND if there are only two languages at site. I hope i described it undestandably :)

This tag, i think, would be popular in developing, because currently i don’t now how to get id of english rendition while viewing russian rendition… Or may be new behaviour could be assigned to l10n_get_rendition_id, if developers aren’using this tag now?

2. Not sure that it’s bug, i think it is future improvement – it’s about View link which is next to the Title field in article write tab

The link is building wring url – when i open it within messy mode i get bad page with errors. I see two ways:

  1. Improve redirection (which redirect me form site.ru to site.ru/ru)
  2. Edit this link in backside, the language to be injected to it could the same as adin side language

Thanks for you plugin! It really rock’s! :)


Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?

Offline

#1101 2008-12-17 00:00:14

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: MLP - The Multi-Lingual Publishing Pack

@Victor

Now we are two requiring this ;)
Take a look at my post here.

My proposal: “What if a rendition for an article could access fields (custom fields, article_image, etc) from another rendition of the same article?”

BTW, Victor, why are you asking this feature?. I mean, what would you like to achieve by having the article ID of another rendition for the same article?

In my case, one of the ideas I’ve for this, it’s to pass it (the id) as the value for article_custom, so then, I could fetch some data from that rendition.
For example, to “share” custom field values across renditions.

Let’s wait for net-carver to see what he has under his sleeves…

@Bloke,

All valid points to reject this IP2Country addition. Thanks for clarifying.

Last edited by maniqui (2008-12-29 20:19:59)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#1102 2008-12-17 00:06:51

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

Re: MLP - The Multi-Lingual Publishing Pack

Julián wrote

BTW, Victor, why are asking this feature?. I mean, what would you like to achieve by having the article ID of another rendition for the same article? In my case, one of the ideas I’ve for this, it’s to pass it (the id) as the value for article_custom, so then, I could fetch some data from that rendition.

My aim seems to be the same – access to custom_fields of another renditions. What for do I need ‘em? :) I have build complicated site tree where elements of tree are only articles. So, articles can have sublelevels, which are articles. I sounds not clearly, but after site would be finished i’m going to publicate my idea :)


Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?

Offline

#1103 2008-12-17 20:58:27

maartenD
Member
From: Warnsveld, The Netherlands
Registered: 2007-12-08
Posts: 47
Website

Re: MLP - The Multi-Lingual Publishing Pack

Hello All,

I upgraded to 4.0.7 and also downloaded the MLP version 0.9.11. When i run my site i get the following errors:

tag_error <txp:article form="static_text" /> -> Textpattern Warning: Unknown column 'Expires' in 'where clause' select count(*) from l10n_txp_nl_nl where 1=1 and Status = 4 and Posted <= now() and (now() <= Expires or Expires = 0) and Section != 'cursus' and Section != 'artikelen' and Section != 'boek' and Section != 'praktijk' and Section != 'contact' on line 110

tag_error <txp:article form="static_text" /> -> Textpattern Warning: Unknown column 'Expires' in 'field list' select *, unix_timestamp(Posted) as uPosted, unix_timestamp(Expires) as uExpires, unix_timestamp(LastMod) as uLastMod from l10n_txp_nl_nl where 1=1 and Status = 4 and Posted <= now() and (now() <= Expires or Expires = 0) and Section != 'cursus' and Section != 'artikelen' and Section != 'boek' and Section != 'praktijk' and Section != 'contact' order by Posted desc limit 0, 10 on line 110

tag_error <txp:article_custom form="sidebar_praktijk" sort="posted asc" time="any" section="praktijk" limit="1" /> -> Textpattern Warning: Unknown column 'Expires' in 'field list' select *, unix_timestamp(Posted) as uPosted, unix_timestamp(Expires) as uExpires, unix_timestamp(LastMod) as uLastMod from l10n_txp_nl_nl where 1=1 and Status = 4 and (now() <= Expires or Expires = 0) and Section IN ('praktijk') order by posted asc limit 0, 1 on line 110

tag_error <txp:article_custom form="sidebar_cursus" time="any" section="cursus" /> -> Textpattern Warning: Unknown column 'Expires' in 'field list' select *, unix_timestamp(Posted) as uPosted, unix_timestamp(Expires) as uExpires, unix_timestamp(LastMod) as uLastMod from l10n_txp_nl_nl where 1=1 and Status = 4 and (now() <= Expires or Expires = 0) and Section IN ('cursus') order by Posted desc limit 0, 10 on line 110

I don’t know this has someting to do with the MLP plugin. The problem is that i don’t see any article on my site.

Hope somebody can help me.

Kind regards

Maarten


Kind regards,

Maarten

Offline

#1104 2008-12-17 21:59:04

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: MLP - The Multi-Lingual Publishing Pack

The Expires column is missing in your l10n_txp_nl_nl table. It should be similar to the textpattern table.

Last edited by ruud (2008-12-17 22:03:13)

Offline

Board footer

Powered by FluxBB