Re: gettext best practice

From: Date: Thu, 14 Jul 2005 13:54:31 +0000
Subject: Re: gettext best practice
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-218683@lists.php.net to get a copy of this message
"Skippy" <skippy@zuavra.net> wrote in message news:1121343285.42d6573527140@imp.pro.proxad.net... > How do you people best deal with text meant for i18n via gettext, which is > either large or contains HTML tags, or both? > > The GNU gettext manual, in section 3.2, recommends to split long texts at > paragraph level, or in the case of long --help screens, in batches of 5-10 > lines at most. I can dig this, but I'd still appreciate some feedback. > > Formatting, however, is a slightly different issue. The manual seems to have > been written mainly for C users, and as such only deals with spaces, tabs and > newlines. > > Of course, structural HTML is a big no-no IMO (ie. the likes of <p>, <li> or > tables). But styling HTML is often needed (<strong>, <em> ...). Am I right in > assuming that a small set of pure style-related HTML should be allowed? I'm > thinking <strong>, <em>, <del> and <ins>. The alternative of replacing them > with %s instead and inserting them in the code on the fly looks like an > attrocity to me. > Consider whether you will always display the information in a web browser. If there is any possibility that another program may be used for display, you don't want the HTML tags in the database. > And allowing any tags still doesn't make me 100% happy; consider borderline > complications due to HTML vs XHTML, or the very principle of separating > content from presentation, which seems to be breached. > > And how should <br> be dealt with? Allow it, or go with newlines instead, and > decide in the code if I want to apply a nl2br() or not? > > -- > Romanian Web Developers - http://ROWD.ORG

« previous php.general (#218683) next »