Better fallback for non-localized keyers and distances
This commit is contained in:
parent
8063ca63d9
commit
22cf0517b9
@ -127,18 +127,26 @@ ClusteringDialog.prototype._createDialog = function() {
|
|||||||
var distances = data.distances != null ? data.distances : [];
|
var distances = data.distances != null ? data.distances : [];
|
||||||
var i = 0;
|
var i = 0;
|
||||||
for(; i < keyers.length; i++) {
|
for(; i < keyers.length; i++) {
|
||||||
|
var label = $.i18n('clustering-keyers/'+keyers[i]);
|
||||||
|
if (label.startsWith('clustering-keyers')) {
|
||||||
|
label = keyers[i];
|
||||||
|
}
|
||||||
var option = $('<option></option>')
|
var option = $('<option></option>')
|
||||||
.attr('value', keyers[i])
|
.attr('value', keyers[i])
|
||||||
.text($.i18n('clustering-keyers/'+keyers[i]))
|
.text(label)
|
||||||
.appendTo(self._elmts.keyingFunctionSelector);
|
.appendTo(self._elmts.keyingFunctionSelector);
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
option.attr('selected', 'true');
|
option.attr('selected', 'true');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for(i = 0; i < distances.length; i++) {
|
for(i = 0; i < distances.length; i++) {
|
||||||
|
var label = $.i18n('clustering-distances/'+distances[i]);
|
||||||
|
if (label.startsWith('clustering-distances')) {
|
||||||
|
label = distances[i];
|
||||||
|
}
|
||||||
var option = $('<option></option>')
|
var option = $('<option></option>')
|
||||||
.attr('value', distances[i])
|
.attr('value', distances[i])
|
||||||
.text($.i18n('clustering-distances/'+distances[i]))
|
.text(label)
|
||||||
.appendTo(self._elmts.distanceFunctionSelector);
|
.appendTo(self._elmts.distanceFunctionSelector);
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
option.attr('selected', 'true');
|
option.attr('selected', 'true');
|
||||||
|
Loading…
Reference in New Issue
Block a user