Skip to content

Commit

Permalink
translation support for ListMorphs
Browse files Browse the repository at this point in the history
thanks, @jguille2
  • Loading branch information
jmoenig committed Dec 10, 2021
1 parent 9d68283 commit 79f6313
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions morphic.js
Original file line number Diff line number Diff line change
Expand Up @@ -1291,7 +1291,7 @@

/*jshint esversion: 6*/

var morphicVersion = '2021-July-09';
var morphicVersion = '2021-December-10';
var modules = {}; // keep track of additional loaded modules
var useBlurredShadows = true;

Expand Down Expand Up @@ -10764,7 +10764,14 @@ ListMorph.prototype = new ScrollFrameMorph();
ListMorph.prototype.constructor = ListMorph;
ListMorph.uber = ScrollFrameMorph.prototype;

function ListMorph(elements, labelGetter, format, onDoubleClick, separator) {
function ListMorph(
elements,
labelGetter,
format,
onDoubleClick,
separator,
verbatim
) {
/*
passing a format is optional. If the format parameter is specified
it has to be of the following pattern:
Expand Down Expand Up @@ -10798,7 +10805,8 @@ function ListMorph(elements, labelGetter, format, onDoubleClick, separator) {
},
format || [],
onDoubleClick, // optional callback
separator // string indicating a horizontal line between items
separator, // string indicating a horizontal line between items
verbatim
);
}

Expand All @@ -10807,7 +10815,8 @@ ListMorph.prototype.init = function (
labelGetter,
format,
onDoubleClick,
separator
separator,
verbatim
) {
ListMorph.uber.init.call(this);

Expand All @@ -10824,6 +10833,7 @@ ListMorph.prototype.init = function (
this.action = null;
this.doubleClickAction = onDoubleClick || null;
this.separator = separator || '';
this.verbatim = isNil(verbatim) ? true : verbatim;
this.acceptsDrops = false;
this.buildListContents();
};
Expand Down Expand Up @@ -10871,7 +10881,7 @@ ListMorph.prototype.buildListContents = function () {
italic,
this.doubleClickAction,
null, // shortcut
true // verbatim - don't translate
this.verbatim // don't translate
);
}
});
Expand Down

0 comments on commit 79f6313

Please sign in to comment.