Git Product home page Git Product logo

openai-translator's Introduction

Cloudflare TypeScript React Vite TailwindCSS React Router React Query

OpenAI Translator

A translator app that uses OpenAI GPT-3 to translate between languages. It is a PWA that can be installed on your phone or desktop.

https://translator.lance.moe/

Support models:

  • GPT-3.5 Turbo (ChatGPT engine)
  • GPT-4
  • GPT-4 Turbo
  • GPT-4o

image

image

Tech Stack

  • OpenAI API
  • React 18
  • Vite 4
  • Tailwind CSS 3
  • DaisyUI 2
  • Axios
  • React Router 6
  • React Query 4
  • PWA
  • Cloudflare Pages

I think this project will help you learn these techniques.

If you like this project, please don't forget to give this project a star, thanks.

Local Development

1. Install pnpm

Make sure that pnpm is installed on your computer. If it's not already installed, you can install it:

https://pnpm.io/installation

2. Download project dependencies

Navigate to the root directory of your project and run the following command to download project dependencies:

pnpm install

3. Start the local server

Run the following command to start the local development server:

pnpm dev

4. Open the application

Vite should automatically open your browser.

Build the Project

Docker Build

1. Run docker build

Navigate to the root directory of your project in your command line interface and run the following command to build the Docker image:

docker build -t openai-translator-web .

Here, openai-translator-web is the name you want to give to the image, and the . at the end indicates the current directory.

2. Start the Container

Run the following command to start the container and map the port to your local machine:

docker run -p 3000:80 openai-translator-web

Here, 3000 represents the local port you want to map to the container's 80 port. You can change this to any other port you prefer.

3. Open the Application

In your browser, enter the following URL to access the application:

http://localhost:3000/

Local Build

1. Install pnpm

Make sure that pnpm is installed on your computer. If it's not already installed, you can install it:

https://pnpm.io/installation

2. Download project dependencies

Navigate to the root directory of your project and run the following command to download project dependencies:

pnpm install

3. Build

Run the following command to build your project:

pnpm build

The compiled files will be placed in the dist folder.

4. Deploy

Now you can treat the files in the dist folder as a static website and deploy it on the server.

Credit

openai-translator's People

Contributors

lancemoe avatar workfunction avatar yunwuu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

openai-translator's Issues

add copy feature

If there could be an added copy button, that would be even better.

Help!New feature。

May I ask if you can add a feature to OpenAI Translator that allows it to be fixed on the desktop when using other software?

default environment variable

Is it possible to set default environment? like adding an .env file, with content OPENAI_API_KEY=sk-xxxxxxxxxxxx.

Suggestion

Now translation results keep the same if you try several times. To adjust tempreture param, for example, from 1(default) to 1.5, will increase the diversity of translation results.

内置OpenAI API Key

如果可以内置OpenAI API Key在env文件中就好了,不需要反复填入

feature request: terminology customization support

Many of the technical texts would require specific set of terminologies which may differ from how their common usage. DeeplL Pro supports this and I was wondering whether you could kindly add that too. Thank you in advance.

Voice input, Line break, Erasing old text.

  1. I encountered a problem with voice input. When I speak slowly, it quickly turns off. Could you please increase the speech waiting time or provide a manual on/off option for voice input so that the function doesn't turn off so quickly?

  2. And also, the line break in the translated text is done letter by letter, which is not very convenient. Could you please make the line break for whole words if they don't fit in a single line?

  3. It would be helpful to have a quick way to clear the original text field. After a translation is done, I need to manually select all the text to delete it and write new text. Could you add something like an "X" button in the top right corner to quickly delete the old text and enter new text?

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.