HTML in language strings

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: HTML in language strings

Post by alex.barylski »

It's opinion I guess...

I personally separate the hell out of everything until it proves to time consuming to maintain, to me, that is part of the PCSpectra KISS principle. Keep everything minimal mandy until it's time consuming to do so, then:

1. Implement a tool to automate some of the process
2. Change techniques and merge the data/code with somethign else (ie: Language in HTML, Model and Controller, etc)

Cheers,
Alex
webaddict
Forum Commoner
Posts: 60
Joined: Wed Mar 14, 2007 6:55 am
Location: The Netherlands

Re: HTML in language strings

Post by webaddict »

AlexC wrote:
Yes. What if you port to Windows desktop applications? HTML tags won't likely render.
That's kind of a weird argument/point, if there are a few language strings with HTML in it currently, then surely I am already using vast amounts of HTML (as it is a web application) - so why would it ever be ported to that :D
Right. I agree on the fact that it is weird to be worried you'll have to port it to Windows desktop applications. Nevertheless, I agree with the notion of separation, though I can see the problems you're having. I think it all boils down to a question: are you going to use language string to display in other things than just HTML? I'd imagine those strings could also be used in rendering a PDF file, which is not as uncommon as porting it to a Windows application.

If you're 100% absolutely sure that it won't be used for anything else (what you usually can't say), I'd say you prolly don't want to make it harder on yourself. If you're not sure, don't use HTML in translations.
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: HTML in language strings

Post by alex.barylski »

I'd imagine those strings could also be used in rendering a PDF file, which is not as uncommon as porting it to a Windows application.
PDF would have been a better example... :P

As a long time Windows developer I always draw on that example case, to determine whether something makes sense or not in layer X, Y or Z.

The core idea is the same...the client changes from thin to thinner to thick or whatever. If you were to shown those message in a CLI version, HTML wouldn't apply, etc.
Post Reply