htdocs and gettext

Neil Williams linux at codehelp.co.uk
Mon Jan 23 11:33:12 EST 2006


OK. I've got gettext working with PHP to translate a single website using as 
many PO files as we can create.

It means yet more restructuring of the htdocs and running some scripts to 
create and update the PO files, much as we do with 'make pot' in trunk.

I think svn should simply be a copy of the final website, including binary 
translation .mo files in real locations. I'll create some bash scripts to 
site in htdocs/ to help create, update and merge the translations.

This would save writing svn hooks to run msgfmt.

I'll have to restructure the top level directories as well because we don't 
need these locale directories (the LC_MESSAGES ones) exposed via apache so it 
will mean adjusting some Apache settings to map the root directory of the 
website to a directory *beneath* htdocs. e.g. where the virtual host maps a 
DocumentRoot of htdocs, it will need to be modified to map htdocs/www

We'd then have:
htdocs/
htdocs/en/
htdocs/en/LC_MESSAGES/
htdocs/en/LC_MESSAGES/gnucash-htdocs.mo
htdocs/de/
htdocs/de/LC_MESSAGES/
htdocs/de/LC_MESSAGES/gnucash-htdocs.mo
....
htdocs/www/
htdocs/www/index.phtml 
....
htdocs/www/images/
htdocs/news/
.... (the news content is read in by the scripts, news/ does need to be 
public)
htdocs/externals/
(externals are also read in directly by the scripts, so a URL is not needed, 
only a local filesystem path.)

As much as possible will be moved above the www/ directory.

To protect the .svn directories below www/, this snippet should be added to 
the virtual host config:
        <Directory /opt/svn/htdocs/www/*/.svn>
                Order Deny,Allow
                deny from all
        </Directory>

Change /opt/svn/htdocs/ to match the DocumentRoot of the virtual host.

I'm hoping that most of this will be automatic (according to the browser 
setup) but there will also be direct links to languages, via the common 
header file, that would deliberately set the language of the page.

As such, I would recommend that anyone wanting to translate the site waits 
until a POT file is available for the entire site, then translate and upload 
the PO file using svn.

.... pending ....

-- 

Neil Williams
=============
http://www.data-freedom.org/
http://www.nosoftwarepatents.com/
http://www.linux.codehelp.co.uk/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20060123/8e77e4a1/attachment.bin


More information about the gnucash-devel mailing list