Re: [PHP] Re: gettext best practice

2005-07-14 Thread Skippy
Quoting Mark Rees <[EMAIL PROTECTED]>:
> 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.

In this particular situation I'm dealing with I only have web browsers to
worry about.

However, for the sake of argument: couldn't I still allow those styling tags
and do some post-processing in the code? Such as stripping the tags, or
converting them to something else. Things like bold and italic are almost
universally meaningful.

-- 
Romanian Web Developers - http://ROWD.ORG

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: gettext best practice

2005-07-14 Thread Mark Rees

"Skippy" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> 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 , 
or
> tables). But styling HTML is often needed (,  ...). Am I right
in
> assuming that a small set of pure style-related HTML should be allowed?
I'm
> thinking , ,  and . 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  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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php