Skip to content

Commit

Permalink
fixed translation
Browse files Browse the repository at this point in the history
  • Loading branch information
hschell-cortado committed Aug 31, 2022
1 parent 2267d2c commit c756663
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 18 deletions.
4 changes: 3 additions & 1 deletion src/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@
"printButton": "Dokument drucken",
"createAccount": "Registrieren",
"continue": "Drucken",
"logout": "Abmelden"
"logout": "Abmelden",
"ieDeprecationWarning": "Diese Version von Microsoft Office wird nicht mehr unterstützt. Bitte aktualisieren Sie Ihr Microsoft Office.",
"noData": "Keine Daten gefunden! Bitte schließen sie das ezeep Blue Add-in, fügen Sie etwas zum Dokument hinzu und versuchen Sie es erneut."
}
28 changes: 11 additions & 17 deletions src/taskpane/taskpane.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,27 @@ Office.onReady(async (info) => {
iesection = document.querySelector("#iesection");
loadingSection = document.querySelector("#loading");
noDataSection = document.querySelector("#noDataSection");
ezpPrinting = document.querySelector("ezp-printing");
authBtn = document.querySelector("#authButton");
printBtn = document.querySelector("#printBtn");
logOutBtn = document.querySelector("#logoutBtn");

language = Office.context.displayLanguage.toLowerCase();
ezpPrinting.setAttribute("language", language.slice(0, 2));

await initi18n(language);
translate();

// is legacy edge or ie?
if (navigator.userAgent.indexOf("Trident") > -1 || navigator.userAgent.indexOf("Edge") > -1) {
loadingSection.style.display = "none";
continueSection.style.display = "none";
authSection.style.display = "none";
printingSection.style.display = "none";
noDataSection.style.display = "none";
iesection.style.display = "block";
return;
}

ezpPrinting = document.querySelector("ezp-printing");
authBtn = document.querySelector("#authButton");
printBtn = document.querySelector("#printBtn");
logOutBtn = document.querySelector("#logoutBtn");
iesection.style.display = "none";
continueSection.style.display = "none";
authSection.style.display = "none";
Expand All @@ -63,11 +69,6 @@ Office.onReady(async (info) => {

authBtn.onclick = openAuthDialog;

language = Office.context.displayLanguage.toLowerCase();
ezpPrinting.setAttribute("language", language.slice(0, 2));

await initi18n(language);
translate();
authorized = await ezpPrinting.checkAuth();
authSection.style.display = authorized ? "none" : "block";

Expand Down Expand Up @@ -199,13 +200,6 @@ async function onGotAllSlices(docdataSlices) {

// read filedata as binary string
reader.readAsBinaryString(new Blob([filearray]));
// write to file
// const blob = new Blob([filearray], { type: "application/pdf" });
// const url = URL.createObjectURL(blob);
// const a = document.createElement("a");
// a.href = url;
// a.download = "test.pdf";
// a.click();
}

async function openAuthDialog() {
Expand Down

0 comments on commit c756663

Please sign in to comment.