From a3f4616e606e6b7677c35e4ce8ce82ae5e3cc906 Mon Sep 17 00:00:00 2001 From: Lawin0129 Date: Thu, 25 Nov 2021 18:17:54 +0000 Subject: [PATCH] Add translations --- index.js | 54 +++++++--- responses/contentpages.json | 210 +++++++++++++++++++++++++++++++++--- 2 files changed, 237 insertions(+), 27 deletions(-) diff --git a/index.js b/index.js index e5d2251..818da87 100644 --- a/index.js +++ b/index.js @@ -10,7 +10,6 @@ const friendslist = require("./responses/friendslist.json"); const friendslist2 = require("./responses/friendslist2.json"); const Keychain = require("./responses/keychain.json"); const catalog = getItemShop(); -const contentpages = require("./responses/contentpages.json"); express.use(function(req, res, next) { // Getting the raw body of a request for client saving if (req.originalUrl.includes('/fortnite/api/cloudstorage/user/')) { @@ -1149,7 +1148,7 @@ express.get("/fortnite/api/calendar/v1/timeline", async (req, res) => { }, "eventsTimeOffsetHrs": 0, "cacheIntervalMins": 10, - "currentTime": "2020-01-01T18:13:41.770Z" + "currentTime": new Date().toISOString() }); res.status(200); res.end(); @@ -1164,17 +1163,7 @@ express.get("/friends/api/public/blocklist/*", async (req, res) => { }) express.get("/content/api/pages/fortnite-game", async (req, res) => { - const seasonchecker = require("./seasonchecker.js"); - const seasondata = require("./season.json"); - seasonchecker(req, seasondata); - - contentpages.dynamicbackgrounds.backgrounds.backgrounds[0].stage = `season${seasondata.season}`; - contentpages.dynamicbackgrounds.backgrounds.backgrounds[1].stage = `season${seasondata.season}`; - - if (seasondata.season == 10) { - contentpages.dynamicbackgrounds.backgrounds.backgrounds[0].stage = "seasonx"; - contentpages.dynamicbackgrounds.backgrounds.backgrounds[1].stage = "seasonx"; - } + const contentpages = getContentPages(req); res.json(contentpages) res.status(200); @@ -5402,6 +5391,45 @@ function getItemShop() { return catalog; } +function getContentPages(req) { + const seasonchecker = require("./seasonchecker.js"); + const seasondata = require("./season.json"); + seasonchecker(req, seasondata); + + const contentpages = JSON.parse(JSON.stringify(require("./responses/contentpages.json"))); + + var Language = "en"; + + if (req.headers["accept-language"]) { + if (req.headers["accept-language"].includes("-") && !req.headers["accept-language"].startsWith("es-4")) { + Language = req.headers["accept-language"].split("-")[0]; + } else { + Language = req.headers["accept-language"]; + } + } + + const modes = ["saveTheWorldUnowned", "battleRoyale", "creative", "saveTheWorld"]; + + try { + modes.forEach(mode => { + contentpages.subgameselectdata[mode].message.title = contentpages.subgameselectdata[mode].message.title[Language] + contentpages.subgameselectdata[mode].message.body = contentpages.subgameselectdata[mode].message.body[Language] + }) + } catch (err) {} + + try { + contentpages.dynamicbackgrounds.backgrounds.backgrounds[0].stage = `season${seasondata.season}`; + contentpages.dynamicbackgrounds.backgrounds.backgrounds[1].stage = `season${seasondata.season}`; + + if (seasondata.season == 10) { + contentpages.dynamicbackgrounds.backgrounds.backgrounds[0].stage = "seasonx"; + contentpages.dynamicbackgrounds.backgrounds.backgrounds[1].stage = "seasonx"; + } + } catch (err) {} + + return contentpages; +} + function makeid() { let CurrentDate = (new Date()).valueOf().toString(); let RandomFloat = Math.random().toString(); diff --git a/responses/contentpages.json b/responses/contentpages.json index 33a8023..a320e3d 100644 --- a/responses/contentpages.json +++ b/responses/contentpages.json @@ -54,8 +54,34 @@ "hidden": false, "messagetype": "normal", "_type": "CommonUI Simple Message Base", - "title": "Co-op PvE", - "body": "Cooperative PvE storm-fighting adventure!", + "title": { + "de": "Koop-PvE", + "ru": "Сюжетная PvE-кампания", + "ko": "팀과 함께 플레이하는 PvE", + "en": "Co-op PvE", + "it": "PvE co-op", + "fr": "JcE coopératif", + "es": "JcE cooperativo", + "ar": "Co-op PvE", + "ja": "協力PvE", + "pl": "Kooperacyjny tryb PvE", + "es-419": "JcE cooperativo", + "tr": "Oyuncularla Birlikte PvE" + }, + "body": { + "de": "PVE-Modus, in dem du den Sturm kooperativ bekämpfst!", + "ru": "Совместное сражение с Бурей!", + "ko": "배틀로얄을 플레이하려면 상단의 \"배틀로얄\" 버튼을 클릭하세요.\n\n팀과 함께하는 PvE 모드, 폭풍과 싸우는 어드벤처!", + "en": "Cooperative PvE storm-fighting adventure!", + "it": "Avventura tempestosa cooperativa PvE!", + "fr": "Une aventure en JcE coopératif pour combattre la tempête !", + "es": "¡Aventura cooperativa JcE de lucha contra la tormenta!", + "ar": "Cooperative PvE storm-fighting adventure!", + "ja": "PvE協力プレイでストームに立ち向かえ!", + "pl": "Kooperacyjne zmagania PvE z burzą i pustakami!", + "es-419": "¡Aventura de lucha contra la tormenta en un JcE cooperativo!", + "tr": "Diğer oyuncularla birlikte PvE fırtınayla savaşma macerası!" + }, "spotlight": false } }, @@ -67,8 +93,34 @@ "hidden": false, "messagetype": "normal", "_type": "CommonUI Simple Message Base", - "title": "100 Player PvP", - "body": "100 Player PvP Battle Royale.\n\nPvE progress does not affect Battle Royale.", + "title": { + "de": "100-Spieler-PvP", + "ru": "PvP-режим на 100 игроков", + "ko": "100명의 플레이어와 함께하는 PvP", + "en": "100 Player PvP", + "it": "PvP a 100 giocatori", + "fr": "JcJ à 100 joueurs", + "es": "JcJ de 100 jugadores", + "ar": "100 Player PvP", + "ja": "100人参加のPvP", + "pl": "PvP dla 100 graczy", + "es-419": "JcJ de 100 jugadores", + "tr": "100 Oyunculu PvP" + }, + "body": { + "de": "Battle Royale, 100-Spieler-PvP.\n\nFortschritte im PvE haben keinen Einfluss auf Battle Royale.", + "ru": "PvP-режим на 100 игроков «Королевская битва».\n\nПрогресс в кампании не затрагивает «Королевскую битву».", + "ko": "100명의 플레이어와 함께하는 PvP 모드, 배틀로얄.\n\nPvE 모드의 진행 상황은 배틀로얄 플레이에 영향을 주지 않습니다.", + "en": "100 Player PvP Battle Royale.\n\nPvE progress does not affect Battle Royale.", + "it": "Battaglia reale PvP a 100 giocatori.\n\nI progressi in PvE non sono trasferiti nella Battaglia reale.", + "fr": "Un Battle Royale à 100 en JcJ.\n\nLa progression du mode JcE n'affecte pas Battle Royale.", + "es": "Battle Royale JcJ de 100 jugadores.\n\nEl progreso JcE no afecta a Battle Royale.", + "ar": "100 Player PvP Battle Royale.\n\nPvE progress does not affect Battle Royale.", + "ja": "100人参加のPvPバトルロイヤル。\n\nPvEモードの進行状況はバトルロイヤルに影響しません。", + "pl": "Battle Royale: PvP dla 100 graczy\n\nPostępy w kampanii nie wpływają na grę w Battle Royale.", + "es-419": "Batalla campal JcJ de 100 jugadores.\n\nEl progreso de JcE no afecta Batalla campal.", + "tr": "100 Oyunculu PvP Battle Royale. PvE ilerlemesi Battle Royale'i etkilemez." + }, "spotlight": false } }, @@ -79,8 +131,34 @@ "hidden": false, "messagetype": "normal", "_type": "CommonUI Simple Message Base", - "title": "New Featured Islands!", - "body": "Your Island. Your Friends. Your Rules.\n\nDiscover new ways to play Fortnite, play community made games with friends and build your dream island.", + "title": { + "de": "Neue vorgestellte Inseln!", + "ru": "Новые рекомендованные острова!", + "ko": "새로운 추천 섬!", + "en": "New Featured Islands!", + "it": "Nuove isole in evidenza!", + "fr": "Nouvelles îles à la Une !", + "es": "¡Nuevas islas destacadas!", + "ar": "New Featured Islands!", + "ja": "新しいおすすめの島!", + "pl": "Nowe wyróżnione wyspy!", + "es-419": "¡Nuevas islas destacadas!", + "tr": "Yeni Öne Çıkan Adalar!" + }, + "body": { + "de": "Deine Insel. Deine Freunde. Deine Regeln. \n\nEntdecke neue Arten, Fortnite zu spielen. Zocke von der Community erstellte Spiele mit Freunden und erschaffe deine Trauminsel.", + "ru": "Ваш остров. Ваши друзья. Ваши правила. \n\nПробуйте новые развлечения в Fortnite: играйте с друзьями в игры, созданные участниками сообщества, и стройте что угодно на собственном острове.", + "ko": "내가 만든 게임, 내가 세운 규칙, 이제 나만의 섬에서 즐긴다! \n포트나이트 게임을 완전히 새로운 방식으로 플레이해 보세요. 커뮤니티가 만든 게임을 친구들과 플레이해 보고, 여러분의 꿈의 섬을 만들어보세요.", + "en": "Your Island. Your Friends. Your Rules.\n\nDiscover new ways to play Fortnite, play community made games with friends and build your dream island.", + "it": "La tua isola. I tuoi amici. Le tue regole. \n\nScopri nuovi modi per giocare a Fortnite, divertiti insieme ai tuoi amici con i giochi creati dalla community e costruisci la tua isola da sogno.", + "fr": "Votre île. Vos amis. Vos règles.\n\nJouez à Fortnite autrement, éclatez-vous entre amis dans les jeux créés par la communauté et construisez l'île de vos rêves.", + "es": "Vuestra isla. Vuestros amigos. Vuestras reglas. \n\nDescubre nuevas formas de jugar a Fortnite, participa con tus amigos en juegos diseñados por la comunidad y construye la isla de tus sueños.", + "ar": "Your Island. Your Friends. Your Rules.\n\nDiscover new ways to play Fortnite, play community made games with friends and build your dream island.", + "ja": "コミュニティによって作られた島で遊んだり、夢に描いた自分に島を創り、フォートナイトの新しい楽しみ方を発掘しよう。", + "pl": "Twoja wyspa. Twoi znajomi. Twoje zasady. \n\nPoznajcie nowe sposoby na zabawę w Fortnite, zagrajcie ze znajomymi w gry stworzone przez innych graczy i zbudujcie wyspę swoich marzeń.", + "es-419": "Tu isla. Tus amigos. Tus reglas. \n\nDescubre nuevas maneras de jugar Fortnite: juega con tus amigos a juegos diseñados por la comunidad y construye la isla de tus sueños.", + "tr": "Fortnite’ı oynamanın yepyeni yollarını keşfet, topluluğun yaptığı oyunlarda arkadaşlarınla eğlen ve hayalindeki adayı inşa et." + }, "spotlight": false } }, @@ -91,8 +169,34 @@ "hidden": false, "messagetype": "normal", "_type": "CommonUI Simple Message Base", - "title": "Co-op PvE", - "body": "Cooperative PvE storm-fighting adventure!", + "title": { + "de": "Koop-PvE", + "ru": "Сюжетная PvE-кампания", + "ko": "팀과 함께 플레이하는 PvE", + "en": "Co-op PvE", + "it": "PvE co-op", + "fr": "JcE coopératif", + "es": "JcE cooperativo", + "ar": "Co-op PvE", + "ja": "協力PvE", + "pl": "Kooperacyjny tryb PvE", + "es-419": "JcE cooperativo", + "tr": "Oyuncularla Birlikte PvE" + }, + "body": { + "de": "PVE-Modus, in dem du den Sturm kooperativ bekämpfst!", + "ru": "Совместное сражение с Бурей!", + "ko": "배틀로얄을 플레이하려면 상단의 \"배틀로얄\" 버튼을 클릭하세요.\n\n팀과 함께하는 PvE 모드, 폭풍과 싸우는 어드벤처!", + "en": "Cooperative PvE storm-fighting adventure!", + "it": "Avventura tempestosa cooperativa PvE!", + "fr": "Une aventure en JcE coopératif pour combattre la tempête !", + "es": "¡Aventura cooperativa JcE de lucha contra la tormenta!", + "ar": "Cooperative PvE storm-fighting adventure!", + "ja": "PvE協力プレイでストームに立ち向かえ!", + "pl": "Kooperacyjne zmagania PvE z burzą i pustakami!", + "es-419": "¡Aventura de lucha contra la tormenta en un JcE cooperativo!", + "tr": "Diğer oyuncularla birlikte PvE fırtınayla savaşma macerası!" + }, "spotlight": false } }, @@ -5708,10 +5812,36 @@ "image": "", "color": "1164c1", "_type": "Subgame Info", - "description": "100 Player PvP", + "description": { + "de": "100 Spieler PvP", + "ru": "PVP-режим на 100 игроков", + "ko": "100인 플레이어 PvP", + "en": "100 Player PvP", + "it": "PvP a 100 giocatori", + "fr": "JcJ à 100 joueurs", + "es": "JcJ de 100 jugadores", + "ar": "100 لاعب ضد لاعب", + "ja": "プレイヤー100人によるPvP", + "pl": "PvP dla 100 graczy", + "es-419": "JcJ de 100 jugadores", + "tr": "100 Oyunculu PVP" + }, "subgame": "battleroyale", "standardMessageLine2": "", - "title": "Battle Royale", + "title": { + "de": "Battle Royale", + "ru": "Battle Royale", + "ko": "Battle Royale", + "en": "Battle Royale", + "it": "Battaglia reale", + "fr": "Battle Royale", + "es": "Battle Royale", + "ar": "Battle Royale", + "ja": "Battle Royale", + "pl": "Battle Royale", + "es-419": "Batalla campal", + "tr": "Battle Royale" + }, "standardMessageLine1": "" }, "savetheworld": { @@ -5719,9 +5849,35 @@ "color": "7615E9FF", "specialMessage": "", "_type": "Subgame Info", - "description": "Cooperative PvE Adventure", + "description": { + "de": "Kooperatives PvE-Abenteuer!", + "ru": "Совместное сражение с Бурей!", + "ko": "협동 PvE 어드벤처!", + "en": "Cooperative PvE Adventure", + "it": "Avventura cooperativa PvE!", + "fr": "Aventure en JcE coopératif !", + "es": "¡Aventura cooperativa JcE!", + "ar": "مشروع تعاوني للاعب ضد البيئة!", + "ja": "協力プレイが楽しめるPvE!", + "pl": "Kooperacyjne zmagania PvE z pustakami!", + "es-419": "¡Aventura de JcE cooperativa!", + "tr": "Diğer oyuncularla birlikte PvE macerası!" + }, "subgame": "savetheworld", - "title": "Server created by Lawin" + "title": { + "de": "Rette die Welt", + "ru": "Сражениес Бурей", + "ko": "세이브 더 월드", + "en": "Save The World", + "it": "Salva il mondo", + "fr": "Sauver le monde", + "es": "Salvar elmundo", + "ar": "Save The World", + "ja": "世界を救え", + "pl": "Ratowanie Świata", + "es-419": "Salva el mundo", + "tr": "Dünyayı Kurtar" + } }, "_title": "SubgameInfo", "_noIndex": false, @@ -5729,9 +5885,35 @@ "image": "", "color": "13BDA1FF", "_type": "Subgame Info", - "description": "Your Islands. Your Friends. Your Rules.", + "description": { + "de": "Deine Inseln. Deine Freunde. Deine Regeln.", + "ru": "Ваши острова. Ваши друзья. Ваши правила.", + "ko": "나의 섬. 나의 친구. 나의 규칙.", + "en": "Your Islands. Your Friends. Your Rules.", + "it": "Le tue isole. I tuoi amici. Le tue regole.", + "fr": "Vos îles, vos amis, vos règles.", + "es": "Tus islas. Tus amigos. Tus reglas.", + "ar": "جزرك. أصدقاؤك. قواعدك.", + "ja": "自分の島。自分のフレンド。自分のルール。", + "pl": "Twoje wyspa, twoi znajomi, twoje zasady.", + "es-419": "Tus islas. Tus amigos. Tus reglas.", + "tr": "Senin Adaların. Senin Dostların. Senin Kuralların." + }, "subgame": "creative", - "title": "Creative", + "title": { + "de": "Kreativmodus", + "ru": "Творческийрежим", + "ko": "포크리", + "en": "Creative", + "it": "Modalità creativa", + "fr": "Mode Créatif", + "es": "Modo Creativo", + "ar": "Creative", + "ja": "クリエイティブ", + "pl": "Tryb kreatywny", + "es-419": "Modo Creativo", + "tr": "Kreatif" + }, "standardMessageLine1": "" }, "_activeDate": "2019-05-02T16:48:47.429Z",