Login Retreive lost passwordRegister
Search

Forum Index / General / Impossible setlanguage

[ This topic is solved ]

  kreatik 17 April 09 / 17:57  
Hi, possible bug with :

fh_conf('FH_DEFAULT_LANGUAGE', 'fr-utf8');


in conf file, but fine work with others languages.

  Johan Wiegel (Admin) 17 April 09 / 18:28  
and what is the bug? seems to work fine in my environment

  kreatik 17 April 09 / 20:13  
Changed at 17 April 09 / 20:21
delete this

  kreatik 17 April 09 / 20:20  
Ok, excuse me is not a bug !

But, if FH_AUTO_DETECT_LANGUAGE = true, the language assigned are fr and not fr-utf8, it's possible to add a FH_UTF8_LANGUAGE fh_conf ?

If FH_UTF8_LANGUAGE = true and FH_AUTO_DETECT_LANGUAGE = true the class auto detecting the language and assign utf-8 version if exist.

I'm understand ? I'm very very bad anglish ! :/

  Johan Wiegel (Admin) 17 April 09 / 20:23  
no I can't.

changed text 26 in the fr-utf8.php and proofed myself that that was the one loaded

  Johan Wiegel (Admin) 17 April 09 / 20:31  
I understand your problem but will not make this in the config.
If i do that what about the other options?

zh-hans-gb2312.php
zh-hant-big5.php

just turn of the autodetect or check the $_SERVER['HTTP_ACCEPT_LANGUAGE'] and set the language to fr-utf8 when it contains fr.

this is to specific, there are only three utf8 langauage files

  kreatik 17 April 09 / 23:09  
Changed at 18 April 09 / 12:00
I found a working solution and I would like to know what you think? (work with FH_AUTO_DETECT_LANGUAGE true or false :) )

In class.FormHandler.php :

--- step one ---

Before "// set the language which formhandler supports" add :

                $prefixeUTF8Language='';
                if(FH_UTF8_LANGUAGE){
                    $prefixeUTF8Language='-utf8';
                }


--- step two ---

Replace :

                    // check if the language file exists
                    if( file_exists( FH_INCLUDE_DIR.'language/'.strtolower($l).'.php') )
                    {
                        // set the language
                        $this->setLanguage( $l );
                        $bSet = true;
                        break;
                    }


by :

                    // check if the language file exists
                    if( file_exists( FH_INCLUDE_DIR.'language/'.strtolower($l).$prefixeUTF8Language.'.php') )
                    {
                        // set the language
                        $this->setLanguage( $l.$prefixeUTF8Language );
                        $bSet = true;
                        break;
                    }


And use :

//change to TRUE for enable utf8 version of language file if exist
fh_conf('FH_UTF8_LANGUAGE', true);
in the config file.

  kreatik 18 April 09 / 11:23  
Bad solution ?

  Johan Wiegel (Admin) 20 April 09 / 07:33  
this is to specific, there are only three utf8 langauage files.

We will not addthis in formhandler.

  Top


powered by PHP-GLOBE   © 2004 - 2012 FormHandler. All rights reserved.   -   Open source license