Firefox PHP

Module Localizaiton

Posted by Chris Eaton 
All files from this thread

File Name File Size   Posted by Date  
poll.php 12.7 KB open | download frajo 04/07/2005 Read message
Module Localizaiton
September 09, 2004 03:59PM
Phorum now supports the ability to load appropriate language files from modules, so we can begin to make modules that support more then one language.

I've included details in how to do this in docs/creating_mods.txt, which you can view from CVS.

Because I know that not all modules will support all languages, Phorum will attempt to fallback to English when an appropriate language file is not found. I highly recommend that all mods include an english.php with English text in order to make sure that the module will at least work for everybody (even if it is not in the right language).


update - If you want to see what an example of a localized module looks like you can check out the current version of Online Users.



Edited 2 time(s). Last edit at 09/13/2004 10:55PM by Tridus.
pat
Re: Module Localizaiton
October 02, 2004 11:48PM
Hi Tridus,

I'm trying to localise the poll-module. And I'm stuck with this:

$submit = '<input type="submit" value="Vote">';

how would you localise the "Vote"? No matter what I try - the string is never inserted instead eather the uncompiled code :

$PHORUM["DATA"]["LANG"]["mod_poll"]["VoteButton"]

is shown or nothing at all.

Any idea?

thanx
pat
pat
Re: Module Localizaiton
October 03, 2004 11:13AM
Never mind, I've got it:

$submit = '<input type="submit" value="'.$PHORUM["DATA"]["LANG"]["mod_poll"]["VoteButton"].'">';

pat
pat
Name of Lang-File
October 03, 2004 04:33PM
Hi,

I think it should be mentioned, that the mod-lang-file has to have the exact same name as the corresponding main-lang-file...

pat
Re: Name of Lang-File
January 25, 2005 04:29PM
doesn't work :(

for example with mod_poll

in list.php:

print_r($PHORUM["DATA"]["LANG"]["mod_poll"]);

is empty

I actually don't see where mod/poll/lang/english.php is included?



Edited 1 time(s). Last edit at 01/25/2005 04:35PM by Avdoshyn.
Re: Module Localizaiton
January 25, 2005 05:30PM
Admin "enables" it after you disable and enable the module.

---
-=[ Panu ]=-
Re: Module Localizaiton
January 26, 2005 03:39PM
[forum.media-objektiv.com]

everything work except lang :(

can somebody tell me what string in poll.php included lang file?



Edited 1 time(s). Last edit at 01/26/2005 03:41PM by Avdoshyn.
Re: Module Localizaiton
January 28, 2005 12:46AM
Avdoshyn Wrote:
-------------------------------------------------------
> >
> everything work except lang :(
>
> can somebody tell me what string in poll.php
> included lang file?

If your phorums main lang-file is called english.php then the modules lang file has to be calld english.php.

if it's russian.php then modules lang file has to be called russian.php

There shouldn't be anything else to get it to work.

You can test it by modifying the default lang file, and then disabling and enabling the module in admin. Do the strings change?




---
-=[ Panu ]=-
Re: Module Localizaiton
January 28, 2005 11:25AM
Look I really carefull read the manual and installation proccess, and have done everything corresponding to it, maybe something wrong with the forum engine (i've made some changes for my personal tasks), so i want to see where additional file in includede so I can found a mistake.

Thanks

>
> If your phorums main lang-file is called
> english.php then the modules lang file has to be
> calld english.php.
>
> if it's russian.php then modules lang file has to
> be called russian.php
>
> There shouldn't be anything else to get it to
> work.
>
> You can test it by modifying the default lang
> file, and then disabling and enabling the module
> in admin. Do the strings change?
>
>
>
>
> -=[ Panu ]=-


Re: Module Localizaiton
January 28, 2005 03:44PM
> > You can test it by modifying the default
> lang
> > file, and then disabling and enabling the
> module
> > in admin. Do the strings change?

> Look I really carefull read the manual and
> installation proccess, and have done everything
> corresponding to it, maybe something wrong with
> the forum engine (i've made some changes for my
> personal tasks), so i want to see where additional
> file in includede so I can found a mistake.

Hmm I hate top posting.

What I was trying to hint was that give us something more specific what you have done. Post your languagefile or something. Repeating the same unusefull report over and over doesn't change it to a usefull report. There's no magical book where we can read what is wrong without anything specific information about your problem.

There might be something wrong with the languagefile you are using, that's why I suggested you change the default file slightly and see if you can see the changes. So to verify it picks up the changes in lang-files to begin with.

---
-=[ Panu ]=-
Sorry, only registered users may post in this forum.

Click here to login