PEAK XOOPS - Language constants overriding system for D3 modules in englishin japanese

Archive | RSS |
XOOPS
XOOPS : Language constants overriding system for D3 modules
Poster : GIJOE on 2007-05-08 03:54:37 (12008 reads)

in englishin japanese
I had written language constants of D3 modules can be override by putting files under XOOPS_ROOT_PATH/modules/(dirname)/langauge/ from XOOPS_TRUST_PATH/modules/(trustdirname)/language/

But I found it is hard to use. (eg. Newly appended constants can be displayed its name instead of its value)

And I think CMS should be change its language constants not only via FTP but also "control panel".

Then, I've just implemented Language constants overriding system into altsys-0.5.

- mylangadmin
A controller called by each module's admin area. (like myblocksadmin or mytplsadmin)
This controller saves user values into DB(altsys_language_constants), then makes a cache file under XOOPS_ROOT_PATH/cache/

- D3LanguageManager
A singleton class for module/core on including language constants.
This class can be used like...


require_once XOOPS_TRUST_PATH.'/libs/altsys/class/D3LanguageManager.class.php' ;
$langman =& D3LanguageManager::getInstance() ;
$langman->read( 'main.php' , $mydirname , $mytrustdirname ) ;


At first, I've just added this feature into pico-1.31.
Let's try this. (Both altsys-0.5 and pico-1.31)

When the module increase its language constants, just update the cache via mylangadmin, again.

Perhaps, this overriding system can be used for almost modules running with XoopsCube Legacy 2.1 just by making a preload. (also, altsys should be modified a little)


Related articles
Printer friendly page Send this story to a friend

Comments list

OneOfTen  Posted on 2007/5/16 4:44
Ah thanks, I didn't try yet and didn't know that the format of the cached files is the same like the normal lang-files. That's good news. Thanks for all the nice tools and your hard work!
GIJOE  Posted on 2007/5/16 2:57 | Last modified
I cannot understand what you mean.

Quote:

the user could also save the new Values in a copy of the original file?
user can find the overridden file in XOOPS_TRUST_PATH/cache/ easily.

And I believe this way using "DB and Cache" is the best way for users.
When some language constants are added, just make cache again.
This means "Easy to merge".
OneOfTen  Posted on 2007/5/15 20:16
Why didn't you make those functions (also myblocksadmin and mytplsadmin) so that the user could also save the new Values in a copy of the original file? That would make the translation work for modules and the core much easier.
Login
Username or e-mail:

Password:

Remember Me

Lost Password?

Register now!