[drupal-devel] Help system redesign

Gerhard Killesreiter killesreiter at physik.uni-freiburg.de
Sun Sep 25 15:23:53 UTC 2005



On Sun, 25 Sep 2005, Gabor Hojtsy wrote:

> >>3. .po files
> >>
> > [...]

> > The idea is to not use PO files and t() in the first place for the help text,
> > because for larger text strings they're much slower than a simple database
> > hit.

Since we've decided to split up large t()-ed texts into smaller
paragraphs theis changes. There will in fact be more database hits per
page with help texts. I guess we can liove with it, though.
The obviously better solution would be to use libgettext.

We could also consider to change the way the locale cacheing works.
Currently all short strings (< 75 characters) are stored in a serialized
array in the cache table. These strings are loaded for each page view.
Maybe we should instead store all strings that occur on a particular
page similar to the page cache for anon users? This would of course
cause a lot of entires in the cache table (node/1, node/2, ...). We
could opt to replace all numerics from the stored urls since all node
pages (of the same type!) will have the same strings.

I guess that needs more thought, but I think it could be made to work.

Gain: Strictly one cache hit per page (assuming all strings are known)
Currently we can have many db queries if there are long strings on a
page.

Loss: Storage of redundant information. Cache would need to be
invalidated on block changes etc.

> > [...]
> >
> > I don't know, as I've never used PO files myself. :-)  My only use for

I suggest to at least try them before thinking about making
suggestions to not use them. They are a very convenient means for
translation and widely used.

> > translation so far personally has been to customize the built-in text for a
> > client by creating a fake locale and "translating" just a few strings to have
> > more app-specific text.
> >
> > Translation people, any thoughts here?
>
> If you only need to have key->value pairs, there is no reason to abandon
> PO files. If you try to contact some real people doing translation, you
> will notice that 'easily hand editable with XML editors' is not easy enough.

Yeah, I agree with Goba. XML editing generally sucks. My main
reason to look for a CMS years ago was to not write html by hand
anymore. Don't let it creep in through the backdoor again.


Cheers
	Gerhard




More information about the drupal-devel mailing list