Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Default GS language?
#1
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.
Reply
#2
(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
Reply
#3
There is no default lang or front end language, for front end multi language you must use a plugin like i18n.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#4
*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
Reply
#5
(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.
Reply
#6
(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
Reply
#7
so now when you try to log in using wrong password, you will get message in english, right?
Reply
#8
(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
Reply
#9
known issue
https://github.com/GetSimpleCMS/GetSimpleCMS/issues/577
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#10
(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
Reply
#11
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
Reply
#12
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
Reply
#13
(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.
Reply
#14
Just put one language file in the folder, it will be the default.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#15
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)
Reply
#16
(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
Reply
#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
Reply
#18
That is also noted in the github issue, FYI
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#19
also note this issue
https://github.com/GetSimpleCMS/GetSimpleCMS/issues/799
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#20
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?
Reply
#21
Its a global injection hack, you have to add it.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply




Users browsing this thread: 1 Guest(s)