-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 🎸 Implement initial translation system
✅ Closes: #27
- Loading branch information
1 parent
fd9f5fb
commit 9299567
Showing
10 changed files
with
101 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import english from "../language/en.json"; | ||
import polish from "../language/pl.json"; | ||
|
||
const languageContext: any = { | ||
en: english, | ||
pl: polish, | ||
} | ||
|
||
export const setText = (text: string) => { | ||
const lang = window.localStorage.getItem('language') || 'en'; | ||
return languageContext[lang][text] || languageContext.en[text]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"title": "Goldrush", | ||
"mainMenu": "Main Menu", | ||
"startGame": "Start Game", | ||
"quitGame": "Quit Game", | ||
"bgTown": "Town background", | ||
"language": "Language", | ||
"player": "player", | ||
"fileCorrupted": "Save file corrupted.", | ||
"couldNotLoad": "Could not find game to load.", | ||
"couldNotSave": "Could not save the game." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"title": "GorÄ…czka ZÅ‚ota", | ||
"mainMenu": "Menu Główne", | ||
"startGame": "Zacznij grÄ™", | ||
"quitGame": "Wyjdź z gry", | ||
"bgTown": "TÅ‚o miasteczka", | ||
"language": "Język", | ||
"player": "Gracz", | ||
"fileCorrupted": "Plik zapisu uszkodzony.", | ||
"couldNotLoad": "Nie znaleziono pliku z zapisem gry.", | ||
"couldNotSave": "Nie można zapisać gry." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters