Re: Templates & Languages

From: Date: Wed, 29 Sep 2004 13:25:27 +0000
Subject: Re: Templates & Languages
References: 1 2 3  Groups: php.doc.web 
Request: Send a blank email to doc-web+get-343@lists.php.net to get a copy of this message
On Wednesday 29 September 2004 05:31, Curt Zirzow wrote: > * Thus wrote Sean Coates: > > Vincent Gevers wrote: > > | For some reason I'm not sure about adding all html in the templates. > > | > > | If we want the pages to be translated we should allow the doc teams to > > | create/edit them. This means they can also edit the html code or even > > break > > | the site. > > [...] > > | Comments welcome > > > > Well, in my experience, it's often not as simple as replacing pieces of > > text, when translating sites. > > I'm not entire familiar with the code on docweb yet, but what would > the option of using a gettext approach? And go with the a more > traditional locale method? I'm not sure about gettext.. It will require a howto for the utils to make it work. The translation teams are used to replace english with there own language. even a simple str_replace() will work. in index.php there is a '{welcome_text}' the language file will be included and {welcome_text} will be replaced by the text defined like array('welcome_text' => 'this is the welcome text') very simple, but it works. I've also been thinking about something that will allow pages to be added. fr would like to have a /php/fr/coding.php error.php looks for coding.tpl.php in the language dir and if exists it will 'parse' it. the file will include an array like array('title' => 'CS', 'welcome_text' => 'This is about Coding', 'chapter' => array ('title' => 'how to use', 'text' => 'you do like this...'), 'links' => array ('txt' => 'PEAR CS', 'url' => 'http://pear.php.net/'), //navbar links ) IMO this is a clear and easy way for translators. They can add files without problems (it uses the default header and footer) and makes translation easy. This also brings up some problems, but I think this is simple enough for most translators. Atleast the header and footer should always be the default, with replaced text. Design should always stay the same IMO Vincent > > > Curt > -- > First, let me assure you that this is not one of those shady pyramid schemes > you've been hearing about. No, sir. Our model is the trapezoid! >

« previous php.doc.web (#343) next »