Code Monkey home page Code Monkey logo

aeiou's Introduction

아에이오우

스포카 프론트엔드 프로젝트에서 사용하는 국제화 스크립트입니다.

아에이오우 튜토리얼

기능

  • js, ts 파일들을 읽고, 그 안에 있는 gettext 함수 호출식을 긁어서 messages.pot 파일을 생성합니다.
  • transifex로 messages.pot파일을 업로드합니다.
  • transifex에서 *.po 파일들을 다운받고, *.mo 파일로 컴파일합니다.
  • 추출한 messages.pot에는 들어있지만 다운받은 *.po 파일에는 들어있지 않은 번역어를 찾아줍니다.

사용법

npm install -g aeiou

# 도움말을 확인합니다.
aeiou --help

# 특정 명령어에 대한 도움말도 확인할 수 있습니다.
aeiou extract --help

# 소스코드에서 번역이 필요한 문구들을 추출합니다.
aeiou extract --srcDir="./src" --outDir="./tmp/translations"
# `./tmp/translations` 경로로 들어가보면 `messages.pot` 파일을 확인할 수 있습니다.

# transifex로 업로드합니다.
# ./tmp/translations 경로에 `messages.pot` 파일이 있어야합니다.
aeiou push \
    --id="dkdlel" --password="qlalfqjsgh" \
    --project="vmfhwprxm" --resource="flthtm" \
    --potDir="./tmp/translations"

# transifex에서 번역 작업 후 번역 파일들을 내려받습니다.
aeiou download \
    --id="dkdlel" --password="qlalfqjsgh" \
    --project="vmfhwprxm" --resource="flthtm" \
    --outDir="./tmp/translations"

# 추출한 `messages.pot` 파일과 내려받은 번역파일을 비교해서 비어있는 번역어가 없는지 검사합니다.
aeiou ensure --locale="ja" --potDir="./src/static/translations"

aeiou 개발하기

  • npm install(yarn)
  • npm run build(yarn build) or npm run dev(yarn dev)
  • .js 파일은 컴파일된 결과입니다. 손으로 고치지 맙시다.
    • vscode의 경우 좌측 파일트리의 .js 파일들이 신경쓰이면
      • 상단 메뉴에서 Code > 기본 설정 > 설정으로 들어갑니다.
      • 우측 상단 드랍다운에서 작업 영역 설정을 클릭합니다.
      • 다음의 내용을 설정에 추가합니다:
        "files.exclude": {
            "**/*.js": true
        }
        

lockfile 업데이트

npm을 사용한 경우 yarn import를 써서 yarn.lock을 업데이트합니다.

yarn을 사용한 경우 다음 방법으로 package-lock.json을 업데이트합니다.

rm package-lock.json
npm shrinkwrap
mv npm-shrinkwrap.json package-lock.json

aeiou's People

Contributors

disjukr avatar heejongahn avatar kroisse avatar tirr-c 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

Watchers

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

Forkers

tirr-c heojoon

aeiou's Issues

[Question] gettext 함수 호출 인식

튜토리얼에서 궁금한것이 있습니다.

// aeiou는 다음과 같은 `gettext` 함수 호출을 인식합니다.
const sayHello = name => console.log(gettext('안녕하세요 %s'), name);
  1. gettext라는 텍스트로 인식하는 건가요? 아니면 Jed객체를 인식하는 건가요?
  2. export 한 함수명은 따로 인식하지 않는건가요?

누락된 번역어 찾는 기능

  • 로컬에서 extract한 메세지 목록
  • transifex에서 내려받은 카탈로그

교집합중에 비어있는 번역어가 있으면 에러 내는 명령어 만들기

ex)

aeiou ensure --locale="ja"

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.