projects
/
vchess.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
b0c0499
)
Improve translations
author
Benjamin Auder
<benjamin.auder@somewhere>
Mon, 10 Feb 2020 00:06:48 +0000
(
01:06
+0100)
committer
Benjamin Auder
<benjamin.auder@somewhere>
Mon, 10 Feb 2020 00:06:48 +0000
(
01:06
+0100)
client/src/App.vue
patch
|
blob
|
blame
|
history
client/src/translations/en.js
patch
|
blob
|
blame
|
history
client/src/translations/es.js
patch
|
blob
|
blame
|
history
client/src/translations/fr.js
patch
|
blob
|
blame
|
history
client/src/views/Game.vue
patch
|
blob
|
blame
|
history
client/src/views/Hall.vue
patch
|
blob
|
blame
|
history
server/sockets.js
patch
|
blob
|
blame
|
history
diff --git
a/client/src/App.vue
b/client/src/App.vue
index
0c0013e
..
2771e28
100644
(file)
--- a/
client/src/App.vue
+++ b/
client/src/App.vue
@@
-82,18
+82,17
@@
export default {
</script>
<style lang="sass">
</script>
<style lang="sass">
-
//
html, *
-
//
font-family: "Open Sans", Arial, sans-serif
-
//
--back-color: #f2f2f2
-
//
--a-link-color: black
-
//
--a-visited-color: black
+html, *
+ font-family: "Open Sans", Arial, sans-serif
+ --back-color: #f2f2f2
+ --a-link-color: black
+ --a-visited-color: black
body
padding: 0
min-width: 320px
#app
body
padding: 0
min-width: 320px
#app
- font-family: "Open Sans", "Avenir", Helvetica, Arial, sans-serif
-webkit-font-smoothing: antialiased
-moz-osx-font-smoothing: grayscale
-webkit-font-smoothing: antialiased
-moz-osx-font-smoothing: grayscale
diff --git
a/client/src/translations/en.js
b/client/src/translations/en.js
index
8a4ce5e
..
37b98a4
100644
(file)
--- a/
client/src/translations/en.js
+++ b/
client/src/translations/en.js
@@
-80,7
+80,9
@@
export const translations =
"Settings": "Settings",
"Stop game": "Stop game",
"Subject": "Subject",
"Settings": "Settings",
"Stop game": "Stop game",
"Subject": "Subject",
+ "Target is not connected": "Target is not connected",
"Terminate game?": "Terminate game?",
"Terminate game?": "Terminate game?",
+ "This tab is now offline": "This tab is now offline",
"Three repetitions": "Three repetitions",
"Time": "Time",
"To": "To",
"Three repetitions": "Three repetitions",
"Time": "Time",
"To": "To",
@@
-90,8
+92,6
@@
export const translations =
"Update": "Update",
"Variant": "Variant",
"Variants": "Variants",
"Update": "Update",
"Variant": "Variant",
"Variants": "Variants",
- "Warning: target is not connected": "Warning: target is not connected",
- "Warning: multi-tabs not supported": "Warning: multi-tabs not supported",
"White": "White",
"White to move": "White to move",
"White win": "White win",
"White": "White",
"White to move": "White to move",
"White win": "White win",
diff --git
a/client/src/translations/es.js
b/client/src/translations/es.js
index
af0e665
..
34fd2bc
100644
(file)
--- a/
client/src/translations/es.js
+++ b/
client/src/translations/es.js
@@
-80,7
+80,9
@@
export const translations =
"Settings": "Configuraciones",
"Stop game": "Terminar la partida",
"Subject": "Asunto",
"Settings": "Configuraciones",
"Stop game": "Terminar la partida",
"Subject": "Asunto",
+ "Target is not connected": "El destinatario no está conectado",
"Terminate game?": "¿ Terminar la partida ?",
"Terminate game?": "¿ Terminar la partida ?",
+ "This tab is now offline": "Esta pestaña ahora está desconectada",
"Three repetitions": "Tres repeticiones",
"Time": "Tiempo",
"To": "A",
"Three repetitions": "Tres repeticiones",
"Time": "Tiempo",
"To": "A",
@@
-90,8
+92,6
@@
export const translations =
"Update": "Actualización",
"Variant": "Variante",
"Variants": "Variantes",
"Update": "Actualización",
"Variant": "Variante",
"Variants": "Variantes",
- "Warning: target is not connected": "Advertencia : el destinatario no está conectado",
- "Warning: multi-tabs not supported": "Advertencia : múltiples pestañas no soportado",
"White": "Blancas",
"White to move": "Juegan las blancas",
"White win": "Las blancas gagnan",
"White": "Blancas",
"White to move": "Juegan las blancas",
"White win": "Las blancas gagnan",
diff --git
a/client/src/translations/fr.js
b/client/src/translations/fr.js
index
ad92da5
..
26b1c83
100644
(file)
--- a/
client/src/translations/fr.js
+++ b/
client/src/translations/fr.js
@@
-80,7
+80,9
@@
export const translations =
"Settings": "Réglages",
"Stop game": "Arrêter la partie",
"Subject": "Sujet",
"Settings": "Réglages",
"Stop game": "Arrêter la partie",
"Subject": "Sujet",
+ "Target is not connected": "La cible n'est pas connectée",
"Terminate game?": "Stopper la partie ?",
"Terminate game?": "Stopper la partie ?",
+ "This tab is now offline": "Cet onglet est désormais hors ligne",
"Three repetitions": "Triple répétition",
"Time": "Temps",
"To": "À",
"Three repetitions": "Triple répétition",
"Time": "Temps",
"To": "À",
@@
-90,8
+92,6
@@
export const translations =
"Update": "Mise à jour",
"Variant": "Variante",
"Variants": "Variantes",
"Update": "Mise à jour",
"Variant": "Variante",
"Variants": "Variantes",
- "Warning: target is not connected": "Attention : la cible n'est pas connectée",
- "Warning: multi-tabs not supported": "Attention : mode multi-onglets non supporté",
"White": "Blancs",
"White to move": "Trait aux blancs",
"White win": "Les blancs gagnent",
"White": "Blancs",
"White to move": "Trait aux blancs",
"White win": "Les blancs gagnent",
diff --git
a/client/src/views/Game.vue
b/client/src/views/Game.vue
index
8f57153
..
022e3cb
100644
(file)
--- a/
client/src/views/Game.vue
+++ b/
client/src/views/Game.vue
@@
-167,7
+167,7
@@
export default {
case "duplicate":
this.st.conn.send(JSON.stringify({code:"duplicate",
page:"/game/" + this.game.id}));
case "duplicate":
this.st.conn.send(JSON.stringify({code:"duplicate",
page:"/game/" + this.game.id}));
- alert(this.st.tr["
Warning: multi-tabs not supported
"]);
+ alert(this.st.tr["
This tab is now offline
"]);
break;
// 0.2] Receive clients list (just socket IDs)
case "pollclients":
break;
// 0.2] Receive clients list (just socket IDs)
case "pollclients":
diff --git
a/client/src/views/Hall.vue
b/client/src/views/Hall.vue
index
b364568
..
2395f60
100644
(file)
--- a/
client/src/views/Hall.vue
+++ b/
client/src/views/Hall.vue
@@
-293,7
+293,7
@@
export default {
if (!targetSid)
{
if (!!warnDisconnected)
if (!targetSid)
{
if (!!warnDisconnected)
- alert(this.st.tr["
Warning: t
arget is not connected"]);
+ alert(this.st.tr["
T
arget is not connected"]);
return false;
}
}
return false;
}
}
@@
-309,7
+309,7
@@
export default {
case "duplicate":
this.st.conn.send(JSON.stringify({code:"duplicate", page:"/"}));
this.st.conn.send = () => {};
case "duplicate":
this.st.conn.send(JSON.stringify({code:"duplicate", page:"/"}));
this.st.conn.send = () => {};
- alert(this.st.tr["
Warning: multi-tabs not supported
"]);
+ alert(this.st.tr["
This tab is now offline
"]);
break;
// 0.2] Receive clients list (just socket IDs)
case "pollclients":
break;
// 0.2] Receive clients list (just socket IDs)
case "pollclients":
diff --git
a/server/sockets.js
b/server/sockets.js
index
45e003f
..
64b180d
100644
(file)
--- a/
server/sockets.js
+++ b/
server/sockets.js
@@
-17,6
+17,8
@@
module.exports = function(wss) {
let clients = {}; //associative array sid --> socket
wss.on("connection", (socket, req) => {
const query = getJsonFromUrl(req.url);
let clients = {}; //associative array sid --> socket
wss.on("connection", (socket, req) => {
const query = getJsonFromUrl(req.url);
+ if (query["page"] != "/" && query["page"].indexOf("/game/") < 0)
+ return; //other tabs don't need to be connected
const sid = query["sid"];
const notifyRoom = (page,code,obj={},excluded=[]) => {
Object.keys(clients).forEach(k => {
const sid = query["sid"];
const notifyRoom = (page,code,obj={},excluded=[]) => {
Object.keys(clients).forEach(k => {