?
avatar tienloantran
tienloantran
26 Jun 2018

What needs to be fixed

AbstractChosen.default_multiple_text = "Select Some Options";
AbstractChosen.default_single_text = "Select an Option";
AbstractChosen.default_no_result_text = "No results match";

Why this should be fixed

We have strings for it

JGLOBAL_SELECT_AN_OPTION="Select an option"
JGLOBAL_SELECT_NO_RESULTS_MATCH="No results match"
JGLOBAL_SELECT_SOME_OPTIONS="Select some options"

How would you fix it

AbstractChosen.default_multiple_text = JGLOBAL_SELECT_SOME_OPTIONS;
AbstractChosen.default_single_text = JGLOBAL_SELECT_AN_OPTION;
AbstractChosen.default_no_result_text = JGLOBAL_SELECT_NO_RESULTS_MATCH;

Side Effects expected

The texts are displayed as placeholder in select fields in modal in frontend and the site is on Danish, this is causing problems because I cannot translate the strings.

avatar tienloantran tienloantran - open - 26 Jun 2018
avatar joomla-cms-bot joomla-cms-bot - change - 26 Jun 2018
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 26 Jun 2018
avatar franz-wohlkoenig franz-wohlkoenig - change - 26 Jun 2018
Category com_languages Feature Request JavaScript
avatar infograf768
infograf768 - comment - 26 Jun 2018

As it is a js, we can't just use
AbstractChosen.default_multiple_text = JGLOBAL_SELECT_SOME_OPTIONS;
but rather something like
AbstractChosen.default_multiple_text: Joomla.JText._('JGLOBAL_SELECT_SOME_OPTIONS');

But then, one has to add where necessary
JText::script('JGLOBAL_SELECT_SOME_OPTIONS');

Please give test instructions (with some example for default Core) to figure how to reproduce your issue.

avatar infograf768
infograf768 - comment - 26 Jun 2018

@dgrammatiko
Please have a look.

avatar franz-wohlkoenig franz-wohlkoenig - change - 26 Jun 2018
Status New Discussion
avatar dgrammatiko
dgrammatiko - comment - 27 Jun 2018

Add the php part here: https://github.com/joomla/joomla-cms/blob/staging/layouts/joomla/html/formbehavior/chosen.php
And also the js changes in the chosen.js and everything should be fine

PS have no clue how the link was messed up, I was on my mobile

avatar brianteeman
brianteeman - comment - 27 Jun 2018

This is a third party library (chosen) and we don't change the code in a third party library

avatar infograf768
infograf768 - comment - 27 Jun 2018

It has already been modified for Joomla...

/*!
Chosen, a Select Box Enhancer for jQuery and Prototype
by Patrick Filler for Harvest, http://getharvest.com

Version 1.6.2
Full source at https://github.com/harvesthq/chosen
Copyright (c) 2011-2016 Harvest http://getharvest.com

 Modified for Joomla! UI:
 - revert the check for instance type of data-chosen, to allow to disable Chosen for field with data-chosen="true", @see https://github.com/joomla/joomla-cms/pull/12877
 - rename the css and javascript classes and functions to revert back to using chzn and liszt
 - fix zero width, based on https://github.com/harvesthq/chosen/pull/1439
 - allow to add a custom value on fly, based on https://github.com/harvesthq/chosen/pull/749

MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
This file is generated by `grunt build`, do not edit it by hand.
*/
avatar brianteeman
brianteeman - comment - 27 Jun 2018

That was a mistake 5+ years ago and not something we should repeat. That was done as an attempt to update the library with important upstream bugfixes without being effected by their backwards compatible breaking changes.

avatar brianteeman
brianteeman - comment - 27 Jun 2018

The main thing here is

Please give test instructions (with some example for default Core) to figure how to reproduce your issue.

avatar brianteeman brianteeman - change - 30 Jul 2018
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2018-07-30 20:07:53
Closed_By brianteeman
avatar brianteeman
brianteeman - comment - 30 Jul 2018

As it has been one month since the request for how to replicate this without reply I am going to close this. It can always be reopened if updated.

avatar brianteeman brianteeman - close - 30 Jul 2018

Add a Comment

Login with GitHub to post a comment