diff options
author | marvin-borner@live.com | 2018-04-12 21:55:34 +0200 |
---|---|---|
committer | marvin-borner@live.com | 2018-04-12 21:55:34 +0200 |
commit | a7e6fe259817780bcc3642e6c1f33e0059c1a6fe (patch) | |
tree | 95198f928d01f62506d79bf36e7d7fab6658f8a9 | |
parent | f79f7d062ad8dcf89116da8faba456c4519d3d2a (diff) |
Fixed some bugs and added translations - nothing special here
-rw-r--r-- | assets/js/chat.js | 7 | ||||
-rw-r--r-- | assets/languages/json/Translations.json | 40 | ||||
-rw-r--r-- | assets/languages/json/de.json | 16 | ||||
-rw-r--r-- | assets/languages/json/en.json | 16 | ||||
-rw-r--r-- | assets/languages/json/fr.json | 14 | ||||
-rw-r--r-- | index.php | 16 |
6 files changed, 76 insertions, 33 deletions
diff --git a/assets/js/chat.js b/assets/js/chat.js index 96be014..c715fbd 100644 --- a/assets/js/chat.js +++ b/assets/js/chat.js @@ -45,15 +45,16 @@ WebSocket.onmessage = function (e) { } else if (MessageObject.ServerMessage === true) {
if (MessageObject.ServerMessageType === "GroupJoin") {
if (MessageObject.WasHimself === false) {
- ChatResponses.append(MessageObject.Username + " joined the group. <br>");
+ ChatResponses.append(MessageObject.Username + " <span data-lang='joined the group'></span><br>");
} else if (MessageObject.WasHimself === true) {
ChatResponses.empty();
- ChatResponses.append("You joined the group " + MessageObject.GroupName + ".<br>");
+ ChatResponses.append("<span data-lang='You joined the group'> " + MessageObject.GroupName + "</span>.<br>");
}
} else if (MessageObject.ServerMessageType === "UserDisconnect") {
- ChatResponses.append(MessageObject.Username + " disconnected from the Server.");
+ ChatResponses.append(MessageObject.Username + " <span data-lang='has disconnected from the server'></span><br>");
}
}
+ initiateLanguage(); // need further work (performance)
};
ChatTextInput.keyup(function (e) {
diff --git a/assets/languages/json/Translations.json b/assets/languages/json/Translations.json index 400ab01..58f9733 100644 --- a/assets/languages/json/Translations.json +++ b/assets/languages/json/Translations.json @@ -1,12 +1,38 @@ { "en": { - "langcode": "en", - "Hello": "Hello World!", - "Yes": "Yes" + "Translator": "Marvin Borner", + "you": "you", + "Feed": "New", + "Explore": "Explore", + "Chat": "Chat", + "Friends": "Friends", + "Personal": "Personal", + "joined the group": "joined the group", + "You joined the group": "You joined the group", + "has disconnected from the server": "has disconnected from the server" + }, + "de": { + "Translator": "Marvin Borner", + "you": "du", + "Feed": "Neues", + "Explore": "Entdecken", + "Chat": "Nachrichten", + "Friends": "Freunde", + "Personal": "Persönliche Daten", + "joined the group": "ist der Gruppe beigetreten", + "You joined the group": "Du bist der Gruppe beigetreten", + "has disconnected from the server": "hat sich vom Server getrennt" }, "fr": { - "langcode": "fr", - "Hello": "Bonjour à tous!", - "Yes": "Oui" + "Translator": "Marvin Borner (non-french)", + "you": "vous", + "Feed": "D'actualités", + "Explore": "Dépister", + "Chat": "Message", + "Friends": "Camarades", + "Personal": "Personnelles", + "joined the group": "s'est joint au groupe", + "You joined the group": "Vous avez rejoint le groupe", + "has disconnected from the server": "s'est déconnecté du serveur." } -}
\ No newline at end of file +} diff --git a/assets/languages/json/de.json b/assets/languages/json/de.json index 443ad74..74d522a 100644 --- a/assets/languages/json/de.json +++ b/assets/languages/json/de.json @@ -1,12 +1,14 @@ { "de": { "Translator": "Marvin Borner", - "Reset all values": "Möchten Sie alle Angaben zurücksetzen?", - "Yes": "Ja", - "No": "Nein", - "Room temperature": "Raum Temperatur", - "Length": "Länge", - "Width": "Breite", - "Height": "Width" + "you": "du", + "Feed": "Neues", + "Explore": "Entdecken", + "Chat": "Nachrichten", + "Friends": "Freunde", + "Personal": "Persönliche Daten", + "joined the group": "ist der Gruppe beigetreten", + "You joined the group": "Du bist der Gruppe beigetreten", + "has disconnected from the server": "hat sich vom Server getrennt" } } diff --git a/assets/languages/json/en.json b/assets/languages/json/en.json index fc066df..981bb83 100644 --- a/assets/languages/json/en.json +++ b/assets/languages/json/en.json @@ -1,12 +1,14 @@ { "en": { "Translator": "Marvin Borner", - "Reset all values": "Reset all values to default values?", - "Yes": "Yes", - "No": "No", - "Room temperature": "Room temperature", - "Length": "Length", - "Width": "Width", - "Height": "Height" + "you": "you", + "Feed": "New", + "Explore": "Explore", + "Chat": "Chat", + "Friends": "Friends", + "Personal": "Personal", + "joined the group": "joined the group", + "You joined the group": "You joined the group", + "has disconnected from the server": "has disconnected from the server" } } diff --git a/assets/languages/json/fr.json b/assets/languages/json/fr.json new file mode 100644 index 0000000..5c59619 --- /dev/null +++ b/assets/languages/json/fr.json @@ -0,0 +1,14 @@ +{ + "fr": { + "Translator": "Marvin Borner (non-french)", + "you": "vous", + "Feed": "D'actualités", + "Explore": "Dépister", + "Chat": "Message", + "Friends": "Camarades", + "Personal": "Personnelles", + "joined the group": "s'est joint au groupe", + "You joined the group": "Vous avez rejoint le groupe", + "has disconnected from the server": "s'est déconnecté du serveur." + } +} @@ -8,8 +8,6 @@ <meta name="theme-color" content="#0B1D33">
<meta name="msapplication-navbutton-color" content="#0B1D33">
<meta name="apple-mobile-web-app-status-bar-style" content="#0B1D33">
-
- <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.9/css/all.css" media="screen">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick.min.css"
media="screen">
<link rel="stylesheet" href="assets/css/main.css" media="screen">
@@ -25,7 +23,7 @@ <div class="header">
<span class="LeftButtonHeader"><img draggable="false" ondragstart="return false;"
src="assets/icons/BurgerMenuShort.svg"></span>
- <span class="HeaderCaption">Feed</span>
+ <span class="HeaderCaption"><span data-lang='Feed'></span></span>
<span class="RightButtonHeader"><i class="fas fa-bell"></i></span>
</div>
<hr>
@@ -36,7 +34,7 @@ <div class="header">
<span class="LeftButtonHeader"><img draggable="false" ondragstart="return false;"
src="assets/icons/BurgerMenuShort.svg"></span>
- <span class="HeaderCaption">Explore</span>
+ <span class="HeaderCaption"><span data-lang='Explore'></span></span>
<span class="RightButtonHeader"><i class="fas fa-bell"></i></span>
</div>
<hr>
@@ -47,14 +45,13 @@ <div class="header">
<span class="LeftButtonHeader"><img draggable="false" ondragstart="return false;"
src="assets/icons/BurgerMenuShort.svg"></span>
- <span class="HeaderCaption">Chat</span>
+ <span class="HeaderCaption"><span data-lang='Chat'></span></span>
<span class="RightButtonHeader"><i class="fas fa-bell"></i></span>
</div>
<hr>
</div>
<div class="MainInTab">
<div class="ChatWindow">
- <span data-lang='Hello'></span>
<div id="ChatResponses" class="ChatResponses"></div>
<input title="ChatTextInput" id="ChatTextInput" class="ChatInput" type="text"/>
<input title="SubscribeTextInput" id="SubscribeTextInput" class="ChatInput" type="text"/>
@@ -66,7 +63,7 @@ <div class="header">
<span class="LeftButtonHeader"><img draggable="false" ondragstart="return false;"
src="assets/icons/BurgerMenuShort.svg"></span>
- <span class="HeaderCaption">Friends</span>
+ <span class="HeaderCaption"><span data-lang='Friends'></span></span>
<span class="RightButtonHeader"><i class="fas fa-bell"></i></span>
</div>
<hr>
@@ -77,7 +74,7 @@ <div class="header">
<span class="LeftButtonHeader"><img draggable="false" ondragstart="return false;"
src="assets/icons/BurgerMenuShort.svg"></span>
- <span class="HeaderCaption">Personal</span>
+ <span class="HeaderCaption"><span data-lang='Personal'></span></span>
<span class="RightButtonHeader"><i class="fas fa-bell"></i></span>
</div>
<hr>
@@ -108,7 +105,7 @@ <script>
function initiateLanguage() {
var translate = new Translate();
- var currentLng = 'fr'; // <- PHP IP LOCATION
+ var currentLng = 'de'; // <- PHP IP LOCATION
translate.init(currentLng);
translate.process();
}
@@ -116,6 +113,7 @@ <script src="https://code.jquery.com/jquery-latest.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick.min.js"></script>
+<script defer src="https://use.fontawesome.com/releases/v5.0.10/js/all.js"></script>
<script src="assets/js/language.js"></script>
<script src="assets/js/encryption.js"></script>
<script src="assets/js/chat.js"></script>
|