SuperAPI AI Directory

translator

Writing & research

View repository

Updated 10-15 21:04

About this skill

Translator Skill

This is a skill for multilingual translation of technical documents and code comments.

Overview

Provides highly accurate translation with an understanding of programming context. Appropriately preserves technical terms, variable names, and code blocks.

Main Features

  • Technical Document Translation: README, documentation, API specifications
  • Code Comment Translation: Inline comments, JSDoc, Docstring
  • UI/UX text: Buttons, labels, error messages
  • Technical Term Preservation: Technical terms are kept in the original language or annotated
  • Code Block Protection: Code portions are not translated
  • Consistency Maintenance: Unified translation using a glossary
  • Multilingual Support: 50 or more languages

Supported Languages

  • Japanese ↔ English
  • Chinese (Simplified and Traditional)
  • Korean
  • Spanish, French, German
  • 50 or more other languages

How to Use

Basic Translation

以下のREADMEを日本語に翻訳:
[英語のREADME]

注意:
- コードブロックは保持
- 技術用語は適切に処理

Code Comment Translation

このファイルのコメントを英語に翻訳:
[日本語コメント付きコード]

要件:
- コードは変更しない
- コメントのみ翻訳
- JSDoc形式を維持

UI text

以下のUIテキストを5言語に翻訳:
言語: 英語、日本語、中国語、韓国語、スペイン語

元テキスト:
- "Sign Up"
- "Password must be at least 8 characters"
- "Email already exists"

Translation Examples

README Translation

English → Japanese:

# Project Name

A powerful tool for developers.

## Installation

```bash
npm install project-name

Features

  • Fast performance
  • Easy to use
  • Well documented

↓

```markdown
# プロジェクト名

開発者のための強力なツールです。

## インストール

```bash
npm install project-name

Features

  • Fast performance
  • Ease of use
  • Comprehensive documentation

### コードコメント翻訳

**日本語 → 英語**:

```javascript
/**
 * ユーザーを作成する
 * @param {string} email - メールアドレス
 * @param {string} password - パスワード(8文字以上)
 * @returns {User} 作成されたユーザー
 * @throws {ValidationError} 入力値が不正な場合
 */
function createUser(email, password) {
  // メールアドレスの形式をチェック
  if (!isValidEmail(email)) {
    throw new ValidationError('無効なメールアドレスです');
  }

  // パスワードの長さをチェック
  if (password.length < 8) {
    throw new ValidationError('パスワードは8文字以上必要です');
  }

  // ユーザーをデータベースに保存
  return db.users.create({ email, password });
}

↓

/**
 * Create a user
 * @param {string} email - Email address
 * @param {string} password - Password (minimum 8 characters)
 * @returns {User} Created user
 * @throws {ValidationError} If input is invalid
 */
function createUser(email, password) {
  // Check email format
  if (!isValidEmail(email)) {
    throw new ValidationError('Invalid email address');
  }

  // Check password length
  if (password.length < 8) {
    throw new ValidationError('Password must be at least 8 characters');
  }

  // Save user to database
  return db.users.create({ email, password });
}

UI Text Multilingualization

{
  "en": {
    "signup": "Sign Up",
    "login": "Log In",
    "password_error": "Password must be at least 8 characters",
    "email_exists": "Email already exists"
  },
  "ja": {
    "signup": "サインアップ",
    "login": "ログイン",
    "password_error": "パスワードは8文字以上である必要があります",
    "email_exists": "このメールアドレスは既に登録されています"
  },
  "zh": {
    "signup": "注册",
    "login": "登录",
    "password_error": "密码必须至少8个字符",
    "email_exists": "电子邮件已存在"
  },
  "ko": {
    "signup": "가입하기",
    "login": "로그인",
    "password_error": "비밀번호는 최소 8자 이상이어야 합니다",
    "email_exists": "이메일이 이미 존재합니다"
  }
}

Handling of Technical Terms

Terms to Preserve

  • API, HTTP, REST, GraphQL
  • JSON, XML, YAML
  • Git, GitHub, commit, pull request
  • Docker, Kubernetes
  • React, Vue, Angular

Terms to Translate

  • function → function
  • variable → variable
  • array → array
  • object → object

Write Both Together

配列 (array)
オブジェクト (object)
非同期 (asynchronous)

Best practices

  1. Provide Context: Specify the purpose of the translation target
  2. Use a Glossary: Unify project-specific terminology
  3. Review: Review by native speakers
  4. Step-by-Step Translation: In the order README → comments → UI

Version Information

  • Skill version: 1.0.0
  • Last updated: 2025-01-22

Usage Examples:

このREADMEを英語から日本語に翻訳:
- コードブロックは保持
- 技術用語は適切に処理(必要に応じて併記)
- Markdown形式を維持

[英語のREADME内容]

High-quality translations are generated!