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:
@ -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 () {
|
||||
|
||||
Reference in New Issue
Block a user