Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
df26cbc
prototype work
omelancon Feb 7, 2022
1757fd5
tmp work to bubble TFormat to codeBoot
omelancon Feb 8, 2022
dc42486
refactor vm polyglotHTML
omelancon Feb 8, 2022
f2009d5
refactor vm polyglotHTML more
omelancon Feb 8, 2022
9af9f2c
first working prototype
omelancon Feb 9, 2022
70d8e36
Merge branch 'master' of github.com:udem-dlteam/codeboot into omelanc…
omelancon Feb 10, 2022
e2588b5
fix merge
omelancon Feb 10, 2022
4df3582
refactor TFormat format method
omelancon Feb 10, 2022
00b4685
add enumeration translations
omelancon Feb 10, 2022
e408983
refactor naming convention
omelancon Feb 11, 2022
4bc5082
Merge branch 'master' of github.com:udem-dlteam/codeboot into omelanc…
omelancon Feb 11, 2022
dfbe329
tformat static messages
omelancon Feb 12, 2022
ccf77bc
use enum in unsupported type for op error tformat
omelancon Feb 12, 2022
188e668
save script for upadting most of pyinterp to tformat error messages
omelancon Feb 12, 2022
1ea842a
replace more sem_raise_with_message (64 remaining)
omelancon Feb 12, 2022
5ecaa8c
partial translation of remaining messages
omelancon Feb 13, 2022
0e040fe
partial translation of remaining messages
omelancon Feb 13, 2022
3727904
partial translation of remaining messages
omelancon Feb 13, 2022
0c437b9
partial translation of remaining messages
omelancon Feb 13, 2022
508134d
translation of remaining messages
omelancon Feb 13, 2022
c5642e4
fix typos
omelancon Feb 13, 2022
58a446a
fix typo
omelancon Feb 13, 2022
b3f0c47
work on script for detecting untranslated strings
omelancon Feb 13, 2022
651186a
tmp work on merging similar templates
omelancon Feb 14, 2022
00a1541
merge similar templates
omelancon Feb 14, 2022
5d259b0
add empty translations
omelancon Feb 14, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 20 additions & 14 deletions include/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -902,10 +902,8 @@ CodeBootVM.prototype.reset = function () {
CodeBootVM.prototype.showReason = function (reason) {

// reason can be a string or an Error object

var vm = this;

var elem = $('<span class="cb-repl-error"/>');
var withStepCounter = vm.showingStepCounter();
var loc = null;
var kind = null;
Expand All @@ -925,25 +923,33 @@ CodeBootVM.prototype.showReason = function (reason) {
}
}

if (msg !== '' || withStepCounter) {
if (withStepCounter){
var counter = '<span class="badge badge-primary badge-pill cb-step-counter"/>' +
vm.escapeHTML(vm.HTMLStepCounter())
'</span>'

if (msg === '') {
msg = counter;
} else {
msg = new TFormat("{0} after {1}", [msg, counter])
}
vm.hideStepCounter(); //TODO: belongs elsewhere
}

if (msg instanceof TFormat) {
msg = vm.polyglotHTML_from_tformat(msg)
}

if (msg !== '') {

if (loc) {
loc = vm.lang.relativeLocation(loc); // convert to relative loc
msg = vm.errorMessage(loc, kind, msg); // add location to message
vm.showReasonHighlight(loc); // and highlight location
}

if (withStepCounter) {
if (msg !== '') msg += ' after ';
elem.text(msg);
var counter = $('<span class="badge badge-primary badge-pill cb-step-counter"/>');
counter.html(vm.HTMLStepCounter());
elem.append(counter);
vm.hideStepCounter(); //TODO: belongs elsewhere
} else {
elem.text(msg);
}

var elem = $('<span class="cb-repl-error"/>');
elem.html(msg);
vm.replAddLineWidgetTranscript(elem.get(0));
}
};
Expand Down
Loading