ElkArte Community

Elk Development => Bug Reports => Exterminated Bugs => Topic started by: wintstar on July 25, 2015, 01:06:21 am

Title: Strtolower in ManageFeatures.controller.php
Post by: wintstar on July 25, 2015, 01:06:21 am
Forum-Version: ElkArte 1.0.4 and 1.1

In the German language will be written "Posts" with small letters in the settings Karma and Likes (1.1). This is not an error in the German language files.  This is due to the property "strtolower".  This property would in my opinion be removed. Please look here => http://support.elkarte-hilfe.de/index.php/topic,141.0.html

sources/admin/ManageFeatures.controller.php
1.0.4
line 1232
Code: [Select]
                    $colname = $initial_colname = 'cust_' . strtolower($matches[1]);
line 1598
Code: [Select]
				array('int', 'likeMinPosts', 6, 'postinput' => strtolower($txt['posts'])),


1.1

line 1059
Code: [Select]
					$colname = $initial_colname = 'cust_' . strtolower($matches[1]);
line 1386
Code: [Select]
				array('int', 'karmaMinPosts', 6, 'postinput' => strtolower($txt['posts'])),
line 11422
Code: [Select]
				array('int', 'likeMinPosts', 6, 'postinput' => strtolower($txt['posts'])),
Title: Re: Strtolower in ManageFeatures.controller.php
Post by: Joshua Dickerson on July 25, 2015, 01:26:01 am
I don't see how
Code: [Select]
$colname = $initial_colname = 'cust_' . strtolower($matches[1]);
can possibly be causing that.

You are right on lines 1386 and 11422 though. They are lowercase to save a string in the language file, but if it doesn't work in a language, it should be changed to something like "posts_lower" and the language file needs to have a comment explaining why.
Title: Re: Strtolower in ManageFeatures.controller.php
Post by: wintstar on July 25, 2015, 01:32:48 am
Did everything listed where strtolower be found. The respective first in the line are not relevant.
Title: Re: Strtolower in ManageFeatures.controller.php
Post by: emanuele on July 25, 2015, 06:38:12 am
Yep, it's the 'postinput' bit.
But... honestly, does it make sense to have that 'postinput' thingy? Wouldn't be better to have the "unit of measure" in the description of the setting?
Title: Re: Strtolower in ManageFeatures.controller.php
Post by: wintstar on July 27, 2015, 04:14:54 am
Will there give be a change to the upcoming next version?
Title: Re: Strtolower in ManageFeatures.controller.php
Post by: emanuele on July 27, 2015, 02:52:54 pm
I can't see why not. ;) (Apart losing track of it of course. LOL)
Remove the strtolower shouldn't be a problem.
Title: Re: Strtolower in ManageFeatures.controller.php
Post by: emanuele on July 27, 2015, 05:38:11 pm
I guess that instead of strtolower($txt['posts']) we can use $txt['manageposts_posts'], that is a lowercase version and each language can deal with it separately. And is the same used in other places since years.
Title: Re: Strtolower in ManageFeatures.controller.php
Post by: wintstar on July 27, 2015, 10:41:08 pm
That's a very good solution :)