Refactor inscription management to improve localization handling by replacing hardcoded strings with dynamic keys. Enhance CSS for better layout and responsiveness in the inscription management UI. Increment version code to 4.72.814 to reflect these changes.

This commit is contained in:
2026-07-13 17:42:21 -04:00
parent 8272192815
commit dc3d6a5c0b
6 changed files with 264 additions and 36 deletions

View File

@ -802,17 +802,27 @@
// soit le prefixe (inscr_gestion_, ancien inscr_mobile_, etc.) : une vraie
// traduction contient des espaces/accents, jamais ce motif "cle_technique".
function isRawI18nKey(str) {
return typeof str === 'string' && /^[a-z][a-z0-9_]*$/.test(str) && str.indexOf('_') !== -1;
return typeof str === 'string' && /^[a-z][a-z0-9_]*$/i.test(str) && str.indexOf('_') !== -1;
}
// Renvoie la valeur de l'attribut si elle est traduite, sinon le texte
// integre (bilingue) — evite d'afficher une clef brute a l'usager.
var SCAN_MSG_I18N = {
'data-msg-scanning': 'bibScanScanning',
'data-msg-loading': 'bibScanLoading',
'data-msg-ready': 'bibScanReady',
'data-msg-found': 'bibScanFound',
'data-msg-found-search': 'bibScanFoundSearch',
'data-msg-invalid': 'bibScanInvalid',
'data-msg-camera': 'bibScanCamera'
};
// Attribut data-* si traduit, sinon libelle injecte (cfg.i18n) — jamais une clef brute.
function scanMsg(panel, attr) {
var value = panel ? panel.getAttribute(attr) : '';
if (value && !isRawI18nKey(value)) {
return value;
}
return '';
var i18nKey = SCAN_MSG_I18N[attr];
return i18nKey ? t(i18nKey) : '';
}
BibScanSession.prototype.showReady = function () {