On Fri, Sep 21, 2007 at 07:19:52AM +0300, [EMAIL PROTECTED] wrote:
> Matt S Trout([EMAIL PROTECTED])@Wed, Sep 19, 2007 at 06:14:08PM +0100:
> > On Wed, Sep 19, 2007 at 11:50:26AM +0300, [EMAIL PROTECTED] wrote:
> > > Hello.
> > > 
> > > I need an advice on writing multilangual web-application. Question is not
> > > about i18n or localization, that's was described here many times and i 
> > > got it
> > > worked pretty easy :) The thing is in organizing database storage.
> > > 
> > > Let's assume an easy application. We have a blog. But there are three 
> > > versions
> > > int three languages: en, de and ru for example. But when we don't have a
> > > translation for the en part, we show original part. This way first we add
> > > original post in de, and then if we translate that part we add 
> > > translation. And
> > > when a user views en version of the site he sees translated part. 
> > > Otherwize he
> > > sees de version. This way in all three languages we have complete 
> > > website, just
> > > not everything is always translated, but we know what changed and was 
> > > added in
> > > all languages.
> > 
> > Don't hit the database for every string.
> > 
> > Use Catalyst::Plugin::I18N and generate out to string dictionaries / .po 
> > files.
> > 
> > Then you can make the DB storage as inefficient as you like :)
> 
> Didn't get your humor here ;-)
> 
> But please answer a question: can we somehow create relationship where we can
> provide args in runtime, so this is possible:

Yes.

But like I say, that's not the approach I'd use since you'll bottleneck
horribly on the DB that way.

Generate out to .po files and stop worrying about abusing SQL.

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director                    http://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/            http://www.shadowcat.co.uk/servers/

_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[EMAIL PROTECTED]

Reply via email to