[Phpug] PHP & DB Design Questions
Słaby, Michał
mslaby at paddypower.com
Wed Dec 19 10:20:08 GMT 2007
On Tue, 2007-12-18 at 19:57 +0000, AJ McKee wrote:
(...)
> The first issue is the localisation issue. I know I could use gettext
> but this are many issues around its usage, so what are the options for
> decient localisation within PHP? Anyone got ideas.
Hi AJ,
You can take a look at my custom crafted i18n subsystem. It is part of
Tigermouse framework, but being loosely coupled can be easily extracted
as a standalone functionality.
The basic idea is to use __('some text') function to get translation of
'some text'. The translation however is not a string, it is an object
that can be serialized to string via __toString() magic method. You
don't have to care about case conversion as it is up to PHP engine.
When __() function is used a translation object is returned and given
string is registered for further translation (this is called lazy load).
When the first translation object is converted to string, all previously
registered strings are loaded at one time. There are two backends
currently - database and flat file based, but you can easily extend to
use custom backend. See http://tigermouse.epsi.pl for more.
Good luck with you app,
Michael
________________________________________________________________________
Privileged, confidential and/or copyright information may be contained in this communication. This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you are not the intended addressee, you may not copy, forward, disclose or otherwise use this e-mail or any part of it in any way whatsoever. To do so is prohibited and may be unlawful. If you have received this email in error
please notify the sender immediately.
Paddy Power PLC may monitor the content of e-mail sent and received for the purpose of ensuring compliance with its policies and procedures.
Paddy Power plc, Airton House, Airton Road, Tallaght, Dublin 24 Registered in Ireland: 16956
________________________________________________________________________
More information about the Phpug
mailing list