J3 Issue ?
avatar PhilETaylor
PhilETaylor
24 Apr 2017

Steps to reproduce the issue

Not sure this is the the right place for this report...

Install Joomla 3.7.0
install Afrikaans language set as default for frontend
do a search for an invalid 1 char string

Expected result

Afrikaans equivalent of "Search term must be a minimum of 3 characters and a maximum of 200 characters"

Actual result

Note the html entity being displayed
Note that it says 20 and not 200 (infact other languages, (like arabic!) also say 20 chars, whereas the english says 200!!)

screen shot 2017-04-24 at 22 34 21

Soektog term moet 'n minimum van 3 karakters en 'n maksimum van 20 karakters hê.

System information (as much as possible)

Additional comments

avatar PhilETaylor PhilETaylor - open - 24 Apr 2017
avatar joomla-cms-bot joomla-cms-bot - change - 24 Apr 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 24 Apr 2017
avatar PhilETaylor PhilETaylor - edited - 24 Apr 2017
avatar PhilETaylor PhilETaylor - change - 24 Apr 2017
The description was changed
avatar PhilETaylor PhilETaylor - edited - 24 Apr 2017
avatar PhilETaylor PhilETaylor - change - 24 Apr 2017
The description was changed
avatar PhilETaylor PhilETaylor - edited - 24 Apr 2017
avatar joomla-cms-bot joomla-cms-bot - edited - 24 Apr 2017
avatar joomla-cms-bot joomla-cms-bot - change - 25 Apr 2017
The description was changed
avatar joomla-cms-bot joomla-cms-bot - edited - 25 Apr 2017
avatar joomla-cms-bot joomla-cms-bot - change - 25 Apr 2017
Title
Afrikaans language string issue
Afrikaans language string issue
avatar franz-wohlkoenig franz-wohlkoenig - change - 25 Apr 2017
Category com_search Language & Strings
avatar infograf768
infograf768 - comment - 25 Apr 2017

It is indeed not the place to post this...
One should have contacted the TT coordinator for Afrikaans
https://community.joomla.org/translations/joomla-3-translations.html#af-za

But it seems you found a bug
The lower and upper limits are defined by the TT in the xx-XX.localise.php
which gives for Afrikaans and en-GB

/**
	 * Returns the lower length limit of search words
	 *
	 * @return	integer  The lower length limit of search words.
	 * @since	1.6
	 */
	public static function getLowerLimitSearchWord() {
		return 3;
	}
	/**
	 * Returns the upper length limit of search words
	 *
	 * @return	integer  The upper length limit of search words.
	 * @since	1.6
	 */
	public static function getUpperLimitSearchWord() {
		return 20;
	}
	/**
	 * Returns the number of chars to display when searching
	 *
	 * @return	integer  The number of chars to display when searching.
	 * @since	1.6
	 */
	public static function getSearchDisplayedCharactersNumber() {
		return 200;
	}

COM_SEARCH_ERROR_SEARCH_MESSAGE="Search term must be a minimum of %1$s characters and a maximum of %2$s characters."

Therefore the error is created by this code

if (SearchHelper::limitSearchWord($searchWord))
		{
			$error = JText::sprintf('COM_SEARCH_ERROR_SEARCH_MESSAGE', $lower_limit, $upper_limit);
		}

The Afrikkans string is not following the en-GB value
COM_SEARCH_ERROR_SEARCH_MESSAGE="Soektog term moet 'n minimum van 3 karakters en 'n maksimum van 20 karakters hê."

But he tried to reflect what should be (forget the hê for now);

we should have indeed
`Search term must be a minimum of 3 characters and a maximum of 20 characters.

I guess the error is here:
https://github.com/joomla/joomla-cms/blob/staging/libraries/joomla/language/language.php#L590-L598

avatar infograf768
infograf768 - comment - 25 Apr 2017

By curiosity I looked at 1.6.0 and I found that we had there the right code

/**
	 * getUpperLimitSearchWord function
	 *
	 * This method returns an upper limit integer for length of search words
	 *
	 * @return	integer	The upper limit integer for length of search words (20 if no value was set for a specific language)
	 * @since	1.6
	 */
	public function getUpperLimitSearchWord() {
		if ($this->upperLimitSearchWordCallback !== null) {
			return call_user_func($this->upperLimitSearchWordCallback);
		}
		else {
			return 20;
		}
	}
avatar infograf768
infograf768 - comment - 25 Apr 2017

hhm
#5103
#5121

confused...

avatar infograf768
infograf768 - comment - 25 Apr 2017

Basically this means that the upperlimit setting is always overriden if <200
weird

avatar joomla-cms-bot joomla-cms-bot - change - 25 Apr 2017
The description was changed
avatar joomla-cms-bot joomla-cms-bot - edited - 25 Apr 2017
avatar franz-wohlkoenig franz-wohlkoenig - change - 1 May 2017
Status New Discussion
avatar brianteeman brianteeman - labeled - 25 Mar 2018
avatar brianteeman
brianteeman - comment - 18 Aug 2018

@infograf768 did you forget about this?

avatar PhilETaylor PhilETaylor - change - 10 Feb 2019
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2019-02-10 21:35:23
Closed_By PhilETaylor
Labels Added: J3 Issue
avatar PhilETaylor PhilETaylor - close - 10 Feb 2019
avatar infograf768
infograf768 - comment - 11 Feb 2019

After thought: #5121 was correct. Only the Afrikkans string is incorrect.
For 4.0, we should change the default upperlimit to 200 in en-GB.localise.php and let this know to TTs

Add a Comment

Login with GitHub to post a comment