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 | ||||
| # | Time | Memory | Function | Location |
| 1 | 0.0001 | 53060 | {main}( ) | ../index.php:0 |
| 2 | 0.0002 | 56500 | require( '/home/bbbart/www/htdocs/blog/wp-blog-header.php' ) | ../index.php:17 |
| 3 | 0.1851 | 16861360 | require_once( '/home/bbbart/www/htdocs/blog/wp-includes/template-loader.php' ) | ../wp-blog-header.php:16 |
| 4 | 0.1866 | 16923940 | include( '/home/bbbart/www/htdocs/blog/wp-content/themes/svelt/single.php' ) | ../template-loader.php:43 |
| 5 | 0.2216 | 17047600 | the_content( ) | ../single.php:16 |
| 6 | 0.2217 | 17052228 | apply_filters( ) | ../post-template.php:169 |
| 7 | 0.2278 | 17065040 | call_user_func_array ( ) | ../plugin.php:166 |
| 8 | 0.2278 | 17065224 | vim_color( ) | ../plugin.php:0 |
| 9 | 0.2278 | 17065560 | preg_replace ( ) | ../wp-vimcolor.php:143 |
| 10 | 0.2280 | 17088344 | preg_replace ( ) | ../wp-vimcolor.php:143 |
| 11 | 0.2280 | 17090868 | vimcolor_process_color( ) | ../wp-vimcolor.php(143) : regexp code:57 |
| 12 | 0.2733 | 17109424 | fread ( ) | ../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 | ||||
| # | Time | Memory | Function | Location |
| 1 | 0.0001 | 53060 | {main}( ) | ../index.php:0 |
| 2 | 0.0002 | 56500 | require( '/home/bbbart/www/htdocs/blog/wp-blog-header.php' ) | ../index.php:17 |
| 3 | 0.1851 | 16861360 | require_once( '/home/bbbart/www/htdocs/blog/wp-includes/template-loader.php' ) | ../wp-blog-header.php:16 |
| 4 | 0.1866 | 16923940 | include( '/home/bbbart/www/htdocs/blog/wp-content/themes/svelt/single.php' ) | ../template-loader.php:43 |
| 5 | 0.2216 | 17047600 | the_content( ) | ../single.php:16 |
| 6 | 0.2217 | 17052228 | apply_filters( ) | ../post-template.php:169 |
| 7 | 0.2278 | 17065040 | call_user_func_array ( ) | ../plugin.php:166 |
| 8 | 0.2278 | 17065224 | vim_color( ) | ../plugin.php:0 |
| 9 | 0.2278 | 17065560 | preg_replace ( ) | ../wp-vimcolor.php:143 |
| 10 | 0.3049 | 17097288 | preg_replace ( ) | ../wp-vimcolor.php:143 |
| 11 | 0.3049 | 17097784 | vimcolor_process_color( ) | ../wp-vimcolor.php(143) : regexp code:13 |
| 12 | 0.3094 | 17099564 | fread ( ) | ../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.