gettext management


( ! ) Warning: fread() [function.fread]: Length parameter must be greater than 0 in /home/bbbart/www/htdocs/blog/wp-content/plugins/vimcolor/wp-vimcolor.php on line 105
Call Stack
#TimeMemoryFunctionLocation
10.000153060{main}( )../index.php:0
20.000256500require( '/home/bbbart/www/htdocs/blog/wp-blog-header.php' )../index.php:17
30.185116861360require_once( '/home/bbbart/www/htdocs/blog/wp-includes/template-loader.php' )../wp-blog-header.php:16
40.186616923940include( '/home/bbbart/www/htdocs/blog/wp-content/themes/svelt/single.php' )../template-loader.php:43
50.221617047600the_content( )../single.php:16
60.221717052228apply_filters( )../post-template.php:169
70.227817065040call_user_func_array ( )../plugin.php:166
80.227817065224vim_color( )../plugin.php:0
90.227817065560preg_replace ( )../wp-vimcolor.php:143
100.228017088344preg_replace ( )../wp-vimcolor.php:143
110.228017090868vimcolor_process_color( )../wp-vimcolor.php(143) : regexp code:57
120.273317109424fread ( )../wp-vimcolor.php:105

( ! ) Warning: fread() [function.fread]: Length parameter must be greater than 0 in /home/bbbart/www/htdocs/blog/wp-content/plugins/vimcolor/wp-vimcolor.php on line 105
Call Stack
#TimeMemoryFunctionLocation
10.000153060{main}( )../index.php:0
20.000256500require( '/home/bbbart/www/htdocs/blog/wp-blog-header.php' )../index.php:17
30.185116861360require_once( '/home/bbbart/www/htdocs/blog/wp-includes/template-loader.php' )../wp-blog-header.php:16
40.186616923940include( '/home/bbbart/www/htdocs/blog/wp-content/themes/svelt/single.php' )../template-loader.php:43
50.221617047600the_content( )../single.php:16
60.221717052228apply_filters( )../post-template.php:169
70.227817065040call_user_func_array ( )../plugin.php:166
80.227817065224vim_color( )../plugin.php:0
90.227817065560preg_replace ( )../wp-vimcolor.php:143
100.304917097288preg_replace ( )../wp-vimcolor.php:143
110.304917097784vimcolor_process_color( )../wp-vimcolor.php(143) : regexp code:13
120.309417099564fread ( )../wp-vimcolor.php:105

Anybody remember gettext?
A couple of years ago I investigated the localisation system for a project and actually came to like it pretty much.
Managing your .po and .mo files can be a hassle though.
That’s why I created these two scripts to help me handle them:

and

These scripts will not setup the working environment nor generate full headers for new .po files.
You will have to do this manually.
A corresponding working environment for the scripts in their posted configuration looks like this:

.
|-- images
|   `-- favicon.ico
|-- includes
|   `-- accept-to-gettext.inc
|-- index.php
|-- locale
|   |-- en_GB.UTF-8
|   |   `-- LC_MESSAGES
|   |       |-- index.mo
|   |       |-- index.po
|   |       |-- index.pot
|   |       |-- index.po~
|   |       `-- pobackup
|   |           `-- index.po
|   |-- fr_BE.UTF-8
|   |   `-- LC_MESSAGES
|   |       |-- index.mo
|   |       |-- index.po
|   |       |-- index.pot
|   |       |-- index.po~
|   |       `-- pobackup
|   |           `-- index.po
|   `-- nl_BE.UTF-8
|       `-- LC_MESSAGES
|           |-- index.mo
|           |-- index.po
|           |-- index.pot
|           |-- index.po~
|           `-- pobackup
|               `-- index.po
|-- makemo
|-- makepo
`-- styles
    `-- index.css

Mind the accept-to-gettext.inc file, a great script written by Wouter Verhelst to convert information in HTTP ‘Accept-*’ headers to gettext language identifiers.

Add a Comment   Trackback  

Add a Comment