Markdown

Lingo.dev CLI를 사용한 Markdown 파일의 AI 번역

Markdown이란?

Markdown은 일반 텍스트 형식 구문을 사용하여 구조화된 문서를 작성하는 경량 마크업 언어입니다. 문서화, README 파일, 블로그 및 콘텐츠 관리 시스템에 널리 사용됩니다.

예시:

---
title: "Product Launch Guide"
description: "Everything you need to know about our latest product features"
author: "Product Team"
---

# Welcome to Our New Dashboard

Discover powerful new features designed to streamline your workflow and boost productivity.

## Getting Started

Follow these simple steps to set up your account and begin using our platform effectively.

![Dashboard overview screenshot](image.jpg)

Lingo.dev CLI란?

Lingo.dev CLI는 AI를 사용하여 앱과 콘텐츠를 번역하는 무료 오픈 소스 CLI입니다. 기존 파이프라인과 통합하면서 기존 번역 관리 소프트웨어를 대체하도록 설계되었습니다.

자세한 내용은 개요를 참조하세요.

이 가이드에 대하여

이 가이드는 Lingo.dev CLI를 사용하여 Markdown 파일을 번역하는 방법을 설명합니다.

다음 내용을 배우게 됩니다:

  • 처음부터 프로젝트 생성하기
  • 번역 파이프라인 구성하기
  • AI로 번역 생성하기

사전 요구 사항

Lingo.dev CLI를 사용하려면 Node.js v18 이상이 설치되어 있는지 확인하세요:

❯ node -v
v22.17.0

1단계. 프로젝트 설정하기

프로젝트 디렉토리에서 i18n.json 파일을 생성하세요:

{
  "$schema": "https://lingo.dev/schema/i18n.json",
  "version": "1.10",
  "locale": {
    "source": "en",
    "targets": ["es"]
  },
  "buckets": {}
}

이 파일은 번역할 언어와 파일 시스템에서 현지화 가능한 콘텐츠가 존재하는 위치를 포함하여 번역 파이프라인의 동작을 정의합니다.

사용 가능한 속성에 대한 자세한 내용은 i18n.json을 참조하세요.

2단계. 소스 로케일 구성하기

_소스 로케일_은 콘텐츠가 작성된 원래 언어 및 지역입니다. 소스 로케일을 구성하려면 i18n.json 파일에서 locale.source 속성을 설정하세요:

{
  "$schema": "https://lingo.dev/schema/i18n.json",
  "version": "1.10",
  "locale": {
    "source": "en",
    "targets": ["es"]
  },
  "buckets": {}
}

소스 로케일은 BCP 47 언어 태그로 제공되어야 합니다.

Lingo.dev CLI가 지원하는 로케일 코드의 전체 목록은 지원되는 로케일 코드를 참조하세요.

3단계. 타겟 로케일 구성하기

_타겟 로케일_은 콘텐츠를 번역하려는 언어 및 지역입니다. 타겟 로케일을 구성하려면 i18n.json 파일에서 locale.targets 속성을 설정하세요:

{
  "$schema": "https://lingo.dev/schema/i18n.json",
  "version": "1.10",
  "locale": {
    "source": "en",
    "targets": ["es"]
  },
  "buckets": {}
}

4단계. 소스 콘텐츠 생성하기

아직 생성하지 않았다면, 번역할 콘텐츠가 포함된 하나 이상의 Markdown 파일을 생성하세요. 이러한 파일은 경로 어딘가에 소스 로케일이 포함된 위치에 있어야 합니다(예: en/와 같은 디렉토리 이름 또는 messages.en.md와 같은 파일명의 일부).

5단계. 버킷 생성하기

  1. i18n.json 파일에서 buckets 객체에 "markdown" 객체를 추가하세요:

    {
      "$schema": "https://lingo.dev/schema/i18n.json",
      "version": "1.10",
      "locale": {
        "source": "en",
        "targets": ["es"]
      },
      "buckets": {
        "markdown": {}
      }
    }
    
  2. "markdown" 객체에서 하나 이상의 include 패턴 배열을 정의하세요:

    {
      "$schema": "https://lingo.dev/schema/i18n.json",
      "version": "1.10",
      "locale": {
        "source": "en",
        "targets": ["es"]
      },
      "buckets": {
        "markdown": {
          "include": ["./[locale]/example.md"]
        }
      }
    }
    

    이러한 패턴은 번역할 파일을 정의합니다.

    패턴 자체는:

    • 구성된 로케일의 플레이스홀더로 [locale]를 포함해야 합니다
    • 파일 경로를 가리킬 수 있습니다(예: "[locale]/docs.md")
    • 와일드카드 플레이스홀더로 별표를 사용할 수 있습니다(예: "[locale]/*.md")

    재귀적 glob 패턴(예: **/*.md)은 지원되지 않습니다.

6단계. LLM 구성하기

Lingo.dev CLI는 대규모 언어 모델(LLM)을 사용하여 AI로 콘텐츠를 번역합니다. 이러한 모델 중 하나를 사용하려면 지원되는 제공업체의 API 키가 필요합니다.

가능한 한 빠르게 시작하려면 매월 10,000 토큰의 무료 사용량을 제공하는 자체 호스팅 플랫폼인 Lingo.dev Engine 사용을 권장합니다:

  1. Lingo.dev 계정에 가입하세요.

  2. 다음 명령을 실행하세요:

    npx lingo.dev@latest login
    

    기본 브라우저가 열리고 인증을 요청합니다.

  3. 안내에 따라 진행하세요.

7단계. 번역 생성

i18n.json 파일이 있는 디렉토리에서 다음 명령을 실행하세요:

npx lingo.dev@latest run

이 명령은:

  1. i18n.json 파일을 읽습니다.
  2. 번역이 필요한 파일을 찾습니다.
  3. 파일에서 번역 가능한 콘텐츠를 추출합니다.
  4. 구성된 LLM을 사용하여 추출된 콘텐츠를 번역합니다.
  5. 번역된 콘텐츠를 파일 시스템에 다시 작성합니다.

번역이 처음 생성될 때 i18n.lock 파일이 생성됩니다. 이 파일은 어떤 콘텐츠가 번역되었는지 추적하여 후속 실행 시 불필요한 재번역을 방지합니다.

예제

en/example.md

---
title: "Product Launch Guide"
description: "Everything you need to know about our latest product features"
author: "Product Team"
date: 2024-01-15
tags: ["apples", "bananas", "pears"]
---

# Welcome to Our New Dashboard

Discover powerful new features designed to streamline your workflow and boost productivity.

## Getting Started

Follow these simple steps to set up your account and begin using our platform effectively.

---

Our advanced analytics help you make data-driven decisions with confidence.

![Dashboard overview screenshot](image.jpg)

The intuitive interface makes it easy to navigate between different features and tools.

[View documentation](https://example.com)

Need help getting started? Our support team is available 24/7 to assist you.

***

Join thousands of satisfied customers who have transformed their business with our platform.

es/example.md

---
title: Guía de lanzamiento de producto
description: Todo lo que necesitas saber sobre las últimas características de
  nuestro producto
author: Equipo de producto
date: 2024-01-15
tags:
  - apples
  - bananas
  - pears
---

# Bienvenido a nuestro nuevo panel de control

Descubre nuevas y potentes funciones diseñadas para optimizar tus flujos de trabajo y aumentar la productividad.

## Primeros pasos

Sigue estos sencillos pasos para configurar tu cuenta y comenzar a utilizar nuestra plataforma de manera efectiva.

---

Nuestros análisis avanzados te ayudan a tomar decisiones basadas en datos con confianza.

![Captura de pantalla de la visión general del panel](image.jpg)

La interfaz intuitiva facilita la navegación entre diferentes funciones y herramientas.

[Ver documentación](https://example.com)

¿Necesitas ayuda para empezar? Nuestro equipo de soporte está disponible 24/7 para asistirte.

---

Únete a miles de clientes satisfechos que han transformado su negocio con nuestra plataforma.

i18n.json

{
  "$schema": "https://lingo.dev/schema/i18n.json",
  "version": "1.10",
  "locale": {
    "source": "en",
    "targets": ["es"]
  },
  "buckets": {
    "markdown": {
      "include": ["./[locale]/example.md"]
    }
  }
}

i18n.lock

version: 1
checksums:
  eed9ef23a605b747d38b8916cee1d500:
    md-section-0: d53f61b8c8922fb62d9df5678d9b44a8
    md-section-1: 98aec271471bedce0e12b530c7060827
    md-section-2: 9e5a786192608844493dfbb6e4100886
    md-section-3: 1a5299c38bb20c1b8af0e64e33d7b2b0
    md-section-4: 51adf33450cab2ef392e93147386647c
    md-section-5: e56cc804e3e06b5f5fb2484e88c18adc
    md-section-6: 0ea86a3338305070c865e8fe138da890
    md-section-7: bbabf7f391569a72099001e3d81eb251
    md-section-8: 36cbfd93f42528edce4faac2ac3c2c12
    md-section-9: a1c50054ab23d70be8d453789b214580
    md-section-10: 51adf33450cab2ef392e93147386647c
    md-section-11: cb596c9608828f7b87a0ab8fa37beb07
    fm-attr-title: f3469c4e3d3377c39a705c844930b3a5
    fm-attr-description: 2e988d98001e44997a3f5fa3fb487ca6
    fm-attr-author: ec8c8711fce61265a4fe296ce2ba3b6f
    fm-attr-tags: 313ac6f17ee08e4f4a6a2ca95e5ae024