translations.js 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. locale = { en: {}, tr: {} };
  2. // Buttons and Interface
  3. locale.tr.Score = "Puan";
  4. locale.tr.Online = "Oynayanlar";
  5. locale.tr.Games = "Oyunlar";
  6. locale.tr.Reveals = "Bitirdi";
  7. locale.tr.Rules = "Kurallar";
  8. locale.tr.Quota = "Kota";
  9. locale.tr.Kakush = "Kakuş";
  10. locale.tr.Login = "İle bağlan";
  11. locale.tr.Statistics = "İstatistikler";
  12. // Chats
  13. locale.en.EditMessage = "Write some text here";
  14. locale.tr.EditMessage = "Chat için buraya yazabilirsiniz";
  15. locale.en.GameChat = "This is In-Game chat";
  16. locale.tr.GameChat = "Oyun içi sohbet";
  17. locale.en.PrivateChat = " is waiting for chat with you";
  18. locale.tr.PrivateChat = " seninle sohbet için bekliyor";
  19. // Messages
  20. locale.tr.Paused = "ara istiyor";
  21. locale.en.Paused = "paused";
  22. locale.tr.Revealed = "bitirdi";
  23. locale.en.Revealed = "revealed";
  24. locale.en.WrongReveal = "Wrong Reveal. Try next time.";
  25. locale.tr.WrongReveal = "Bu el yanlış. Bitirde gel";
  26. // Rules Dialog
  27. locale.en.FakeJoker = "Fake Joker";
  28. locale.tr.FakeJoker = "Sahte okey";
  29. locale.tr.WinningDeck = "Açan el";
  30. locale.en.WinningDeck = "Winning Deck";
  31. locale.tr.OkeyRules = "Oyun kuralları";
  32. locale.en.OkeyRules = "Okey Rules";
  33. locale.tr.Run = "Sıralı";
  34. locale.tr.Set = "Asker";
  35. locale.tr.Pair = "Çift";
  36. // Protocol
  37. locale.tr.player_left = "Oyundan kaçış";
  38. locale.tr.okey_revealed = "Açtığı el";
  39. locale.tr.okey_round_ended = "Tamamladığı oyun";
  40. locale.tr.okey_turn_timeout = "Zamanında oynamama";
  41. locale.tr.wrong_reveal = "Yanlış açma";
  42. locale.tr.okey_game_started = "Oynadığı oyun";
  43. function i18n(word)
  44. {
  45. var translation = locale[currentLanguage()][word];
  46. return (translation == null) ? word : translation;
  47. }
  48. function currentLanguage()
  49. {
  50. var currentLocale = localStorage.getItem("locale");
  51. return currentLocale == null ? "en" : currentLocale;
  52. }
  53. function switchLanguage()
  54. {
  55. if (localStorage.getItem("locale") == "tr")
  56. {
  57. $("#Flag-tr").hide();
  58. $("#Flag-en").show();
  59. localStorage.setItem("locale","en");
  60. } else {
  61. $("#Flag-en").hide();
  62. $("#Flag-tr").show();
  63. localStorage.setItem("locale","tr");
  64. }
  65. }
  66. function translateScene(e)
  67. {
  68. if (document.getElementById("Okey-Rules") != null) {
  69. $("#Okey-Rules-Text")[0].lastElementChild.textContent = i18n("OkeyRules");
  70. $("#Pair")[0].lastElementChild.textContent = i18n("Pair");
  71. $("#Set")[0].lastElementChild.textContent = i18n("Set");
  72. $("#Fake-Joker")[0].lastElementChild.textContent = i18n("FakeJoker");
  73. $("#Run")[0].lastElementChild.textContent = i18n("Run");
  74. $("#Winning-Deck")[0].lastElementChild.textContent = i18n("WinningDeck");
  75. if (currentLanguage() == "en") { $("#Turkish-Rules").hide(); $("#English-Rules").show(); }
  76. else { $("#Turkish-Rules").show(); $("#English-Rules").hide(); }
  77. }
  78. if (document.getElementById("Player-Statistics") != null) {
  79. $("#Games-Text")[0].lastElementChild.textContent = i18n("Games");
  80. $("#Reveals-Text")[0].lastElementChild.textContent = i18n("Reveals");
  81. if (currentLanguage() == "en") { $("#Turkish-StatNotes").hide(); $("#English-StatNotes").show(); }
  82. else { $("#Turkish-StatNotes").show(); $("#English-StatNotes").hide(); }
  83. }
  84. try {
  85. document.getElementById("GameChatEditor").firstElementChild.textContent = i18n("EditMessage");
  86. document.getElementById("OnlineChatEditor").firstElementChild.textContent = i18n("EditMessage");
  87. } catch (e) { console.log("Please add foreignObjects to schene from SVG.txt"); }
  88. $("#Users-Online-Message")[0].firstElementChild.textContent = i18n("Online");
  89. $("#Point-Table").find("text")[0].lastElementChild.textContent = i18n("Statistics");
  90. $("#Rules").find("text")[0].lastElementChild.textContent = i18n("Rules");
  91. $("#Kakush")[0].lastElementChild.textContent = i18n("Kakush") + ": " + 0;
  92. $("#Gabrielo-Discard-Shape").hide();
  93. $("#Center-Card-Selection").hide();
  94. $("#You-Discard-Shape").hide();
  95. $('#Facebook-Login').on('click',function(x) { fb_login(); });
  96. $('#Facebook-Login').attr({cursor:'pointer'});
  97. $('#Login-Text')[0].style.cursor = 'pointer';
  98. // $("#Login-Text")[0].lastElementChild.textContent = i18n("Login");
  99. $("#Login-Text").text(i18n("Login")).attr({x:16,y:23});
  100. // $("#Okey").hide();
  101. $("#Okey").on("click", sendSawOkey);
  102. // $("#Have-8-Tashes").hide();
  103. }