Skip to content

Commit

Permalink
Merge pull request #111 from fbarbe00/master
Browse files Browse the repository at this point in the history
Improve translations and formatting, add French translation
  • Loading branch information
alenros authored Aug 28, 2023
2 parents b7eaa7c + 785a331 commit e7e80c2
Show file tree
Hide file tree
Showing 16 changed files with 1,458 additions and 506 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

This player aid for A Fake Artist Goes to New York eliminates the need for a Question master and lets everyone participate.

This code powers https://fake-artist.herokuapp.com - where you can play the game.

It is based on [Evan Brumley's](https://github.com/evanbrumley) Spyfall game.

The original boardgame at BoardGameGeek: https://boardgamegeek.com/boardgame/135779/fake-artist-goes-new-york
Expand All @@ -32,6 +30,9 @@ Set the URL of your applciation:
And finally run the following in the directory you have clone the repository:
`meteor`

To choose a port for your application use the following:
`meteor --port 3000`

# Translation
The translation has two parts: the user interface and the words list.
The words lists are in the \lib\ directory. to add a new wordlist you should add it in main.js in the getRandomWordAndCategory();
Expand All @@ -49,4 +50,5 @@ Translators:
* [Johannes Fischer](https://github.com/JohannesFischer)
* [Raphael Alexio](https://github.com/raphaelaleixo)
* [Francesco T](https://www.boardgamegeek.com/user/omnigod)
* [Camilo Sampedro](https://github.com/camilosampedro)
* [Camilo Sampedro](https://github.com/camilosampedro)
* [Fabio Barbero](https://fabiobarbero.eu)
23 changes: 16 additions & 7 deletions client/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<link href="https://fonts.googleapis.com/css?family=Alef|Oswald|Open+Sans" rel="stylesheet" async media="none"
onload="if(media!='all')media='all'">

<!-- these CSS hrefs are wrong, and styles.css doesn't exist. Not sure what's going on here -->
<link rel="stylesheet" href="css/normalize.css" type="text/css" async media="none"
onload="if(media!='all')media='all'">
<link rel="stylesheet" href="css/skeleton.css" type="text/css" async media="none"
Expand Down Expand Up @@ -58,7 +59,7 @@ <h4>{{_ "ui.welcome to fake artist" }}</h4>
<button id="btn-join-game">{{_ "ui.join game" }}</button>
</div>
<div>
<a href="https://insider.herokuapp.com"><strong>{{_ "ui.try insider"}}</strong></a>
<a href="https://github.com/alenros/insider"><strong>{{_ "ui.try insider"}}</strong></a>
</div>
{{# if alternativeURL }}
<p class="high-load-message">The site is currently experiencing very heavy load. If things seem slow or broken, try
Expand Down Expand Up @@ -94,7 +95,7 @@ <h4>{{_ "ui.waiting for players" }}</h4>
<span class="access-button-separator"></span>

<a class="access-button btn-send-access-code-email"
href='mailto:?subject={{_ "ui.join my game" }}&body=https://fake-artist.herokuapp.com/{{ accessLink }}'>
href='mailto:?subject={{_ "ui.join my game" }}&body={{ accessLink }}'>
<img src="/icons/envelope-open.svg" class="icon" />
</a>
</div>
Expand All @@ -103,7 +104,7 @@ <h4>{{_ "ui.waiting for players" }}</h4>
<div id="qrcode" class="qrcode"></div>

<div id="access-link" class="access-link">
<a href="{{ accessLink }}">https://fake-artist.herokuapp.com/{{ accessLink }}</a>
<a href="{{ accessLink }}">{{ accessLink }}</a>
</div>
</div>
<hr>
Expand Down Expand Up @@ -173,18 +174,26 @@ <h4>{{_ "ui.variants"}}</h4>
</div>
</td>
</tr>
<tr>
<td colspan="2">
{{_ "ui.choose categories"}}
<a class="btn-toggle-category-select" href="javascript:void(0);">{{_ "ui.show hide" }}</a>
<div class="category-select form-group" style="display: none;">
{{#each categories}}
<input type="checkbox" id="{{ this }}" name="category-name" value="{{ this }}" checked>
<label for="{{ this }}" style="display: inline;">{{ this }}</label>
{{/each}}
</div>
</td>
</tr>
<tr>
<td>
{{_ "ui.let us choose"}}
</td>
<td>


<button class="btn-start">{{_ "ui.start game" }}</button>

</td>
</tr>

</table>

<div class="button-container">
Expand Down
34 changes: 28 additions & 6 deletions client/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ function getUserLanguage() {
if (language) {
return language;
} else {
// select browser language if supported
let browserLanguage = window.navigator.userLanguage || window.navigator.language;
let supportedLanguages = TAPi18n.getLanguages();
console.log("browserLanguage", browserLanguage);
if (supportedLanguages[browserLanguage]) {
return browserLanguage;
}
return "en";
}
};
Expand Down Expand Up @@ -182,6 +189,9 @@ function getWordsProvider() {
case "es":
words = words_es;
break;
case "fr":
words = words_fr;
break;
default:
words = words_en;
break;
Expand Down Expand Up @@ -212,8 +222,9 @@ function getWordsProvider() {
return filteredWords;
}

function getRandomWordAndCategory() {
let filteredWords = getWordsProvider();
function getRandomWordAndCategory(excludedCategories) {
// heh, this should be optimized better.
let filteredWords = getWordsProvider().filter(word => !excludedCategories.includes(word.category));
let wordIndex = Math.floor(Math.random() * filteredWords.length);

return filteredWords[wordIndex];
Expand Down Expand Up @@ -515,11 +526,17 @@ Template.lobby.helpers({
return getCurrentGame();
},
accessLink: function () {
return getAccessLink();
return Meteor.absoluteUrl() + getAccessLink();
},
player: function () {
return getCurrentPlayer();
},
categories: function () {
let words = getWordsProvider();
const uniqueCategories = [...new Set(words.map(word => word.category))];

return uniqueCategories;
},
players: function () {
let game = getCurrentGame();
let currentPlayer = getCurrentPlayer();
Expand All @@ -542,6 +559,9 @@ Template.lobby.helpers({

Template.lobby.events({
'click .btn-leave': leaveGame,
'click .btn-toggle-category-select': function () {
$(".category-select").toggle();
},
'click .btn-submit-user-word': function (event) {
let game = getCurrentGame();
let word = document.getElementById("user-word").value;
Expand Down Expand Up @@ -709,7 +729,9 @@ Template.lobby.events({
'click .btn-start': function () {

let game = getCurrentGame();
let wordAndCategory = getRandomWordAndCategory();
let excludedCategories = document.querySelectorAll('input[name="category-name"]:not(:checked)');
excludedCategories = Array.from(excludedCategories).map((category) => category.value);
let wordAndCategory = getRandomWordAndCategory(excludedCategories);

let currentPlayers = Array.from(Players.find({ gameID: game._id }));
let localEndTime = moment().add(game.lengthInMinutes, 'minutes');
Expand Down Expand Up @@ -849,7 +871,7 @@ Template.lobby.events({
});
},
'click #copyAccessLinkImg': function () {
const accessLink = `https://fake-artist.herokuapp.com/${getAccessLink()}`;
const accessLink = `${Meteor.absoluteUrl()}${getAccessLink()}`;

const textArea = document.createElement("textarea");
textArea.value = accessLink;
Expand Down Expand Up @@ -893,7 +915,7 @@ Template.lobby.events({

Template.lobby.rendered = function (event) {
let url = getAccessLink();
url = `https://fake-artist.herokuapp.com/${url}`;
url = `${Meteor.absoluteUrl()}${url}`;
const qrcodesvg = new Qrcodesvg(url, 'qrcode', 250);
qrcodesvg.draw();
};
Expand Down
62 changes: 32 additions & 30 deletions i18n/de.i18n.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"ui": {
"welcome to fake artist": "Ein falscher Künstler in New York",
"try insider":"Try the new Insider game",
"try insider": "Versuche das neue Insider-Spiel",
"new game": "Neues Spiel",
"join game": "Einem Spiel beitreten",
"join game": "Spiel beitreten",
"waiting for players": "Auf Spieler warten...",
"access code": "Zugangscode erhalten",
"join my game": "Tritt meinem Spiel bei!",
Expand All @@ -12,40 +12,42 @@
"show hide": "zeigen/verstecken",
"you are the fake artist": "Du bist der falsche Künstler!",
"you are not the fake artist": "Du bist <strong>nicht</strong> der falsche Künstler!",
"you are the question master": "Du bist der Fragenmeister!",
"question master indicator": "Fragenmeister",
"variants": "Variants",
"all fake artists tooltip": "This variant can be introduced to make the Fake-Artist doubt himself, or just for laughs!",
"play with the all fake-artists variant": "<strong>All Fake Artists:</strong> There's a 10% chance everyone is a Fake-Artist. If this happens your only chance to win is if every player votes for himself.",
"no fake-artist tooltip":"This variant is meant to aid the Fake-Artist, but the real artists might suspect the first person who suggests there's no Fake-Artist, even if he is right!",
"play with the no-fake-artist variant":"<strong>No Fake Artist:</strong> There's a 10% chance there is NO Fake-Artist. if this happens you can only win if all players vote for no one (raise your finger in the air).",
"you are the question master": "Du bist der Frage-Meister!",
"question master indicator": "Fragen-Meister",
"variants": "Varianten",
"all fake artists tooltip": "Diese Variante kann eingeführt werden, um den Fake-Künstler an sich zweifeln zu lassen, oder einfach nur zum Spaß!",
"play with the all fake-artists variant": "<strong>Alle Fake-Künstler:</strong> Es besteht eine 10%ige Chance, dass jeder ein Fake-Künstler ist. Wenn dies passiert, hast du nur eine Chance zu gewinnen, wenn jeder Spieler für sich selbst stimmt.",
"no fake-artist tooltip": "Diese Variante soll dem Fake-Künstler helfen, aber die echten Künstler könnten denjenigen verdächtigen, der als Erster vorschlägt, dass es keinen Fake-Künstler gibt, auch wenn er Recht hat!",
"play with the no-fake-artist variant": "<strong>Kein Fake-Künstler:</strong> Es besteht eine 10%ige Chance, dass es KEINEN Fake-Künstler gibt. Wenn dies passiert, kannst du nur gewinnen, wenn alle Spieler für niemanden stimmen (hebt euren Finger in die Luft).",
"play with the less first fake-artist variant": "<strong>Besserer Start:</strong> Es besteht nur eine geringe Chance, dass der Fake-Künstler zuerst gewählt wird.",
"less first fake-artist tooltip": "Diese Variante erleichtert es dem Fake-Künstler, sich einzufügen. Wenn der Fake-Künstler ausgewählt wird, um als Erster zu gehen, hat er eine 90%ige Chance, den Platz mit jemand anderem zu tauschen.",
"the word": "Das Wort",
"your category": "Die Kategorie",
"players": "Spieler",
"first": "1.",
"words reference": "Wort Referenz",
"first": "1<span>st</span>",
"words reference": "Wort-Referenz",
"end game": "Spiel beenden",
"enter your name": "Deinen Namen eingeben",
"create game": "Erstellen",
"back": "zurück",
"back": "Zurück",
"enter an access code": "Zugangscode eingeben",
"invalid access code": "Entschuldigung, es wurde kein Spiel mit diesem Zugangscode gefunden!",
"copy access link": "Kopieren Zugangscode",
"copied":"Kopiert",
"invalid access code": "Entschuldigung, es wurde kein Spiel mit dem eingegebenen Zugangscode gefunden!",
"copy access link": "Zugangscode kopieren",
"copied": "Kopiert",
"join": "Beitreten",
"footer": "Application based on the Spyfall meteor application.",
"credits": "Game published by ",
"Author": "Found a Bug? got a Suggestion? send me a PM on BGG: ",
"logo-file": "logo-en.png",
"locations-file":"locations_en",
"enter word":"Gib dein Wort ein",
"enter category":"Gib die Kategorie für dein Wort ein",
"submit user word":"Dieses Wort benutzen!",
"choose own word":"Benutze dein eigenes Wort!",
"let us choose":"Oder lass uns ein Wort für dich aussuchen!",
"bad category":"report category",
"bad word":"report word"
"footer": "Anwendung basierend auf der Spyfall Meteor-Anwendung.",
"credits": "Spiel veröffentlicht von ",
"Author": "Einen Fehler gefunden? Hast du einen Vorschlag? Schick mir eine PN auf BGG: ",
"logo-file": "logo-en.png",
"locations-file": "locations_en",
"enter word": "Gib dein Wort ein",
"enter category": "Gib die Kategorie für dein Wort ein",
"submit user word": "Dieses Wort verwenden!",
"choose own word": "Verwende dein eigenes Wort",
"let us choose": "Oder lass uns eins für dich auswählen",
"choose categories": "Wähle Kategorien: ",
"bad category": "Kategorie melden",
"bad word": "Wort melden",
"github link": "https://github.com/alenros/fake-artist"
}
}


}
33 changes: 17 additions & 16 deletions i18n/en.i18n.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"ui": {
"welcome to fake artist": "A Fake Artist Goes to New York",
"try insider":"Try the new Insider game",
"try insider": "Try the new Insider game",
"new game": "New Game",
"join game": "Join Game",
"waiting for players": "Waiting For Players...",
Expand All @@ -17,8 +17,8 @@
"variants": "Variants",
"all fake artists tooltip": "This variant can be introduced to make the Fake-Artist doubt himself, or just for laughs!",
"play with the all fake-artists variant": "<strong>All Fake Artists:</strong> There's a 10% chance everyone is a Fake-Artist. If this happens your only chance to win is if every player votes for himself.",
"no fake-artist tooltip":"This variant is meant to aid the Fake-Artist, but the real artists might suspect the first person who suggests there's no Fake-Artist, even if he is right!",
"play with the no-fake-artist variant":"<strong>No Fake Artist:</strong> There's a 10% chance there is NO Fake-Artist. if this happens you can only win if all players vote for no one (raise your finger in the air).",
"no fake-artist tooltip": "This variant is meant to aid the Fake-Artist, but the real artists might suspect the first person who suggests there's no Fake-Artist, even if he is right!",
"play with the no-fake-artist variant": "<strong>No Fake Artist:</strong> There's a 10% chance there is NO Fake-Artist. if this happens you can only win if all players vote for no one (raise your finger in the air).",
"play with the less first fake-artist variant": "<strong>Better Start:</strong> There's only a slim chance that the Fake-Artist is first.",
"less first fake-artist tooltip": "This variant makes it easier for the Fake-Artist to blend in. If the Fake-Artist is chosen to go first, he has a 90% chance to switch places with someone else.",
"the word": "The Word",
Expand All @@ -36,17 +36,18 @@
"copied": "Copied",
"join": "Join",
"footer": "Application based on the Spyfall meteor application: ",
"credits": "Game published by ",
"Author": "Found a Bug? got a Suggestion? send me a PM on BGG: ",
"logo-file": "logo-en.png",
"locations-file":"locations_en",
"enter word":"enter your word",
"enter category":"enter the category for the word",
"submit user word":"Use this word!",
"choose own word":"Use your own word",
"let us choose":"or let us choose it for you",
"bad category":"report category",
"bad word":"report word",
"github link": "https://github.com/alenros/fake-artist"
"credits": "Game published by ",
"Author": "Found a Bug? got a Suggestion? send me a PM on BGG: ",
"logo-file": "logo-en.png",
"locations-file": "locations_en",
"enter word": "enter your word",
"enter category": "enter the category for the word",
"submit user word": "Use this word!",
"choose own word": "Use your own word",
"let us choose": "or let us choose it for you",
"choose categories": "Select categories: ",
"bad category": "report category",
"bad word": "report word",
"github link": "https://github.com/alenros/fake-artist"
}
}
}
11 changes: 7 additions & 4 deletions i18n/es.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"ui": {
"welcome to fake artist": "El pintor impostor",
"try insider": "También puedes probar El infiltrado",
"new game": "Partida nueva",
"join game": "Partida existente",
"new game": "Nueva partida",
"join game": "Unirse a partida",
"waiting for players": "Esperando jugadores...",
"access code": "Código de acceso",
"join my game": "¡Súmate a mi partida de El pintor impostor!",
Expand All @@ -19,6 +19,8 @@
"play with the all fake-artists variant": "<strong>Todos somos pintores impostores:</strong> Hay un 10% de probabilidades de que todos seamos el pintor impostor. Si eso sucede, la única manera de ganar es si todos se votan a sí mismos.",
"no fake-artist tooltip": "Puedes usar esta variante para ayudar al pintor impostor, aunque probablemente los demás jugadores sospecharán de la primera persona que sugiera que no hay pintor impostor, incluso si es verdad.",
"play with the no-fake-artist variant": "<strong>Nadie es el pintor impostor:</strong> Hay un 10% de probabilidades de que no haya ningún pintor impostor. Si eso sucede, la única manera de ganar es si ningún jugador vota a nadie (es decir, todos deben señalar al aire al momento de la votación).",
"play with the less first fake-artist variant": "<strong>Mejor Comienzo:</strong> Solo hay una pequeña probabilidad de que el Pintor Impostor sea el primero.",
"less first fake-artist tooltip": "Esta variante facilita que el Pintor Impostor se integre. Si se elige que el Pintor Impostor vaya primero, tiene un 90% de probabilidad de intercambiar lugares con otra persona.",
"the word": "Palabra",
"your category": "Categoría",
"players": "Jugadores",
Expand All @@ -33,17 +35,18 @@
"copy access link": "Copiar enlace",
"copied": "Copiado",
"join": "Unirse",
"footer": "Basado en la app de \"Spyfall\" de meteor: ",
"footer": "Basado en la aplicación meteor de \"Spyfall\": ",
"credits": "Juego original publicado por ",
"Author": "¿Problemas? ¿Sugerencias? Envíame un mensaje en BoardGameGeek: ",
"translation credits": "Translated by: <a href='https://github.com/camilosampedro'>camilosampedro</a>.",
"translation credits": "Translated by: <a href='https://github.com/camilosampedro'>camilosampedro</a> y <a href='https://fabiobarbero.eu'>fabiobarbero.eu</a>",
"logo-file": "logo-es.png",
"locations-file": "locations_es",
"enter word": "Escribe tu palabra",
"enter category": "Escribe la categoría de tu palabra",
"submit user word": "¡Quiero usar esta palabra!",
"choose own word": "Usa tu propia palabra",
"let us choose": "o elegiremos una palabra al azar.",
"choose categories": "Selecciona categorías: ",
"bad category": "Denunciar categoría.",
"bad word": "Denunciar palabra."
}
Expand Down
Loading

1 comment on commit e7e80c2

@vercel
Copy link

@vercel vercel bot commented on e7e80c2 Aug 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

fake-artist – ./

fake-artist-git-master-alenros.vercel.app
fake-artist-nine.vercel.app
fake-artist-alenros.vercel.app

Please sign in to comment.