This is a Language file checker for Xoops.
This tool needs PHP-CLI. (/usr/local/bin/php)
You can manage some kind of language files for duplicatable modules.
If you are a module's developper and you want to make duplicatable modules, you shoud code the language files like this skelton:
(D1 and D2)
if( defined( 'FOR_XOOPS_LANG_CHECKER' ) || ! defined( '(YOUR MODULE)_MB_LOADED' ) ) {
define( '(YOUR MODULE)_MD_LOADED' , 1 ) ;
define( "_MD_..." , "..." ) ;
define( "_MD_..." , "..." ) ;
define( "_MD_..." , "..." ) ;
}
In version 2.1, D3 module can be managed.
(modinfo.php and blocks_each.php of D3)
if( defined( 'FOR_XOOPS_LANG_CHECKER' ) ) $mydirname = 'd3forum' ;
$constpref = '_MI_' . strtoupper( $mydirname ) ;
if( defined( 'FOR_XOOPS_LANG_CHECKER' ) || ! defined( $constpref.'_LOADED' ) ) {
define( $constpref.'_LOADED' , 1 ) ;
define($constpref."_...","...");
define($constpref."_...","...");
define($constpref."_...","...");
}
Usage (Unix):
- Uncompress and extract it
- Set 3 files into executable path (like /usr/local/bin)
- chdir to module's root directory (XOOPS_ROOT_PATH./modules/.../)
- exec xoops_lang_check.php
Sample:
$ xoops_lang_check.php --help
displaying usages
$ xoops_lang_check.php . english japanese
listing up constants which exist in english and don't exist in japanese.
(for localizer)
$ xoops_lang_check.php . japanese english
listing up constants which exist in japanese and don't exist in english.
(for module developper whose mother tongue is not english)
$ xoops_lang_check.php . english
listing up all language's constants which exist in english.
(for module developper who want to manage all language files)
$ xoops_lang_check.php
Same as upper sample. (1st operator's default is '.', 2nd operator's default is 'english')
$ xoops_lang_check.php --patch . english japanese
Patching the shortfall definitions into the japanese language files.
The criteria is english.
(for a little bit lazy localizer)
$ xoops_lang_check.php --patch
Patching the shortfall definitions into all of the language files.
The criteria is english.
(for scrupulous module developper who want to manage all language files)