Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix game crash from localization #45

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<html>
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="css/game.css">
</head>
Expand Down
32 changes: 26 additions & 6 deletions js/textStrings.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var textStrings_EN = {
"areTheyScared": "(ya gotta catch 'em *being* scared by a square)", // not used
"squaresSnubCircles": "SQUARES SNUB CIRCLES",
"areTheySnubbed": "(ya gotta catch 'em *while* snubbing a circle)", // not used
"everyoneHates": "EVERYONE HATES EVERYONE!!1!",
"everyoneHates": "EVERYONE HATES EVERYONE!!!!",
"almostEveryoneHates": "ALMOST EVERYONE HATES EVERYONE...",
"squaresHateCircles": "SQUARES HATE CIRCLES",
"circlesHateSquares": "CIRCLES HATE SQUARES",
Expand Down Expand Up @@ -129,7 +129,7 @@ var textStrings_DE = {
"areTheyScared": "(erwische sie, *wenn* sie fl\xFCchten)",
"squaresSnubCircles": "QUADRAT: Anschuldigungen von KREISEN l\xE4cherlich.",
"areTheySnubbed": "(erwische sie, *w\xE4hrend* sie angreifen)",
"everyoneHates": "ALLE HASSEN JEDEN!!1!",
"everyoneHates": "ALLE HASSEN JEDEN!!!!",
"almostEveryoneHates": "FAST JEDER HASST ALLE...",
"squaresHateCircles": "QUADRATE HASSEN KREISE",
"circlesHateSquares": "KREISE HASSEN QUADRATE",
Expand Down Expand Up @@ -336,7 +336,7 @@ var textStrings_PT = {
"areTheyScared": "pegue-os *sendo assustados* por um quadrado)", // not used
"squaresSnubCircles": "QUADR. ESNOBAM CÍRCULOS",
"areTheySnubbed": "(pegue *enquanto* esnobam um círculo)", // not used
"everyoneHates": "TODO MUNDO ODEIA TODO MUNDO!!1!",
"everyoneHates": "TODO MUNDO ODEIA TODO MUNDO!!!!",
"almostEveryoneHates": "QUASE TODO MUNDO ODEIA TODO MUNDO..",
"squaresHateCircles": "QUADRADOS ODEIAM CÍRCULOS",
"circlesHateSquares": "CÍRCULOS ODEIAM QUADRADOS",
Expand Down Expand Up @@ -438,7 +438,7 @@ var textStrings_PT_BR = { //I put that way because portuguese from Brazil (PT_BR
"areTheyScared": "(você tem que pegar eles *sendo* assustados por um quadrado)", // not used
"squaresSnubCircles": "QUADRADOS AFRONTAM CÍRCULOS",
"areTheySnubbed": "(você tem que pegá-los *enquanto* eles afrontam os círculos)", // not used
"everyoneHates": "TODO MUNDO ODEIA TODO MUNDO!!1!",
"everyoneHates": "TODO MUNDO ODEIA TODO MUNDO!!!!",
"almostEveryoneHates": "QUASE TODO MUNDO ODEIA TODO MUNDO...",
"squaresHateCircles": "QUADRADOS ODEIAM CÍRCULOS",
"circlesHateSquares": "CÍRCULOS ODEIAM QUADRADOS",
Expand Down Expand Up @@ -540,7 +540,7 @@ var textStrings_ES = {
"areTheyScared": "(tienes que atraparlos *siendo* asustados por un cuadrado)", // not used
"squaresSnubCircles": "CUADRADOS DESPRECIAN A CIRCULOS",
"areTheySnubbed": "(ya gotta catch 'em *while* snubbing a circle)", // not used
"everyoneHates": "TODOS SE ODIAN!!1!",
"everyoneHates": "TODOS SE ODIAN!!!!",
"almostEveryoneHates": "CASI TODOS SE ODIAN...",
"squaresHateCircles": "CUADRADOS ODIAN A CIRCULOS",
"circlesHateSquares": "CIRCLES HATE SQUARES",
Expand Down Expand Up @@ -617,4 +617,24 @@ var textStrings_ES = {

// (quote0004.png)
"misatrributed": "(misattributed)",
};
};

const textStrings = (() => {
switch (navigator.language) {
case "en-US":
return textStrings_EN;
case "da":
return textStrings_DA;
case "fa":
return textStrings_FA;
case "pt-pt":
return textStrings_PT;
case "pt-BR":
return textStrings_PT_BR;
case "es":
return textStrings_ES;
default:
return textStrings_EN;
}
}
)();