The forum for talks about jCore CMS. Share, solve and develop jCore ideas.

Turkish Lang Bug ?

Did you find a bug in the core system and/or official modules? Please report it here!

Turkish Lang Bug ?

Postby cnrdzn » Wed Feb 08, 2012 10:49 pm

when i use Turkish lang, I'm getting this error at the top

Notice: Use of undefined constant LC_MESSAGES - assumed 'LC_MESSAGES' in C:\xampp\htdocs\hyp\lib\sources\languages.class.php on line 837

Deprecated: setlocale() [function.setlocale]: Passing locale category name as string is deprecated. Use the LC_* -constants instead in C:\xampp\htdocs\hyp\lib\sources\languages.class.php on line 837

Warning: setlocale() [function.setlocale]: Invalid locale category name LC_MESSAGES, must be one of LC_ALL, LC_COLLATE, LC_CTYPE, LC_MONETARY, LC_NUMERIC, or LC_TIME in C:\xampp\htdocs\hyp\lib\sources\languages.class.php on line 837

Line 837 setlocale(LC_MESSAGES, $locale.'.'.PAGE_CHARSET, $locale);
Code: Select all
   static function set($locale) {
      if (!$locale)
         return false;
      
      languages::$selectedLocale = $locale;
      putenv('LC_ALL='.$locale);
      
   
      if ((defined('MANUAL_GETTEXT') && MANUAL_GETTEXT) || !PHP_GETTEXT) {
         T_setlocale(LC_ALL, $locale.'.'.PAGE_CHARSET, $locale);
         
      } else {
         # there is a problem with Turkish locales in PHP 5 but fixed in PHP 6
         if (substr($locale, 0, 2) == 'tr' && phpversion() < '6.0') {
            setlocale(LC_COLLATE, $locale.'.'.PAGE_CHARSET, $locale);
            setlocale(LC_MONETARY, $locale.'.'.PAGE_CHARSET, $locale);
            setlocale(LC_TIME, $locale.'.'.PAGE_CHARSET, $locale);
         setlocale(LC_MESSAGES, $locale.'.'.PAGE_CHARSET, $locale);
            
         } else {
            setlocale(LC_ALL, $locale.'.'.PAGE_CHARSET, $locale);
         }
      }
      
      return languages::loadMessages();
   }
cnrdzn
 
Posts: 19
Joined: Mon Aug 15, 2011 11:25 am

Re: Turkish Lang Bug ?

Postby pijulius » Wed Feb 29, 2012 9:02 am

Hmmm, this is strange, but thanks a lot for the report, I have noted it down and will fix it for the next release as it seems these definitions aren't done by your php setup for some reason so we will fall back to our own definitions in these cases.

Till then you could add the following to the languages.class.php (at the top):
Code: Select all
if (!defined('LC_MESSAGES')) define('LC_MESSAGES', LC_ALL);
User avatar
pijulius
Site Admin
 
Posts: 788
Joined: Thu Sep 02, 2010 8:43 am
Location: On the edge between madness and goodness

Re: Turkish Lang Bug ?

Postby ndovai » Mon Jul 01, 2013 9:47 pm

with that snippet it works fine now

________________________________
Free hosting
ndovai
 
Posts: 1
Joined: Mon Jul 01, 2013 9:44 pm


Return to Bug Reporting

Who is online

Users browsing this forum: No registered users and 1 guest

cron