Merge branch 'develop' of github.com:thecodingmachine/workadventure into pre-compile-front

This commit is contained in:
David Négrier 2022-01-27 15:41:51 +01:00
commit d1a88dd375
27 changed files with 471 additions and 44 deletions

View file

@ -8,7 +8,6 @@ import type { ButtonClickedEvent } from "./Events/ButtonClickedEvent";
import { ClosePopupEvent, isClosePopupEvent } from "./Events/ClosePopupEvent";
import { scriptUtils } from "./ScriptUtils";
import { isGoToPageEvent } from "./Events/GoToPageEvent";
import { isCloseCoWebsite, CloseCoWebsiteEvent } from "./Events/CloseCoWebsiteEvent";
import {
IframeErrorAnswerEvent,
IframeQueryMap,

View file

@ -1,4 +1,3 @@
import { coWebsiteManager, CoWebsite } from "../WebRtc/CoWebsiteManager";
import { playersStore } from "../Stores/PlayersStore";
import { chatMessagesStore } from "../Stores/ChatStore";
import type { ChatEvent } from "./Events/ChatEvent";

View file

@ -4,6 +4,7 @@
import { onDestroy, onMount } from "svelte";
import { EmojiButton } from "@joeattardi/emoji-button";
import { isMobile } from "../../Enum/EnvironmentVariable";
import LL from "../../i18n/i18n-svelte";
let emojiContainer: HTMLElement;
let picker: EmojiButton;
@ -15,10 +16,31 @@
rootElement: emojiContainer,
styleProperties: {
"--font": "Press Start 2P",
"--text-color": "whitesmoke",
"--secondary-text-color": "whitesmoke",
"--category-button-color": "whitesmoke",
},
emojisPerRow: isMobile() ? 6 : 8,
autoFocusSearch: false,
style: "twemoji",
showPreview: false,
i18n: {
search: $LL.emoji.search(),
categories: {
recents: $LL.emoji.categories.recents(),
smileys: $LL.emoji.categories.smileys(),
people: $LL.emoji.categories.people(),
animals: $LL.emoji.categories.animals(),
food: $LL.emoji.categories.food(),
activities: $LL.emoji.categories.activities(),
travel: $LL.emoji.categories.travel(),
objects: $LL.emoji.categories.objects(),
symbols: $LL.emoji.categories.symbols(),
flags: $LL.emoji.categories.flags(),
custom: $LL.emoji.categories.custom(),
},
notFound: $LL.emoji.notFound(),
},
});
//the timeout is here to prevent the menu from flashing
setTimeout(() => picker.showPicker(emojiContainer), 100);

View file

@ -104,13 +104,13 @@
>
<option value={40}
>{isMobile()
? $LL.menu.settings.gameQuality.short.minimum()
: $LL.menu.settings.gameQuality.long.minimum()}</option
? $LL.menu.settings.gameQuality.short.small()
: $LL.menu.settings.gameQuality.long.small()}</option
>
<option value={20}
>{isMobile()
? $LL.menu.settings.gameQuality.short.small()
: $LL.menu.settings.gameQuality.long.small()}</option
? $LL.menu.settings.gameQuality.short.minimum()
: $LL.menu.settings.gameQuality.long.minimum()}</option
>
</select>
</div>
@ -131,13 +131,13 @@
>
<option value={10}
>{isMobile()
? $LL.menu.settings.videoQuality.short.minimum()
: $LL.menu.settings.videoQuality.long.minimum()}</option
? $LL.menu.settings.videoQuality.short.small()
: $LL.menu.settings.videoQuality.long.small()}</option
>
<option value={5}
>{isMobile()
? $LL.menu.settings.videoQuality.short.small()
: $LL.menu.settings.videoQuality.long.small()}</option
? $LL.menu.settings.videoQuality.short.minimum()
: $LL.menu.settings.videoQuality.long.minimum()}</option
>
</select>
</div>

View file

@ -512,7 +512,7 @@ class CoWebsiteManager {
if (this.coWebsites.length < 1) {
this.loadMain();
} else if (this.coWebsites.length === 5) {
throw new Error("Too many we");
throw new Error("Too many websites");
}
Promise.resolve(callback(this.cowebsiteBufferDom))
@ -580,7 +580,7 @@ class CoWebsiteManager {
return reject();
});
})
.catch((e) => console.error("Error loadCoWebsite >=> ", e));
.catch((e) => console.error("Error loadCoWebsite => ", e));
});
}

View file

@ -0,0 +1,10 @@
import type { Translation } from "../i18n-types";
const audio: NonNullable<Translation["audio"]> = {
manager: {
reduce: "Während Unterhaltungen verringern",
},
message: "Sprachnachricht",
};
export default audio;

View file

@ -0,0 +1,22 @@
import type { Translation } from "../i18n-types";
const camera: NonNullable<Translation["camera"]> = {
enable: {
title: "Bitte schalte deine Kamera und dein Mikrofon ein.",
start: "Los gehts!",
},
help: {
title: "Zugriff auf Kamera / Mikrofon erforderlich",
permissionDenied: "Zugriff verweigert",
content: "Der Zugriff auf Kamera und Mikrofon muss im Browser freigegeben werden.",
firefoxContent:
'Bitte klicke auf "Diese Entscheidungen speichern" Schaltfläche um erneute Nachfragen nach der Freigabe in Firefox zu verhindern.',
refresh: "Aktualisieren",
continue: "Ohne Kamera fortfahren",
},
my: {
silentZone: "Stiller Bereich",
},
};
export default camera;

View file

@ -0,0 +1,12 @@
import type { Translation } from "../i18n-types";
const chat: NonNullable<Translation["chat"]> = {
intro: "Hier ist dein Nachrichtenverlauf:",
enter: "Verfasse deine Nachricht...",
menu: {
visitCard: "Visitenkarte",
addFriend: "Freund*In hinzufügen",
},
};
export default chat;

View file

@ -0,0 +1,11 @@
import type { Translation } from "../i18n-types";
const companion: NonNullable<Translation["companion"]> = {
select: {
title: "Wähle einen Gefährten",
any: "Kein Gefährte",
continue: "Weiter",
},
};
export default companion;

View file

@ -0,0 +1,21 @@
import type { Translation } from "../i18n-types";
const emoji: NonNullable<Translation["emoji"]> = {
search: "Emojis suchen...",
categories: {
recents: "Letzte Emojis",
smileys: "Smileys & Emotionen",
people: "Menschen",
animals: "Tiere & Natur",
food: "Essen & Trinken",
activities: "Aktivitäten",
travel: "Reise & Orte",
objects: "Objekte",
symbols: "Symbole",
flags: "Flaggen",
custom: "Benutzerdefinier",
},
notFound: "Keine Emojis gefunden",
};
export default emoji;

View file

@ -0,0 +1,23 @@
import type { Translation } from "../i18n-types";
const error: NonNullable<Translation["error"]> = {
accessLink: {
title: "Ungültiger Zugangslink",
subTitle: "Karte konnte nicht gefunden werden. Prüfe bitte deinen Zugangslink.",
details:
"Für weitere Information kannst du die Administratoren kontaktieren oder melde dich bei uns unter: hello@workadventu.re",
},
connectionRejected: {
title: "Verbindungen zurückgewiesen",
subTitle: "Du kannst diese Welt nicht betreten. Versuche es später noch einmal {error}.",
details:
"Für weitere Information kannst du die Administratoren kontaktieren oder melde dich bei uns unter: hello@workadventu.re",
},
connectionRetry: {
unableConnect:
"Es konnte keine Verbindung zu WorkAdventure erstellt werden. Bist du mit dem Internet verbunden?",
},
error: "Fehler",
};
export default error;

View file

@ -0,0 +1,27 @@
import type { Translation } from "../i18n-types";
const follow: NonNullable<Translation["follow"]> = {
interactStatus: {
following: "{leader} folgen",
waitingFollowers: "Warte auf Bestätigung der Gefolgschaft",
followed: {
one: "{follower} folgt dir",
two: "{firstFollower} und {secondFollower} folgen dir",
many: "{followers} und {lastFollower} folgen dir",
},
},
interactMenu: {
title: {
interact: "Interaktion",
follow: "Möchtest du {leader} folgen?",
},
stop: {
leader: "Möchtest du nicht weiter den Weg weisen?",
follower: "Möchtest du nicht mehr {leader} folgen?",
},
yes: "Ja",
no: "Nein",
},
};
export default follow;

View file

@ -0,0 +1,34 @@
import en_US from "../en-US";
import type { Translation } from "../i18n-types";
import audio from "./audio";
import camera from "./camera";
import chat from "./chat";
import companion from "./companion";
import emoji from "./emoji";
import error from "./error";
import follow from "./follow";
import login from "./login";
import menu from "./menu";
import report from "./report";
import warning from "./warning";
import woka from "./woka";
const de_DE: Translation = {
...en_US,
language: "Deutsch",
country: "Deutschland",
audio,
camera,
chat,
companion,
woka,
error,
follow,
login,
menu,
report,
warning,
emoji,
};
export default de_DE;

View file

@ -0,0 +1,14 @@
import type { Translation } from "../i18n-types";
const login: NonNullable<Translation["login"]> = {
input: {
name: {
placeholder: "Trage deinen Namen ein",
empty: "Kein Name angegeben",
},
},
terms: 'Wenn du fortfährst, akzeptierst du die <a href="https://workadventu.re/terms-of-use" target="_blank">Nutzungsbedingungen</a>, <a href="https://workadventu.re/privacy-policy" target="_blank">Datenschutzerklärung</a> und <a href="https://workadventu.re/cookie-policy" target="_blank">Cookierichtlinien</a>.',
continue: "Fortfahren",
};
export default login;

View file

@ -0,0 +1,125 @@
import type { Translation } from "../i18n-types";
const menu: NonNullable<Translation["menu"]> = {
title: "Menu",
icon: {
open: {
menu: "Menu öffnen",
invite: "Einladung anzeigen",
register: "Registrieren",
chat: "Chat öffnen",
},
},
visitCard: {
close: "Schliessen",
},
profile: {
edit: {
name: "Deinen Namen ändern",
woka: "Dein WOKA ändern",
companion: "Deinen Begleiter ändern",
camera: "Kameraeinstellungen ändern",
},
login: "Einloggen",
logout: "Ausloggen",
},
settings: {
gameQuality: {
title: "Spiel Qualität",
short: {
high: "Hoch (120 BpS)",
medium: "Mittel (60 BpS)",
small: "Gering (40 BpS)",
minimum: "Minimal (20 BpS)",
},
long: {
high: "Hohe Video Qualität (120 BpS)",
medium: "Mittlere Video Qualität (60 BpS, empfohlen)",
small: "Geringe Video Qualität (40 BpS)",
minimum: "Minimale Video Qualität (20 BpS)",
},
},
videoQuality: {
title: "Video Qualität",
short: {
high: "Hoch (30 BpS)",
medium: "Mittel (20 BpS)",
small: "Gering (10 BpS)",
minimum: "Minimale (5 BpS)",
},
long: {
high: "Hohe Video Qualität (30 BpS)",
medium: "Mittlere Video Qualität (20 BpS, empfohlen)",
small: "Geringe Video Qualität (10 BpS)",
minimum: "Minimale Video Qualität (5 BpS)",
},
},
language: {
title: "Sprache",
},
save: {
warning: "(Das Spiel wird nach dem Speichern neugestartet)",
button: "Speichern",
},
fullscreen: "Vollbild",
notifications: "Benachrichtigungen",
cowebsiteTrigger: "Jedes mal nachfragen bevor Webseiten oder Jitsi Meet Räume geöffnet werden",
ignoreFollowRequest: "Ignoriere Folgen-Anfragen anderer Nutzer",
},
invite: {
description: "Link zu diesem Raum teilen!",
copy: "Kopieren",
share: "Teilen",
},
globalMessage: {
text: "Text",
audio: "Audio",
warning: "An alle Räume dieser Welt senden",
enter: "Trage hier deine Nachricht ein...",
send: "Senden",
},
globalAudio: {
uploadInfo: "Datei hochladen",
error: "Keine Datei ausgewählt. Du musst vor dem Versenden eine Datei hochladen.",
},
contact: {
gettingStarted: {
title: "Erste Schritte",
description:
"Mit WorkAdventure kannst du eine Onlinewelt schaffen in der du dich spontan mit Anderen treffen und unterhalten kannst. Erstelle als erstes deine eigene Karte. Es steht dir eine großen Auswahl an vorgefertigten Karten von unserem Team zur Auswahl.",
},
createMap: {
title: "Eigene Karte erstellen ",
description:
"Du kannst auch deine eigene Karte erstellen. Folge dazu unserer Schritt-für-Schritt Anleitung.",
},
},
about: {
mapInfo: "Informationen über diese Karte",
mapLink: "Link zur Karte",
copyrights: {
map: {
title: "Urheberrecht der Karte",
empty: "Die Ersteller*In der Karte hat keine Informationen zum Urheberrecht hinterlegt.",
},
tileset: {
title: "Urheberrecht der Tilesets",
empty: "Die Ersteller*In der Karte hat keine Informationen zum Urheberrecht der Tilesets hinterlegt. Dies bedeutet nicht, dass die Tilesets keiner Lizenz unterliegen.",
},
audio: {
title: "Urheberrecht der Audiodateien",
empty: "Die Ersteller*In der Karte hat keine Informationen zum Urheberrecht der Audiodateien hinterlegt. Dies bedeutet nicht, dass die Audiodateien keiner Lizenz unterliegen.",
},
},
},
sub: {
profile: "Profil",
settings: "Einstellungen",
invite: "Einladung",
credit: "Über die Karte",
globalMessages: "Globale Nachrichten",
contact: "Kontakt",
},
};
export default menu;

View file

@ -0,0 +1,25 @@
import type { Translation } from "../i18n-types";
const report: NonNullable<Translation["report"]> = {
block: {
title: "Blockieren",
content: "Blockiere jede Kommunikation von und zu {userName}. Kann jederzeit rückgängig gemacht werden.",
unblock: "Blockierung für diesen User aufheben",
block: "Blockiere diese User",
},
title: "Melden",
content: "Verfasse eine Meldung an die Administratoren dieses Raums. Diese können den User anschließend bannen.",
message: {
title: "Deine Nachricht: ",
empty: "Bitte einen Text angeben.",
},
submit: "Diesen User melden",
moderate: {
title: "{userName} moderieren",
block: "Blockieren",
report: "Melden",
noSelect: "FEHLER : Es ist keine Handlung ausgewählt.",
},
};
export default report;

View file

@ -0,0 +1,17 @@
import type { Translation } from "../i18n-types";
const warning: NonNullable<Translation["warning"]> = {
title: "Warnung!",
content:
'Diese Welt erreicht bald die maximale Kapazität. Du kannst die Kapazität <a href={upgradeLink} target="_blank">hier</a> erhöhen',
limit: "Diese Welt erreicht bald die maximale Kapazität!",
accessDenied: {
camera: "Zugriff auf die Kamera verweigert. Hier klicken um deine Browser Berechtigungen zu prüfen.",
screenSharing:
"Zugriff auf die Bildschirmfreigabe verweigert. Hier klicken um deine Browser Berechtigungen zu prüfen.",
},
importantMessage: "Wichtige Nachricht",
connectionLost: "Verbindungen unterbrochen. Wiederverbinden...",
};
export default warning;

View file

@ -0,0 +1,20 @@
import type { Translation } from "../i18n-types";
const woka: NonNullable<Translation["woka"]> = {
customWoka: {
title: "Dein WOKA bearbeiten",
navigation: {
return: "Zurück",
back: "Hoch",
finish: "Auswählen",
next: "Runter",
},
},
selectWoka: {
title: "Dein WOKA auswählen",
continue: "Auswählen",
customize: "Bearbeite dein WOKA",
},
};
export default woka;

View file

@ -0,0 +1,21 @@
import type { BaseTranslation } from "../i18n-types";
const emoji: BaseTranslation = {
search: "Search emojis...",
categories: {
recents: "Recent Emojis",
smileys: "Smileys & Emotion",
people: "People & Body",
animals: "Animals & Nature",
food: "Food & Drink",
activities: "Activities",
travel: "Travel & Places",
objects: "Objects",
symbols: "Symbols",
flags: "Flags",
custom: "Custom",
},
notFound: "No emojis found",
};
export default emoji;

View file

@ -10,6 +10,7 @@ import login from "./login";
import menu from "./menu";
import report from "./report";
import warning from "./warning";
import emoji from "./emoji";
const en_US: BaseTranslation = {
language: "English",
@ -25,6 +26,7 @@ const en_US: BaseTranslation = {
menu,
report,
warning,
emoji,
};
export default en_US;

View file

@ -29,14 +29,14 @@ const menu: BaseTranslation = {
short: {
high: "High (120 fps)",
medium: "Medium (60 fps)",
minimum: "Minimum (40 fps)",
small: "Small (20 fps)",
small: "Small (40 fps)",
minimum: "Minimum (20 fps)",
},
long: {
high: "High video quality (120 fps)",
medium: "Medium video quality (60 fps, recommended)",
minimum: "Minimum video quality (40 fps)",
small: "Small video quality (20 fps)",
small: "Small video quality (40 fps)",
minimum: "Minimum video quality (20 fps)",
},
},
videoQuality: {
@ -44,14 +44,14 @@ const menu: BaseTranslation = {
short: {
high: "High (30 fps)",
medium: "Medium (20 fps)",
minimum: "Minimum (10 fps)",
small: "Small (5 fps)",
small: "Small (10 fps)",
minimum: "Minimum (5 fps)",
},
long: {
high: "High video quality (30 fps)",
medium: "Medium video quality (20 fps, recommended)",
minimum: "Minimum video quality (10 fps)",
small: "Small video quality (5 fps)",
small: "Small video quality (10 fps)",
minimum: "Minimum video quality (5 fps)",
},
},
language: {

View file

@ -3,7 +3,7 @@ import type { Translation } from "../i18n-types";
const camera: NonNullable<Translation["camera"]> = {
enable: {
title: "Allumez votre caméra et votre microphone",
start: "C'est partie!",
start: "C'est parti!",
},
help: {
title: "Accès à la caméra / au microphone nécessaire",

View file

@ -0,0 +1,21 @@
import type { Translation } from "../i18n-types";
const emoji: NonNullable<Translation["emoji"]> = {
search: "Chercher un emoji...",
categories: {
recents: "Emojis récents",
smileys: "Smileys & emotions",
people: "Personne & corps",
animals: "Animaux & nature",
food: "Nourriture & boissons",
activities: "Activités",
travel: "Voyage & endroits",
objects: "Objets",
symbols: "Symbols",
flags: "Drapeaux",
custom: "Personalisés",
},
notFound: "Aucun emoji trouvé",
};
export default emoji;

View file

@ -4,6 +4,7 @@ import audio from "./audio";
import camera from "./camera";
import chat from "./chat";
import companion from "./companion";
import emoji from "./emoji";
import error from "./error";
import follow from "./follow";
import login from "./login";
@ -27,6 +28,7 @@ const fr_FR: Translation = {
menu,
report,
warning,
emoji,
};
export default fr_FR;

View file

@ -29,14 +29,14 @@ const menu: NonNullable<Translation["menu"]> = {
short: {
high: "Haute (120 fps)",
medium: "Moyenne (60 fps)",
minimum: "Minimale (40 fps)",
small: "Reduite (20 fps)",
small: "Reduite (40 fps)",
minimum: "Minimale (20 fps)",
},
long: {
high: "Haute (120 fps)",
medium: "Moyenne (60 fps, recommandée)",
minimum: "Minimale (40 fps)",
small: "Reduite (20 fps)",
small: "Reduite (40 fps)",
minimum: "Minimale (20 fps)",
},
},
videoQuality: {
@ -44,14 +44,14 @@ const menu: NonNullable<Translation["menu"]> = {
short: {
high: "Haute (30 fps)",
medium: "Moyenne (20 fps)",
minimum: "Minimale (10 fps)",
small: "Reduite (5 fps)",
small: "Reduite (10 fps)",
minimum: "Minimale (5 fps)",
},
long: {
high: "Haute (30 fps)",
medium: "Moyenne (20 fps, recommandée)",
minimum: "Minimale (10 fps)",
small: "Reduite (5 fps)",
small: "Reduite (10 fps)",
minimum: "Minimale (5 fps)",
},
},
language: {

View file

@ -1,7 +1,7 @@
WA.room.onEnterLayer('myLayer').subscribe(() => {
WA.chat.sendChatMessage("Hello!", 'Wooka');
WA.chat.sendChatMessage("Hello!", 'Woka');
});
WA.room.onLeaveLayer('myLayer').subscribe(() => {
WA.chat.sendChatMessage("Goodbye!", 'Wooka');
WA.chat.sendChatMessage("Goodbye!", 'Woka');
});

View file

@ -12,12 +12,12 @@ WA.onInit().then(() => {
});
});
function wookaSendMessage(message) {
WA.chat.sendChatMessage(message, 'Wooka');
function wokaSendMessage(message) {
WA.chat.sendChatMessage(message, 'Woka');
}
function unknownCommand() {
wookaSendMessage('Unknown command');
wokaSendMessage('Unknown command');
}
function executeCommand(command, args) {
@ -32,7 +32,7 @@ function executeCommand(command, args) {
function coWebsiteCommand(args) {
if (args.length < 1) {
wookaSendMessage('Too few arguments');
wokaSendMessage('Too few arguments');
return;
}
@ -52,27 +52,27 @@ function coWebsiteCommand(args) {
async function openCoWebsite(args) {
if (args.length < 1) {
wookaSendMessage('Too few arguments');
wokaSendMessage('Too few arguments');
return;
}
try {
const url = new URL(args[0]);
} catch (exception) {
wookaSendMessage('Parameter is not a valid URL !');
wokaSendMessage('Parameter is not a valid URL !');
return;
}
await WA.nav.openCoWebSite(args[0]).then(() => {
wookaSendMessage('Co-website has been opened !');
wokaSendMessage('Co-website has been opened !');
}).catch((error) => {
wookaSendMessage(`Something wrong happen during co-website opening: ${error.message}`);
wokaSendMessage(`Something wrong happen during co-website opening: ${error.message}`);
});
}
async function closeCoWebsite(args) {
if (args.length < 1) {
wookaSendMessage('Too few arguments');
wokaSendMessage('Too few arguments');
return;
}
@ -83,7 +83,7 @@ async function closeCoWebsite(args) {
coWebsites.forEach(coWebsite => {
coWebsite.close();
});
wookaSendMessage('All co-websites has been closed !');
wokaSendMessage('All co-websites has been closed !');
return;
}
@ -96,13 +96,13 @@ async function closeCoWebsite(args) {
coWebsites.find((coWebsite) => coWebsite.position === position);
if (!coWebsite) {
wookaSendMessage('Unknown co-website');
wokaSendMessage('Unknown co-website');
return;
}
await coWebsite.close().then(() => {
wookaSendMessage('This co-websites has been closed !');
wokaSendMessage('This co-websites has been closed !');
}).catch((error) => {
wookaSendMessage(`Something wrong happen during co-website closing: ${error.message}`);
wokaSendMessage(`Something wrong happen during co-website closing: ${error.message}`);
});
}