From c5067c850b943f21cd1a75ca20c728395a7b8b75 Mon Sep 17 00:00:00 2001 From: Steve Seguin Date: Mon, 11 May 2020 21:35:18 -0400 Subject: [PATCH] Add files via upload Automatically applies a really bad (sorry) Russian translation to the site --- main.js | 53 +++++++++++++++++++++++++++++++------------- translations/en.json | 42 +++++++++++++++++++++++++++++++++++ translations/fr.json | 42 +++++++++++++++++++++++++++++++++++ translations/ru.json | 42 +++++++++++++++++++++++++++++++++++ 4 files changed, 163 insertions(+), 16 deletions(-) create mode 100644 translations/en.json create mode 100644 translations/fr.json create mode 100644 translations/ru.json diff --git a/main.js b/main.js index 3489a40..fec18ce 100644 --- a/main.js +++ b/main.js @@ -105,29 +105,50 @@ if (urlParams.has('codec')){ session.codec = urlParams.get('codec'); } -if (urlParams.has('ln')){ +if (urlParams.has('ln')){ // checking if manual lanuage override enabled try { - fetch("./translations/"+urlParams.get('ln')+'.json').then(function(response){ - if (response.status !== 200) { - console.log('Looks like there was a problem. Status Code: ' + - response.status); - return; - } - response.json().then(function(data) { - log(data); - document.querySelectorAll('[data-translate]').forEach(function(ele){ - //log(ele.dataset.translate); - //log(translations[ele.dataset.translate]); - ele.innerHTML = data[ele.dataset.translate]; + fetch("./translations/"+urlParams.get('ln')+'.json').then(function(response){ + if (response.status !== 200) { + console.log('Looks like there was a problem. Status Code: ' + + response.status); + return; + } + response.json().then(function(data) { + log(data); + document.querySelectorAll('[data-translate]').forEach(function(ele){ + //log(ele.dataset.translate); + //log(translations[ele.dataset.translate]); + ele.innerHTML = data[ele.dataset.translate]; + }); }); + }).catch(function(err){ + errorlog(err); }); - }).catch(function(err){ - errorlog(err); - }); } catch (error){ errorlog(error); } +} else { // check if automatic language translation is available + + if (window.navigator.language.slice(0, 2) !== 'en'){ + fetch("./translations/"+window.navigator.language.slice(0, 2)+'.json').then(function(response){ + if (response.status !== 200) { + logerror('Language translation file not found.' + response.status); + return; + } + response.json().then(function(data) { + log(data); + document.querySelectorAll('[data-translate]').forEach(function(ele){ + //log(ele.dataset.translate); + //log(translations[ele.dataset.translate]); + ele.innerHTML = data[ele.dataset.translate]; + }); + }); + }).catch(function(err){ + errorlog(err); + }); + } + } if (urlParams.has('bitrate')){ diff --git a/translations/en.json b/translations/en.json new file mode 100644 index 0000000..390b6f8 --- /dev/null +++ b/translations/en.json @@ -0,0 +1,42 @@ +{ + "GO": "GO", + "add-group-chat": "Add Group Chat to OBS", + "add-to-group": "Add to Group Scene", + "add-your-camera": "Add your Camera to OBS", + "added-notes": "\n\t\t\t\tAdded Notes:\n\t\t\t\t
  • Anyone can enter a room if they know the name, so keep it unique
  • \n\t\t\t\t
  • Having more than four (4) people in a room is not advisable due to performance reasons, but it depends on your hardware.
  • \n\t\t\t\t
  • iOS devices are limited to group sizes of no more than two (2) people. This is a hardware limitation.
  • \n\t\t\t\t
  • The \"Recording\" option is new and is considered experimental.
  • \n\t\t\t\t
  • You must \"Add\" a video feed to the \"Group Scene\" for it to appear there.
  • \n\t\t\t\t
  • There is a new \"enhanced fullscreen\" button added to the Guest's view.
  • \n\t\t\t\t", + "advanced-paramaters": "Advanced Parameters", + "audio-sources": "Audio Sources", + "back": "Back", + "balanced": "Balanced", + "copy-this-url": "Copy this URL into an OBS \"Browser Source\"", + "copy-to-clipboard": "Copy to Clipboard", + "create-reusable-invite": "Create Reusable Invite", + "enable-stereo-and-pro": "Enable Stereo and Pro HD Audio", + "enter-the-rooms-control": "Enter the Room's Control Center", + "force-vp9-video-codec": "Force VP9 Video Codec (less artifacting)", + "generate-invite-link": "GENERATE THE INVITE LINK", + "here-you-can-pre-generate": "Here you can pre-generate a reusable Browser Source link and a related guest invite link.", + "high-security-mode": "High Security Mode", + "info-blob": "\n\t\t\t\t\t\t

    What is OBS.Ninja


    \n\t\t\t\t\t\t
  • 100% free; no downloads; no personal data collection; no sign-in
  • \n\t\t\t\t\t\t
  • Bring video from your smartphone, laptop, computer, or from your friends directly into your OBS video stream
  • \n\t\t\t\t\t\t
  • We use cutting edge Peer-to-Peer forwarding technology that offers privacy and ultra-low latency
  • \n\t\t\t\t\t\t
    \n\t\t\t\t\t\t
  • Youtube video Demoing it here
  • \n\t\t\t\t\t\t
  • Code is available here: https://github.com/steveseguin/obsninja
  • \n\t\t\t\t\t\t
  • You can also check out my other video app designed for sharing video with friends and family
  • \n\t\t\t\t\t\t
    \n\t\t\t\t\t\tKnown issues:
    \n\n\t\t\t\t\t\t
  • MacOS users need to use OBS v23 or resort to Window Capturing a Chrome Browser with OBS v25
  • \n\t\t\t\t\t\t
  • Some users will have \"pixelation\" problems with videos. Please add the URL parameter &codec=vp9 to the OBS Links to correct it.
  • \n\t\t\t\t\t\t
    \n\t\t\t\t\t\t\n\t\t\t\t\t\tSite last updated: May 7th, 2020. The previous version can be found at https://obs.ninja/v3/ if you are having new issues.\n\n\t\t\t\t\t\t

    \n\t\t\t\t\t\t

    Check out the sub-reddit for help and advanced info. I'm also on Discord and you can email me at steve@seguin.email

    \n\t\t\t\t\t", + "joining-room": "You are joining room", + "logo-header": "OBS.Ninja ", + "max-resolution": "Max Resolution", + "mute": "Mute", + "no-audio": "No Audio", + "note-share-audio": "\n\t\t\t\t\tnote: Do not forget to click \"Share audio\" in Chrome.
    (Firefox does not support audio sharing.)", + "open-in-new-tab": "Open in new Tab", + "record": "Record", + "remote-control-for-obs": "Remote Control for OBS", + "remote-screenshare-obs": "Remote Screenshare into OBS", + "room-name": "Room Name", + "rooms-allow-for": "Rooms allow for simplified group-chat and the advanced management of multiple streams at once.", + "select-audio-source": "Select Audio Sources", + "select-audio-video": "Select the audio/video source below", + "select-screen-to-share": "SELECT SCREEN TO SHARE", + "show-tips": "Show me some tips..", + "smooth-cool": "Smooth and Cool", + "unlock-video-bitrate": "Unlock Video Bitrate (20mbps)", + "video-source": "Video source", + "volume": "Volume", + "you-are-in-the-control-center": "You are in the room's control center" +} diff --git a/translations/fr.json b/translations/fr.json new file mode 100644 index 0000000..18f038a --- /dev/null +++ b/translations/fr.json @@ -0,0 +1,42 @@ +{ + "logo-header": "OBS.Ninja ", + "GO": "Aller", + "add-group-chat": "Conversation de groupe", + "add-to-group": "Ajouter à la scène de groupe", + "add-your-camera": "Ajoutez votre caméra à OBS", + "added-notes": "\n\t\t\t\tAdded Notes:\n\t\t\t\t
  • N'importe qui peut entrer dans une pièce s'il connaît le nom, alors gardez-le unique
  • \n\t\t\t\t
  • Il n'est pas conseillé d'avoir plus de quatre (4) personnes dans une pièce pour des raisons de performances, mais cela dépend de votre matériel.
  • \n\t\t\t\t
  • Les appareils iOS sont limités à des groupes de deux (2) personnes maximum. Il s'agit d'une limitation matérielle.
  • \n\t\t\t\t\n\t\t\t\t", + "advanced-paramaters": "Paramètres avancés", + "audio-sources": "Sources audio", + "back": "Retour", + "balanced": "Équilibré", + "copy-this-url": "Copiez cette URL dans un OBS \"Browser Source\"", + "copy-to-clipboard": "Copier dans le presse-papier", + "create-reusable-invite": "Créer une invitation réutilisable", + "enable-stereo-and-pro": "Activer l'audio stéréo et Pro HD", + "enter-the-rooms-control": "Entrez dans le centre de contrôle de la pièce", + "force-vp9-video-codec": "Forcer le codec vidéo VP9", + "generate-invite-link": "GÉNÉRER LE LIEN D'INVITATION", + "here-you-can-pre-generate": "Ici, vous pouvez pré-générer un lien de source de navigateur réutilisable et un lien d'invitation d'invité associé.", + "high-security-mode": "Mode haute sécurité", + "info-blob": "\n\t\t\t\t\t\t

    Qu'est-ce que OBS.Ninja


    \n\t\t\t\t\t\t
  • 100% gratuit ; aucun téléchargement; aucune collecte de données personnelles; pas de connexion
  • \n\t\t\t\t\t\t
  • Importez des vidéos de votre smartphone, ordinateur portable, ordinateur ou de vos amis directement dans votre flux vidéo OBS
  • \n\t\t\t\t\t\t
  • Nous utilisons une technologie de transfert Peer-to-Peer de pointe qui offre une confidentialité et une latence ultra-faible
  • \n\t\t\t\t\t\t
    \n\t\t\t\t\t\t
  • Youtube video Démonstration ici
  • \n\t\t\t\t\t\t
  • Le code est disponible ici: https://github.com/steveseguin/obsninja
  • \n\t\t\t\t\t\t

    \n\t\t\t\t\tDécouvrez le sub-reddit pour de l'aide et des informations avancées.

    ", + "joining-room": "Vous rejoignez la salle", + "max-resolution": "Résolution max", + "mute": "Mute", + "no-audio": "Pas de son", + "note-share-audio": "\n\t\t\t\t\tnote: N'oubliez pas de cliquer sur Partager l'audio dans Chrome.
    (Firefox ne prend pas en charge le partage audio.)", + "open-in-new-tab": "Ouvrir dans un nouvel onglet", + "record": "Record", + "remote-control-for-obs": "Télécommande pour OBS", + "remote-screenshare-obs": "Partage d'écran à distance dans OBS", + "room-name": "Nom de la salle", + "rooms-allow-for": "Les salles permettent une conversation de groupe simplifiée et la gestion avancée de plusieurs flux à la fois.", + "select-audio-source": "Sélectionnez les sources audio", + "select-audio-video": "Sélectionnez la source audio / vidéo ci-dessous", + "select-screen-to-share": "CHOISIR L'ÉCRAN À PARTAGER", + "show-tips": "Montrez-moi quelques conseils ..", + "smooth-cool": "Lisse et frais", + "unlock-video-bitrate": "Déverrouiller le débit vidéo (20 Mbps)", + "video-source": "Source vidéo", + "volume": "Volume", + "you-are-in-the-control-center": "Vous êtes dans le centre de contrôle de la pièce" +} diff --git a/translations/ru.json b/translations/ru.json new file mode 100644 index 0000000..6e68181 --- /dev/null +++ b/translations/ru.json @@ -0,0 +1,42 @@ +{ + "GO": "ИДТИ", + "add-group-chat": "Добавить групповой чат в OBS", + "add-to-group": "Добавить в групповую сцену", + "add-your-camera": "Добавьте свою камеру в OBS", + "added-notes": "\n\t\t\t\tДобавленные заметки:\n\t\t\t\t
  • Любой может войти в комнату, если знает имя, поэтому оставьте его уникальным
  • \n\t\t\t\t
  • Наличие более четырех (4) человек в комнате не рекомендуется по причинам производительности, но это зависит от вашего оборудования.
  • \n\t\t\t\t
  • Устройства iOS ограничены размерами группы не более двух (2) человек. Это аппаратное ограничение.
  • \n\t\t\t\t", + "advanced-paramaters": "Расширенные параметры", + "audio-sources": "Аудио источники", + "back": "назад", + "balanced": "Сбалансированный", + "copy-this-url": "Скопируйте этот URL в OBS \"Browser Source\"", + "copy-to-clipboard": "Скопировать в буфер обмена", + "create-reusable-invite": "Создать многоразовое приглашение", + "enable-stereo-and-pro": "Включить стерео и Pro HD Audio", + "enter-the-rooms-control": "Войдите в Центр управления комнатой", + "force-vp9-video-codec": "Видеокодек Force VP9", + "generate-invite-link": "СОЗДАТЬ ПРИГЛАШАЮЩУЮ ССЫЛКУ", + "here-you-can-pre-generate": "Здесь вы можете предварительно сгенерировать повторно используемую ссылку на источник браузера и связанную гостевую ссылку для приглашения..", + "high-security-mode": "Режим высокой безопасности", + "info-blob": "\n\t\t\t\t\t\t

    Что такое OBS.Ninja


    \n\t\t\t\t\t\t
  • 100% бесплатно; нет загрузок; нет сбора личных данных; нет входа
  • \n\t\t\t\t\t\t
  • Добавляйте видео со своего смартфона, ноутбука, компьютера или друзей прямо в видеопоток OBS
  • \n\t\t\t\t\t\t
  • Мы используем передовую технологию переадресации Peer-to-Peer, которая обеспечивает конфиденциальность и сверхнизкую задержку
  • \n\t\t\t\t\t\t
    \n\t\t\t\t\t\t
  • Пользователям MacOS необходимо использовать OBS v23 или использовать Window Capturing браузер Chrome с OBS v25
  • \n\t\t\t\t\t\t
    \n\t\t\t\t\t\t\n\t\t\t\t\t\tСайт последний раз обновлялся: May 7th, 2020.

    \n\t\t\t\t\t\t

    Проверьте sub-reddit для помощи и расширенной информации.

    \n\t\t\t\t\t", + "joining-room": "Вы присоединяетесь к комнате", + "logo-header": "OBS.Ninja (RU)", + "max-resolution": "Максимальное разрешение", + "mute": "сурдина", + "no-audio": "Нет звука", + "note-share-audio": "\n\t\t\t\t\tFirefox не поддерживает обмен аудио", + "open-in-new-tab": "Открыть в новой вкладке", + "record": "запись", + "remote-control-for-obs": "Пульт дистанционного управления для OBS", + "remote-screenshare-obs": "Удаленный просмотр экрана в OBS", + "room-name": "Название комнаты", + "rooms-allow-for": "В комнатах предусмотрены упрощенный групповой чат и расширенное управление несколькими потоками одновременно.", + "select-audio-source": "Выберите источники звука", + "select-audio-video": "Выберите источник аудио / видео ниже", + "select-screen-to-share": "Выберите экран, чтобы поделиться", + "show-tips": "Покажите мне несколько советов ..", + "smooth-cool": "Гладко и круто", + "unlock-video-bitrate": "Разблокировать видео битрейт", + "video-source": "Источник видео", + "volume": "громкость", + "you-are-in-the-control-center": "Вы находитесь в центре управления комнатой" +}