mirror of
https://gitlab.com/comenius-institut/foerbico/metadata-form.git
synced 2025-12-09 16:24:30 +00:00
added language vocab
This commit is contained in:
parent
c5734ede7a
commit
b73f4bdf63
5 changed files with 392 additions and 9 deletions
|
|
@ -127,25 +127,20 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="creator-list" class="col-sm-2 col-form-label">Autor</label>
|
||||
<label for="creator-list" class="col-sm-2 col-form-label" data-i18n="LABEL_CREATOR">Autor</label>
|
||||
<div class="col-sm-10 form-row">
|
||||
<ul class="list-group col" id="creator-list">
|
||||
<li class="list-group-item">
|
||||
<button type="button" onclick="addCreator()" class="btn btn-primary"><i class="fa fa-plus"></i> <span
|
||||
data-i18n="LABEL_CREATOR_ADD">Autor entfernen</span></button>
|
||||
data-i18n="LABEL_CREATOR_ADD">Autor hinzufügen</span></button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="inputLanguage" class="col-sm-2 col-form-label">Sprache</label>
|
||||
<label for="inputLanguage" class="col-sm-2 col-form-label" data-i18n="LABEL_LANGUAGE">Sprache</label>
|
||||
<div class="col-sm-10">
|
||||
<select style="background: #F1F6DF; color: #0A1F40;" class="custom-select" id="inputLanguage" required>
|
||||
<!-- <option selected>Wähle ...</option> -->
|
||||
<option value="de">Deutsch</option>
|
||||
<option value="en">Englisch</option>
|
||||
<option value="fr">Französisch</option>
|
||||
<option value="es">Spanisch</option>
|
||||
</select>
|
||||
<div class="valid-feedback"></div>
|
||||
<div class="invalid-feedback">Pflichtfeld</div>
|
||||
|
|
@ -303,6 +298,11 @@
|
|||
$("#inputResourceType").append('<option value="' + item + '" data-i18n="' + item + '"></option>');
|
||||
});
|
||||
});
|
||||
$.getJSON("vocabs/language.json", function (result) {
|
||||
$.each(result, function (i, item) {
|
||||
$("#inputLanguage").append('<option value="' + item + '" data-i18n="' + item + '"></option>');
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -507,8 +507,11 @@
|
|||
const hcrt = await Promise.all(
|
||||
langs.map((l) => fetch("i18n/hcrt-" + l + ".json").then((r) => r.json()))
|
||||
);
|
||||
const languageLabels = await Promise.all(
|
||||
langs.map((l) => fetch("i18n/language-" + l + ".json").then((r) => r.json()))
|
||||
);
|
||||
const res = langs.reduce((acc, l, idx) => {
|
||||
acc[l] = {translation: {...jsons[idx], ...hcrt[idx]}};
|
||||
acc[l] = {translation: {...jsons[idx], ...hcrt[idx], ...languageLabels[idx]}};
|
||||
return acc;
|
||||
}, {});
|
||||
await i18next.init({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue