TranslationTools is a React-based application that automates text translation using the Baidu Translation API, designed to help users translate content with ease. It offers a range of features, including a text input box, translation button, translation result display, and language selector. Users can input text, select the target language, and click the translation button to get the result. The result is displayed in a card format, allowing users to view and copy it easily and download it in multiple file formats.
Deployment | network requirement | Link |
---|---|---|
vercel | Bypassing the mainland | Click on the link to view |
- Free to use: But please give it a star if you like it!
- Super simple: No complex wrappers, no type gymnastics, ready to use out of the box
- Updated dependencies: All third-party dependencies are regularly updated
- Contact WX: For full source code with complete copyrights, contact WX: DU2603948701
- React 18: Built with React 18 + Antd + TailwindCSS + Zustand, leveraging the latest React 18 features
- Ant Design 5.0: Using version 5.x of Ant Design UI
- Zustand: Simple and clean state management tool for React
- Vite: Extremely fast
- TSX Support: Supports TSX syntax
- PNPM: A faster, disk space-efficient package manager
- ESlint: For code quality checks
- TailwindCSS: Latest CSS framework
- SWC: Compiling with SWC instead of Babel for improved build speed
- Mobile Compatibility: Responsive design for mobile resolutions
- Text Translation: Translate text with custom character length
- Simple JSON Translation: Suitable for basic JSON translation (2D JSON)
- Complex JSON Translation: Complex JSON patterns are suitable for JSON translation of nested structures and for multi-dimensional nested JSON
Ensure you have Node.js and npm (or pnpm/yarn) installed. Then, install the project dependencies by running the following commands:
# Setup
1. Install the recommended plugins in the .vscode folder with one click
2. Node version 20+
3. PNPM version 9.x or the latest
# Clone the project
git clone https://github.com/durunsong/TranslationTools.git
# Enter the project directory
cd TranslationTools
# Install dependencies
pnpm install
# Start the development server
pnpm run dev
- Open https://translation-tools.vercel.app/
- Go to the Baidu Translation Developer Center to obtain your Baidu translation app ID and secret key. Refer to the Baidu Translation API Documentation for details.
- Enter the app ID and key on the page, and click "Save to Local".
- Input the text you want to translate and select the target language, then click "Translate".
- The translation result will appear on the page. Click "Copy" to copy the result.
- Click the "Translate and Download" button to customize your translation file and download the result.
- Choose from three data structure options based on your needs: Simple JSON for 2D JSON, Complex JSON for multi-dimensional JSON, and Text Translation for plain text.
- Support automatic detection of source language
- Support Chinese, English, German, French, Japanese, Korean, Russian, Polish, Danish, Latin, Dutch, Portuguese, Thai, Italian, Greek, Arabic, Spanish, Czech, Swedish, Traditional Chinese, Irish, Finnish, Romanian, Vietnamese, Hungarian, Indonesian, Hmong, Norwegian, Turkish Language Translation
- JSON
- TS
- JS
- TEXT
- MARKDOWN
- TSX
- JSX
- Vue
- PHP
- JAVA
- GO
- YAML
- PY
-
For Asian countries, use Chinese as the source language for more accurate translations.
-
For other regions, using English as the source language yields better accuracy.
-
If the data format is not in standard JSON format, please convert it to JSON format, otherwise it will report an error, the simplest way to convert is as follows:
// Non-standard JSON data
const data = {
name: 'zhangsan',
age: 18,
gender: 'male',
};
// Convert to standard JSON data --- view the output in the browser console, copy the object directly
console.log(data);
``
## 💕 Thanks for the Star
It's not easy for small projects to get stars, so if you like this project, please support it with a star! It's the author’s primary motivation to keep maintaining it (whisper: after all, it’s free).