mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
añadido coger el idioma
This commit is contained in:
@ -5,7 +5,7 @@ class DatosGenerales {
|
||||
|
||||
constructor(domItem) {
|
||||
this.domItem = domItem;
|
||||
this.formatoLibro = new ClassSelect($("#papelFormatoId"), '/papel-formato/menuitems', 'Seleccione formato');
|
||||
this.formatoLibro = new ClassSelect($("#papelFormatoId"), '/papel-formato/menuitems', window.translations["formatoLibro"]);
|
||||
this.checkFormatoPersonalizado = this.domItem.find("#papelFormatoPersonalizado");
|
||||
this.formatoPersonalizado = this.domItem.find("#formatoPersonalizado");
|
||||
|
||||
|
||||
@ -1,9 +1,26 @@
|
||||
import DatosGenerales from './datosGenerales.js';
|
||||
import Ajax from '../../components/ajax.js';
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
|
||||
function initPresupuesto(response){
|
||||
|
||||
window.translations = JSON.parse(response);
|
||||
|
||||
let datosGenerales = new DatosGenerales($("#datos-generales"));
|
||||
datosGenerales.init();
|
||||
}
|
||||
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
|
||||
const locale = document.querySelector('meta[name="locale"]').getAttribute('content');
|
||||
|
||||
new Ajax('/translate/getTranslation', {locale: locale, translationFile: 'Presupuestos'}, {},
|
||||
initPresupuesto,
|
||||
function(error){
|
||||
console.log("Error getting translations:", error);
|
||||
}
|
||||
).post();
|
||||
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user