Move csvxml translations to a separate git submodule and add help texts

Close #22
This commit is contained in:
Joshua Ramon Enslin 2022-11-18 02:04:24 +01:00
parent 34fcc4905a
commit 10012db20d
Signed by: jrenslin
GPG Key ID: 46016F84501B70AE
10 changed files with 15 additions and 9 deletions

6
.gitmodules vendored
View File

@ -16,9 +16,9 @@
[submodule "l10n/musdb"] [submodule "l10n/musdb"]
path = l10n/musdb path = l10n/musdb
url = gitea:museum-digital/translation-musdb.git url = gitea:museum-digital/translation-musdb.git
[submodule "l10n/importer"]
path = l10n/importer
url = gitea:museum-digital/translations-importer.git
[submodule "classes/MD_QA"] [submodule "classes/MD_QA"]
path = classes/MD_QA path = classes/MD_QA
url = gitea:museum-digital/MD_QA.git url = gitea:museum-digital/MD_QA.git
[submodule "l10n/translation-csvxml"]
path = l10n/translation-csvxml
url = gitea:museum-digital/translation-csvxml.git

View File

@ -14,7 +14,7 @@ const ALLOWED_LANGS = ['de', 'en', 'hu'];
const TL_FILE_DIRS = [ const TL_FILE_DIRS = [
__DIR__ . "/../l10n/musdb/", __DIR__ . "/../l10n/musdb/",
__DIR__ . "/../l10n/importer/", __DIR__ . "/../l10n/translation-csvxml/",
__DIR__ . "/../classes/MDAllowedValueSets/l18n/", __DIR__ . "/../classes/MDAllowedValueSets/l18n/",
]; ];

@ -1 +0,0 @@
Subproject commit 3bfb6f9ac2abcbad91136e684db0372f2a7291d8

@ -0,0 +1 @@
Subproject commit f4dbfcc5bf910c360ac7414ecb9d308bbc8abdc1

View File

@ -703,6 +703,8 @@ class CsvxmlPage {
const div = document.createElement("div"); const div = document.createElement("div");
div.appendChild(appendQA(app.tls.help_where_am_i, app.tls.help_where_am_i_content)); div.appendChild(appendQA(app.tls.help_where_am_i, app.tls.help_where_am_i_content));
div.appendChild(appendQA(app.tls.help_what_is_csv, app.tls.help_what_is_csv_content));
div.appendChild(appendQA(app.tls.help_how_to_format_csv, app.tls.help_how_to_format_csv_content));
app.domHelpWrapper.appendChild(div); app.domHelpWrapper.appendChild(div);

View File

@ -53,7 +53,7 @@ renderGenHeader(){const header=document.createElement("header");header.id="mainH
lNews.textContent=this.tls.news;lNews.href="https://blog.museum-digital.org/";nav.appendChild(lNews);header.appendChild(nav);document.body.appendChild(header);} lNews.textContent=this.tls.news;lNews.href="https://blog.museum-digital.org/";nav.appendChild(lNews);header.appendChild(nav);document.body.appendChild(header);}
renderHeader(){const appHeader=document.createElement("header");const h1=document.createElement("h1");const img=document.createElement("img");img.width="70";img.height="70";img.src="assets/img/mdlogo-csvxml.svg";img.alt="";h1.appendChild(img);const h1Span=document.createElement("span");h1Span.textContent="museum-digital:csvxml";h1.appendChild(h1Span);appHeader.appendChild(h1);document.body.appendChild(appHeader);} renderHeader(){const appHeader=document.createElement("header");const h1=document.createElement("h1");const img=document.createElement("img");img.width="70";img.height="70";img.src="assets/img/mdlogo-csvxml.svg";img.alt="";h1.appendChild(img);const h1Span=document.createElement("span");h1Span.textContent="museum-digital:csvxml";h1.appendChild(h1Span);appHeader.appendChild(h1);document.body.appendChild(appHeader);}
renderHelpTexts(){let app=this;(async function(){function appendQA(question,answer){const div=document.createElement("div");div.classList.add("qaDiv");const qElem=document.createElement("h3");qElem.textContent=question;qElem.style.cursor="pointer";div.appendChild(qElem);qElem.addEventListener('click',function(){console.log("Listing validation errors");const dialogueContent=document.createElement("div");const headline=document.createElement("h3");headline.textContent=question;headline.appendChild(app.generateDialogueCloseButton());dialogueContent.appendChild(headline);const answerDiv=document.createElement("div");answerDiv.textContent=answer;dialogueContent.appendChild(answerDiv);CsvxmlDialogue.drawDialogue(dialogueContent);});return div;} renderHelpTexts(){let app=this;(async function(){function appendQA(question,answer){const div=document.createElement("div");div.classList.add("qaDiv");const qElem=document.createElement("h3");qElem.textContent=question;qElem.style.cursor="pointer";div.appendChild(qElem);qElem.addEventListener('click',function(){console.log("Listing validation errors");const dialogueContent=document.createElement("div");const headline=document.createElement("h3");headline.textContent=question;headline.appendChild(app.generateDialogueCloseButton());dialogueContent.appendChild(headline);const answerDiv=document.createElement("div");answerDiv.textContent=answer;dialogueContent.appendChild(answerDiv);CsvxmlDialogue.drawDialogue(dialogueContent);});return div;}
const div=document.createElement("div");div.appendChild(appendQA(app.tls.help_where_am_i,app.tls.help_where_am_i_content));app.domHelpWrapper.appendChild(div);})();document.body.appendChild(this.domHelpWrapper);} const div=document.createElement("div");div.appendChild(appendQA(app.tls.help_where_am_i,app.tls.help_where_am_i_content));div.appendChild(appendQA(app.tls.help_what_is_csv,app.tls.help_what_is_csv_content));div.appendChild(appendQA(app.tls.help_how_to_format_csv,app.tls.help_how_to_format_csv_content));app.domHelpWrapper.appendChild(div);})();document.body.appendChild(this.domHelpWrapper);}
renderUploader(){let app=this;(async function(){const h2=document.createElement("h2");h2.textContent=app.tls.upload;app.domUploaderWrapper.appendChild(h2);const form=document.createElement("form");const label=document.createElement("label");label.textContent=app.tls.select_csv_file_for_upload;label.setAttribute("for","fileToUpload");form.appendChild(label);const input=document.createElement("input");input.type="file";input.id="fileToUpload";input.setAttribute("tabindex","1");input.accept=".csv";input.required="required";input.addEventListener('change',async function(){app.uploadFileForValidation(input.files[0]);});form.appendChild(input);app.domUploaderWrapper.appendChild(form);})();document.body.appendChild(this.domUploaderWrapper);} renderUploader(){let app=this;(async function(){const h2=document.createElement("h2");h2.textContent=app.tls.upload;app.domUploaderWrapper.appendChild(h2);const form=document.createElement("form");const label=document.createElement("label");label.textContent=app.tls.select_csv_file_for_upload;label.setAttribute("for","fileToUpload");form.appendChild(label);const input=document.createElement("input");input.type="file";input.id="fileToUpload";input.setAttribute("tabindex","1");input.accept=".csv";input.required="required";input.addEventListener('change',async function(){app.uploadFileForValidation(input.files[0]);});form.appendChild(input);app.domUploaderWrapper.appendChild(form);})();document.body.appendChild(this.domUploaderWrapper);}
doForFieldList(callback){let fieldLists=document.getElementsByClassName("fieldList");for(let i=0,max=fieldLists.length;i<max;i++){let fields=fieldLists[i].getElementsByTagName("li");for(let j=0,maxj=fields.length;j<maxj;j++){callback(fields[j]);}}} doForFieldList(callback){let fieldLists=document.getElementsByClassName("fieldList");for(let i=0,max=fieldLists.length;i<max;i++){let fields=fieldLists[i].getElementsByTagName("li");for(let j=0,maxj=fields.length;j<maxj;j++){callback(fields[j]);}}}
toggleListFieldSelectionState(field){let app=this;let newValue=field.getAttribute("data-alt");field.setAttribute("data-alt",field.textContent);field.textContent=newValue;field.classList.toggle("humanTLToggled");if(field.classList.contains("humanTLToggled")===false)return;let dependencies=this.fieldListFlat[field.id].dependsOn;if(dependencies!==undefined&&dependencies!==null){let linkedFields=this.fieldListFlat[field.id].dependsOn;for(let i=0,max=linkedFields.length;i<max;i++){let linkedField=document.getElementById(linkedFields[i]);if(linkedField.classList.contains("humanTLToggled")===true)continue;this.toggleListFieldSelectionState(linkedField);}}} toggleListFieldSelectionState(field){let app=this;let newValue=field.getAttribute("data-alt");field.setAttribute("data-alt",field.textContent);field.textContent=newValue;field.classList.toggle("humanTLToggled");if(field.classList.contains("humanTLToggled")===false)return;let dependencies=this.fieldListFlat[field.id].dependsOn;if(dependencies!==undefined&&dependencies!==null){let linkedFields=this.fieldListFlat[field.id].dependsOn;for(let i=0,max=linkedFields.length;i<max;i++){let linkedField=document.getElementById(linkedFields[i]);if(linkedField.classList.contains("humanTLToggled")===true)continue;this.toggleListFieldSelectionState(linkedField);}}}

View File

@ -1 +1 @@
{"remarks":"Notizen","download":"Download","upload":"Hochladen","select_csv_file_for_upload":"Bitte w\u00e4hlen Sie eine CSV Datei als Basis zum Erstellen von XML Dateien","currently_approved_tags":"Derzeit zum Import verf\u00fcgbare Tags \/ Felder","download_csv_all":"CSV-Vorlage mit allen Feldern runterladen","download_csv_by_selection":"CSV-Vorlage auf Basis der Auswahl herunterladen","select_required_fields":"Pflichtfelder ausw\u00e4hlen","select_all_fields":"Alle Felder ausw\u00e4hlen","unset_selection":"Auswahl entfernen","file_format":"Dateiformat","validation_errors":"Validierungsfehler","errors_parsing":"Parsing-Fehler","errors_mandatoryTags":"Fehlende Pflichtfelder","errors_duplicateInvNos":"Doppelte Inventarnummern","errors_dependentColumns":"Spaltenabh\u00e4ngigkeiten nicht ber\u00fccksichtigt","errors_controlledLists":"Kontrollierte Werte","errors_mainImageResource":"Fehlende Haupt-Bilder oder Ressourcen","allowed_values":"Zugelassene Werte","privacy_policy":"Datenschutzerkl\u00e4rung","contact":"Kontakt","news":"Neuigkeiten","imprint":"Impressum","about":"\u00dcber","help_where_am_i":"What is this page for?","help_where_am_i_content":" CSVXML helps validate import object data for museum-digital following museum-digital's standard import format."} {"remarks":"Notizen","download":"Download","upload":"Hochladen","select_csv_file_for_upload":"Bitte w\u00e4hlen Sie eine CSV Datei als Basis zum Erstellen von XML Dateien","currently_approved_tags":"Derzeit zum Import verf\u00fcgbare Tags \/ Felder","download_csv_all":"CSV-Vorlage mit allen Feldern runterladen","download_csv_by_selection":"CSV-Vorlage auf Basis der Auswahl herunterladen","select_required_fields":"Pflichtfelder ausw\u00e4hlen","select_all_fields":"Alle Felder ausw\u00e4hlen","unset_selection":"Auswahl entfernen","file_format":"Dateiformat","validation_errors":"Validierungsfehler","errors_parsing":"Parsing-Fehler","errors_mandatoryTags":"Fehlende Pflichtfelder","errors_duplicateInvNos":"Doppelte Inventarnummern","errors_dependentColumns":"Spaltenabh\u00e4ngigkeiten nicht ber\u00fccksichtigt","errors_controlledLists":"Kontrollierte Werte","errors_mainImageResource":"Fehlende Haupt-Bilder oder Ressourcen","allowed_values":"Zugelassene Werte","privacy_policy":"Datenschutzerkl\u00e4rung","contact":"Kontakt","news":"Neuigkeiten","imprint":"Impressum","about":"\u00dcber","help_where_am_i":"What is this page for?","help_where_am_i_content":" CSVXML helps validate import object data for museum-digital following museum-digital's standard import format.","help_what_is_csv":"Was hei\u00dft CSV?","help_what_is_csv_content":"CSV steht f\u00fcr Comma Separated Value. Es handelt sich dabei um ein Dateiformat, mit dem tabellarische Informationen in einer reinen Textdatei ausgedr\u00fcckt werden k\u00f6nnen, und wird auch von den meisten Tabellenkalkulationsprogrammen wie Excel und LibreOffice Calc unterst\u00fctzt. W\u00e4hrend nach der urspr\u00fcnglichen Definition des Standards nur eine ASCii-Kodierung der Daten erlaubt war, zeigte sich im Laufe der Jahre, dass die Benutzung breiterer Kodierungen wie UTF-8 in der Praxis n\u00f6tig ist. Ebenso lassen sich in den meisten Kalkulationsprogrammen Semikola oder andere Trennzeichen statt eines Kommas setzen. CSV ist keinesfalls identisch mit Standard-Excel-Dateien. Jedoch kann jede Excel-Datei \u2013 \u00fcber \u201eSpeichern unter \u2026\u201c als CSV-Datei gespeichert werden.","help_how_to_format_csv":"Wie muss das CSV geformt sein?","help_how_to_format_csv_content":"Damit CSVXML mit einer CSV-Datei umgehen kann und importierbare Daten generieren kann, muss die CSV-Datei in passender Form heraufgeladen werden. Dazu geh\u00f6rt vor allem, dass Semikola als Trennzeichen und doppelte Anf\u00fchrungsstriche als Delimiter ausgew\u00e4hlt sein m\u00fcssen. Die enthaltenen Daten m\u00fcssen in der Kodierung UTF-8 vorliegen, sonst erscheinen z.B. im XML statt Umlauten unerwartete Zeichen. Neuere Excel-Versionen erlauben im Dialog \u201eSpeichern unter\u201c die Auswahl \u201eCSV UTF-8 (durch Trennzeichen getrennt) (*.csv)\u201c. Hier\u00fcber k\u00f6nnen Sie ihre urspr\u00fcngliche Excel-Datei im f\u00fcr CSVXML passenden Format speichern. LibreOffice Calc bietet eine \u00e4quivalente Option."}

View File

@ -1 +1 @@
{"remarks":"Remarks","download":"Download","upload":"Upload","select_csv_file_for_upload":"Please select a CSV file to create XML files","currently_approved_tags":"Currently approved tags (column names) for md:import","download_csv_all":"Download CSV template with all fields","download_csv_by_selection":"Download CSV template based on selection","select_required_fields":"Select required fields","select_all_fields":"Select all fields","unset_selection":"Unset selection","file_format":"File format","validation_errors":"Validation errors","errors_parsing":"Parse errors","errors_mandatoryTags":"Missing mandatory tags","errors_duplicateInvNos":"Duplicate inventory numbers","errors_dependentColumns":"Column dependencies unresolved","errors_controlledLists":"Controlled lists","errors_mainImageResource":"Missing main images or resources","allowed_values":"Allowed values","privacy_policy":"Privacy policy","contact":"Contact","news":"News","imprint":"Imprint","about":"About","help_where_am_i":"What is this page for?","help_where_am_i_content":" CSVXML helps validate import object data for museum-digital following museum-digital's standard import format."} {"remarks":"Remarks","download":"Download","upload":"Upload","select_csv_file_for_upload":"Please select a CSV file to create XML files","currently_approved_tags":"Currently approved tags (column names) for md:import","download_csv_all":"Download CSV template with all fields","download_csv_by_selection":"Download CSV template based on selection","select_required_fields":"Select required fields","select_all_fields":"Select all fields","unset_selection":"Unset selection","file_format":"File format","validation_errors":"Validation errors","errors_parsing":"Parse errors","errors_mandatoryTags":"Missing mandatory tags","errors_duplicateInvNos":"Duplicate inventory numbers","errors_dependentColumns":"Column dependencies unresolved","errors_controlledLists":"Controlled lists","errors_mainImageResource":"Missing main images or resources","allowed_values":"Allowed values","privacy_policy":"Privacy policy","contact":"Contact","news":"News","imprint":"Imprint","about":"About","help_where_am_i":"What is this page for?","help_where_am_i_content":" CSVXML helps validate import object data for museum-digital following museum-digital's standard import format.","help_what_is_csv":"What is CSV?","help_what_is_csv_content":"CSV is the abbreviation for \u201eComma Separated Value\u201c. It describes a file format for expressing tabular information in plain text files, that is supported by most table calculation programms such as MS Excel and LibreOffice Calc. It is thus a useful choice for quickly generating and sharing semi-structured data that can be further processed by other programms.","help_how_to_format_csv":"How to format CSV files for CSVXML?","help_how_to_format_csv_content":"CSVXML first of all requires CSV file using semicolons as a separator and double quotation marks as a delimiter. For generating actually importable data, it is advisable to save the CSV file in UTF-8 rather than the standard-conformant ASCII. Both current versions of MS Excel and LibreOffice Calc support export options for exporting CSV files using UTF-8 encoding."}

View File

@ -1 +1 @@
{"remarks":"Megjegyz\u00e9sek","download":"Let\u00f6lt\u00e9s","upload":"Felt\u00f6lt\u00e9s","select_csv_file_for_upload":"Please select a CSV file to create XML files","currently_approved_tags":"Jelenleg j\u00f3v\u00e1hagyott c\u00edmk\u00e9k (oszlopnevek) az md:importhoz","download_csv_all":"Download CSV template with all fields","download_csv_by_selection":"Download CSV template based on selection","select_required_fields":"K\u00f6telez\u0151 mez\u0151k kijel\u00f6l\u00e9se","select_all_fields":"\u00d6sszes mez\u0151 kijel\u00f6l\u00e9s","unset_selection":"Kijel\u00f6l\u00e9s megsz\u00fcntet\u00e9se","file_format":"Kiterjeszt\u00e9s","validation_errors":"Validation errors","errors_parsing":"Parse errors","errors_mandatoryTags":"Missing mandatory tags","errors_duplicateInvNos":"Duplicate inventory numbers","errors_dependentColumns":"Column dependencies unresolved","errors_controlledLists":"Controlled lists","errors_mainImageResource":"Missing main images or resources","allowed_values":"Allowed values","privacy_policy":"Privacy policy","contact":"Contact","news":"News","imprint":"Imprint","about":"About","help_where_am_i":"What is this page for?","help_where_am_i_content":" CSVXML helps validate import object data for museum-digital following museum-digital's standard import format."} {"remarks":"Megjegyz\u00e9sek","download":"Let\u00f6lt\u00e9s","upload":"Felt\u00f6lt\u00e9s","select_csv_file_for_upload":"Please select a CSV file to create XML files","currently_approved_tags":"Jelenleg j\u00f3v\u00e1hagyott c\u00edmk\u00e9k (oszlopnevek) az md:importhoz","download_csv_all":"Download CSV template with all fields","download_csv_by_selection":"Download CSV template based on selection","select_required_fields":"K\u00f6telez\u0151 mez\u0151k kijel\u00f6l\u00e9se","select_all_fields":"\u00d6sszes mez\u0151 kijel\u00f6l\u00e9s","unset_selection":"Kijel\u00f6l\u00e9s megsz\u00fcntet\u00e9se","file_format":"Kiterjeszt\u00e9s","validation_errors":"Validation errors","errors_parsing":"Parse errors","errors_mandatoryTags":"Missing mandatory tags","errors_duplicateInvNos":"Duplicate inventory numbers","errors_dependentColumns":"Column dependencies unresolved","errors_controlledLists":"Controlled lists","errors_mainImageResource":"Missing main images or resources","allowed_values":"Allowed values","privacy_policy":"Privacy policy","contact":"Contact","news":"News","imprint":"Imprint","about":"About","help_where_am_i":"What is this page for?","help_where_am_i_content":" CSVXML helps validate import object data for museum-digital following museum-digital's standard import format.","help_what_is_csv":"What is CSV?","help_what_is_csv_content":"CSV is the abbreviation for \u201eComma Separated Value\u201c. It describes a file format for expressing tabular information in plain text files, that is supported by most table calculation programms such as MS Excel and LibreOffice Calc. It is thus a useful choice for quickly generating and sharing semi-structured data that can be further processed by other programms.","help_how_to_format_csv":"How to format CSV files for CSVXML?","help_how_to_format_csv_content":"CSVXML first of all requires CSV file using semicolons as a separator and double quotation marks as a delimiter. For generating actually importable data, it is advisable to save the CSV file in UTF-8 rather than the standard-conformant ASCII. Both current versions of MS Excel and LibreOffice Calc support export options for exporting CSV files using UTF-8 encoding."}

View File

@ -62,6 +62,10 @@ function generateTranslationFile(string $lang):string {
'help_where_am_i' => $tlLoader->tl("csvxml-overview", "csvxml_overview", 'help_where_am_i'), 'help_where_am_i' => $tlLoader->tl("csvxml-overview", "csvxml_overview", 'help_where_am_i'),
'help_where_am_i_content' => $tlLoader->tl("csvxml-overview", "csvxml_overview", 'help_where_am_i_content'), 'help_where_am_i_content' => $tlLoader->tl("csvxml-overview", "csvxml_overview", 'help_where_am_i_content'),
'help_what_is_csv' => $tlLoader->tl("csvxml-overview", "csvxml_overview", 'help_what_is_csv'),
'help_what_is_csv_content' => $tlLoader->tl("csvxml-overview", "csvxml_overview", 'help_what_is_csv_content'),
'help_how_to_format_csv' => $tlLoader->tl("csvxml-overview", "csvxml_overview", 'help_how_to_format_csv'),
'help_how_to_format_csv_content' => $tlLoader->tl("csvxml-overview", "csvxml_overview", 'help_how_to_format_csv_content'),
]); ]);
} }