GetSimple Support Forum

Full Version: Default GS language?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.
(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
There is no default lang or front end language, for front end multi language you must use a plugin like i18n.
*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...e+language
(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.
(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
so now when you try to log in using wrong password, you will get message in english, right?
(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
(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
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
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
(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.
Just put one language file in the folder, it will be the default.
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)
(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
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
That is also noted in the github issue, FYI
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?
Its a global injection hack, you have to add it.