Avatar

more_smilies_label - is not used (Bugs)

by Micha ⌂, Saturday, June 15, 2013, 10:35 (3967 days ago)

Hi Alex,

there is a problem with the lang['more_smilies_label']-label. This one is not used to label the button - see screenshot. I'm wondering, because this problem is only related to this button and not to other bb-code buttons. I take a look into js_defaults.inc.php and make a modification. Instead of

$smarty->configLoad($settings['language_file'], 'general');

I'm adding the if-else from the index.php:

if(isset($_SESSION[$settings['session_prefix'].'usersettings']['language']) && file_exists(LANG_DIR.'/'.$_SESSION[$settings['session_prefix'].'usersettings']['language']))
  $language_file = $_SESSION[$settings['session_prefix'].'usersettings']['language'];
else
  $language_file = $settings['language_file'];
 
//$smarty->configLoad($settings['language_file'], 'general');
$smarty->configLoad($language_file, 'general');

Now, it works but, is it in any case the right way?

kind reagds
Micha

--
applied-geodesy.org - OpenSource Least-Squares Adjustment Software for Geodetic Sciences

Avatar

more_smilies_label - is not used

by Auge ⌂, Saturday, June 15, 2013, 17:26 (3967 days ago) @ Micha

Hello Milo

... Instead of

$smarty->configLoad($settings['language_file'], 'general');

I'm adding the if-else from the index.php:

if(isset($_SESSION[$settings['session_prefix'].'usersettings']['language']) && file_exists(LANG_DIR.'/'.$_SESSION[$settings['session_prefix'].'usersettings']['language']))
$language_file = $_SESSION[$settings['session_prefix'].'usersettings']['language'];
else
$language_file = $settings['language_file'];
 
//$smarty->configLoad($settings['language_file'], 'general');
$smarty->configLoad($language_file, 'general');

Now, it works but, is it in any case the right way?

Seems to be logically to look for the users language setting before including the strings, but ...

... I'm wondering about the doubled inclusion of the language strings in the index.php and (now) additionally in another file. I didn't actually took a look into the source code, but should it not be included only once?

[edit]The point is: if the language file is defined once in the index.php with the variable $language_file, this variable should be used directly in the "other" file instead redefining the content of the variable.[/edit]

Tschö, Auge

--
Trenne niemals Müll, denn er hat nur eine Silbe!

Avatar

more_smilies_label - is not used

by Micha ⌂, Sunday, June 16, 2013, 09:33 (3966 days ago) @ Auge

Hi Auge,

[edit]The point is: if the language file is defined once in the index.php with the variable $language_file, this variable should be used directly in the "other" file instead redefining the content of the variable.[/edit]

That's the point, yes. I'm not familiar with smarty. :-( I take a look to index.php:

if(isset($_SESSION[$settings['session_prefix'].'usersettings']['language']) && file_exists(LANG_DIR.'/'.$_SESSION[$settings['session_prefix'].'usersettings']['language']))
 {
  $language_file = $_SESSION[$settings['session_prefix'].'usersettings']['language'];
 }
else
 {
  $language_file = $settings['language_file'];
 }
$smarty->assign('language_file', $language_file);
$smarty->configLoad($language_file, 'default');


Here, the configLoad-function is called with 'default' as 2th parameter but at the JS-file $smarty->configLoad($language_file, 'general'); is used. What is the different between default and general?

Anyway, you are right: if $language_file is defined at the index.php, it doesn't make sense to redefine it. Thus, I try now the following code:

$smarty->configLoad( (isset($language_file)?$language_file:$settings['language_file']) , 'general');

regards
Micha

--
applied-geodesy.org - OpenSource Least-Squares Adjustment Software for Geodetic Sciences

Avatar

more_smilies_label - is not used

by Alex ⌂, Tuesday, July 02, 2013, 15:36 (3950 days ago) @ Micha

Hi Micha,

I think, the problem is line 16 in includes/js_defaults.inc.php:

$smarty->configLoad($settings['language_file'], 'general');

...should actually be:

$smarty->configLoad($language_file, 'general');

I'm wondering, because this problem is only related to this button and not to other bb-code buttons.

...and it only occurs if a user selects another language than the forum language is. The other button labels are generated by includes/posting.inc.php (can be seen if JavaScript is disabled), only the "more..." label and some other lables/titles are affected, because the wrong language strings are loaded in includes/js_defaults.inc.php.

Alex

RSS Feed of thread