Git Product home page Git Product logo

openai-translator's Introduction

OpenAI-Translator | OpenAI-Переводчик

Расширение для Google Chrome которое переводит интерфейс OpenAI Chat (ChatGPT) на русский язык.

На текущий момент проблема с рееализацией перевода всплывающих диалоговых окон $\textcolor{green}{\textsf{ id="radix-:[a-zA-Z0-9]+:" }}$ решить проблему к сожалению не могу, но попытки справиться с задачей не бросаю.

<div role="dialog" id="radix-:r1:" aria-describedby="radix-:r3:" aria-labelledby="radix-:r2:" data-state="open" class="relative col-auto col-start-2 row-auto row-start-2 w-full rounded-lg text-left shadow-xl transition-all left-1/2 -translate-x-1/2 !shadow-none md:w-[672px] lg:w-[896px] xl:w-[1024px]" tabindex="-1" style="pointer-events: auto;">
  <!-- Контент окна -->
</div>

<div role="dialog" id="radix-:r2q:" aria-describedby="radix-:r2s:" aria-labelledby="radix-:r2r:" data-state="open" class="relative col-auto col-start-2 row-auto row-start-2 w-full rounded-lg text-left shadow-xl transition-all left-1/2 -translate-x-1/2 bg-white dark:bg-gray-900 md:w-[680px]" tabindex="-1" style="pointer-events: auto;">
  <!-- Контент окна -->
</div>
// Функция для перевода элементов с ID, соответствующим маске
function translateElementsWithId(idMask) {
  const elements = document.querySelectorAll("[id^='" + idMask + "']");
  elements.forEach(element => {
    translateNode(element);
  });
}

// Функция для инициализации перевода
function initTranslation() {
  // Перевести содержимое документа
  translateNode(document.documentElement);
  // Перевести элементы по маске ID
  const idMask = "radix-:[a-zA-Z0-9]+:";
  translateElementsWithId(idMask);
  // Наблюдать за изменениями в дереве DOM
  observeChanges();
}

openai-translator's People

Contributors

yanashineru avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.