GetSimple Support Forum
Default GS language? - Printable Version

+- GetSimple Support Forum (http://get-simple.info/forums)
+-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3)
+--- Forum: General Questions and Problems (http://get-simple.info/forums/forumdisplay.php?fid=16)
+--- Thread: Default GS language? (/showthread.php?tid=5518)



Default GS language? - lukoie - 2014-01-16

How do i set up default languge for the GS site(not user)?
setlocale(LC_ALL, 'en_EN'); in gsconfig.php didnt do the job.


RE: Default GS language? - emanwebdev - 2014-01-16

(2014-01-16, 02:13:13)lukoie Wrote: How do i set up default languge for the GS site(not user)?
setlocale(LC_ALL, 'en_EN'); in gsconfig.php didnt do the job.

Code:
setlocale()
is for PHP, to instruct it how to format dates, numbers, money amounts, aso... not the language GS must use


RE: Default GS language? - shawn_a - 2014-01-16

There is no default lang or front end language, for front end multi language you must use a plugin like i18n.


RE: Default GS language? - emanwebdev - 2014-01-16

*search search & found*

for what i read, i think you need a plugin to add multi languages support to your website.

there is the I18N plugin that looks very used and the de facto reference

http://get-simple.info/extend/plugin/i18n/69/

it comes with 10 languages ready to use and you can add as many as you need

Read more:
http://get-simple.info/forums/showthread.php?tid=1221&highlight=change+language


RE: Default GS language? - lukoie - 2014-01-16

(2014-01-16, 04:58:35)shawn_a Wrote: There is no default lang or front end language, for front end multi language you must use a plugin like i18n.
Thats weird, because as i can see, the strings are translated in lng file.
"LOGIN_FAILED" in my case.


RE: Default GS language? - emanwebdev - 2014-01-16

(2014-01-16, 06:02:41)lukoie Wrote:
(2014-01-16, 04:58:35)shawn_a Wrote: There is no default lang or front end language, for front end multi language you must use a plugin like i18n.
Thats weird, because as i can see, the strings are translated in lang file.
"LOGIN_FAILED" in my case.

yep, found a folder /admin/lang/ and inside found fr_FR.php but can't remember if it was here by default or if it's been added


RE: Default GS language? - lukoie - 2014-01-16

so now when you try to log in using wrong password, you will get message in english, right?


RE: Default GS language? - datiswous - 2014-01-16

(2014-01-16, 06:07:23)emanwebdev Wrote: yep, found a folder /admin/lang/ and inside found fr_FR.php but can't remember if it was here by default or if it's been added
You added that file (or someone else did).. Default is only en_US


RE: Default GS language? - shawn_a - 2014-01-16

known issue
https://github.com/GetSimpleCMS/GetSimpleCMS/issues/577


RE: Default GS language? - emanwebdev - 2014-01-16

(2014-01-16, 07:20:35)lukoie Wrote: so now when you try to log in using wrong password, you will get message in english, right?

right. Actually, the login page is always in english, whatever config you set

For a customer, it's a no-way here in non-english speaking countries

UPDATE:
When looking at /admin/index.php (the login page/form),
there are
PHP Code:
<?php i18n('BACK_TO_WEBSITE'); ?>
and <?php i18n('USERNAME'); ?>


all over the place so it's i18n ready. I'll double-check my config. Sorry for the noise here Wink


RE: Default GS language? - emanwebdev - 2014-01-16

Gotcha!

Logon use the last used admin's language, if available through cookie:
admin/inc/common.php::114
PHP Code:
if (isset($_COOKIE['GS_ADMIN_USERNAME'])) {
(...)
$LANG $datau->LANG

otherwise, look in lang folder for a candidate:
admin/inc/common.php::157
PHP Code:
if(!isset($LANG) || $LANG == '') {
    
$filenames getFiles(GSLANGPATH);
    
$cntlang count($filenames);
    if (
$cntlang == 1) {
        
$LANG basename($filenames[0], ".php");
    } elseif(
$cntlang 1) {
        
$LANG 'en_US';
    }
}
include_once(
GSLANGPATH $LANG '.php'); 

If more than 1 language available, i.e. almost always true if you're running GS with a translation AND 'forgot' to delete the original english texts, the english is picked'up as 'fallback'!

The 'solution': Move the en_US.php file somewhere else... and make sure you have only your translation in this folder


RE: Default GS language? - lukoie - 2014-01-17

ah, i'm using english, and my customers are using different language.
and i would like to have those messages for them to be in their language.
will try i18n then(but really would be lovely to have that in core).
cheers


RE: Default GS language? - lukoie - 2014-01-17

(2014-01-16, 18:06:52)emanwebdev Wrote: Logon use the last used admin's language, if available through cookie:
I've tried that though, and no luck. Still english.


RE: Default GS language? - shawn_a - 2014-01-17

Just put one language file in the folder, it will be the default.


RE: Default GS language? - Carlos - 2014-01-17

I added this to my gsconfig:
Code:
$LANG='es_ES';
and now my login page is in Spanish (of course I have es_ES.php in admin/lang)


RE: Default GS language? - emanwebdev - 2014-01-17

(2014-01-17, 04:43:10)lukoie Wrote: ah, i'm using english, and my customers are using different language.
and i would like to have those messages for them

Add a dropdown select list in the login page then.

All the job's already done: scanning lang folder, aso

And look in install.php, lines 77 to 97. it's EXACTLY what you need Wink


RE: Default GS language? - Carlos - 2014-01-17

Since GS 3.0 you can use $LANG = 'xx_XX'; in gsconfig to set the default language (used in the login page)
http://get-simple.info/forums/showthread.php?tid=1877
http://get-simple.info/wiki/plugins:i18n#front-end


RE: Default GS language? - shawn_a - 2014-01-17

That is also noted in the github issue, FYI


RE: Default GS language? - shawn_a - 2014-04-04

also note this issue
https://github.com/GetSimpleCMS/GetSimpleCMS/issues/799


RE: Default GS language? - emanwebdev - 2014-04-05

just done a fresh new install to discover/test the v.3.3.1 bundled with Patch_CKE_4.3.2 (had never tried it b4)

(2014-01-17, 06:09:47)Carlos Wrote: Since GS 3.0 you can use $LANG = 'xx_XX'; in gsconfig to set the default language (used in the login page)

Can't find the $LANG = 'xx_XX'; in gsconfig.php anymore.

found a (new?) define('GSMERGELANG',true/false); flag, and define('GSEDITORLANG', 'fr');

but no $LANG = 'xx_XX'; anymore ???? missed something?


RE: Default GS language? - shawn_a - 2014-04-05

Its a global injection hack, you have to add it.