ui: remove html step counter translations
This commit is contained in:
@@ -50,6 +50,19 @@
|
||||
);
|
||||
}
|
||||
|
||||
function renderStepCounter(counter, step, total) {
|
||||
if (!counter) return;
|
||||
var language = localStorage.getItem('crank_lang') || 'en';
|
||||
var parts = language === 'ru'
|
||||
? { prefix: 'Шаг ', suffix: ' из ' + total }
|
||||
: { prefix: 'Step ', suffix: ' of ' + total };
|
||||
var strong = document.createElement('strong');
|
||||
counter.textContent = parts.prefix;
|
||||
strong.textContent = String(step);
|
||||
counter.appendChild(strong);
|
||||
counter.appendChild(document.createTextNode(parts.suffix));
|
||||
}
|
||||
|
||||
function loadStep(step, callback) {
|
||||
var panelId = step === 3 ? step3PanelId() : 'step-panel-' + step;
|
||||
if (document.getElementById(panelId)) {
|
||||
@@ -114,8 +127,8 @@
|
||||
var percentNode = document.querySelector('.progress-pct');
|
||||
if (percentNode) percentNode.textContent = percent + '%';
|
||||
|
||||
var counter = document.querySelector('[data-step-counter]');
|
||||
if (counter) counter.innerHTML = tfKey('wizard.step_of', { step: step, total: TOTAL_STEPS });
|
||||
var counter = pane ? pane.querySelector('[data-step-counter]') : null;
|
||||
renderStepCounter(counter, step, TOTAL_STEPS);
|
||||
|
||||
var backButton = document.querySelector('.btn-back');
|
||||
if (backButton) {
|
||||
@@ -153,6 +166,12 @@
|
||||
}, Promise.resolve());
|
||||
}
|
||||
|
||||
window.addEventListener('crank:langchange', function() {
|
||||
if (window.currentStep) {
|
||||
doGoToStep(window.currentStep);
|
||||
}
|
||||
});
|
||||
|
||||
function bindProtocolCards() {
|
||||
document.querySelectorAll('.protocol-card').forEach(function(card) {
|
||||
card.addEventListener('click', function() {
|
||||
|
||||
Reference in New Issue
Block a user