template_lang module
Posted by alfaguru
All files from this thread
File Name | File Size | Posted by | Date | ||
---|---|---|---|---|---|
template_lang1.0.zip | 1.1 KB | open | download | alfaguru | 01/04/2007 | Read message |
template_lang1.1.zip | 628 bytes | open | download | alfaguru | 01/05/2007 | Read message |
template_lang1.2.zip | 651 bytes | open | download | alfaguru | 01/29/2007 | Read message |
template_lang module January 04, 2007 11:26AM |
Registered: 18 years ago Posts: 7 |
This is a very simple module that makes it possible to include language files with a template, in exactly the same fashion as with a module, by specifying a lang directory beneath the one for the template and adding an english.php (plus files for any other languages you wish to support).
Why would you want to do this? For example, by this means you can add extra explanatory text to a page and make it internationalizable without having to change the default lang files. Likewise with an author credit in the page footer.
This is such a useful feature that I think it should go in the core, but for now you can use this module to achieve the same end.
Why would you want to do this? For example, by this means you can add extra explanatory text to a page and make it internationalizable without having to change the default lang files. Likewise with an author credit in the page footer.
This is such a useful feature that I think it should go in the core, but for now you can use this module to achieve the same end.
January 04, 2007 03:33PM |
Admin Registered: 20 years ago Posts: 8,532 |
You have walked a strange route here. You have put code for reading the language file below the template directory in the english.php language file for the module. That's not the intended use of the "lang" hook. That is only for allowing for translation of the module itself. It's better to load the template language file from the "common" hook instead.
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
Maurice Makaay
Phorum Development Team



Re: template_lang module January 04, 2007 03:51PM |
Registered: 18 years ago Posts: 7 |
January 04, 2007 04:13PM |
Admin Registered: 20 years ago Posts: 8,532 |
Well, if it works it works, doesn't it? I can just tell what the hooks were originally meant for. How they are used is fully an exercise to and up to the imagination of the module writer ;-)
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
Maurice Makaay
Phorum Development Team



Re: template_lang module January 05, 2007 10:26AM |
Registered: 18 years ago Posts: 7 |
Re: template_lang module January 29, 2007 09:35AM |
Registered: 18 years ago Posts: 7 |
The previous version didn't work when a different template (one without a language file) was used on the index page to the one for the forum. Errors occurred because the template language file wasn't being loaded before the page was. This bug is now fixed in this version.
Sorry, only registered users may post in this forum.