Code Monkey home page Code Monkey logo

po4gitbook's Introduction

po4gitbook

NOTE

  • This project is just working state.
  • I didn't yet implement file copy action and LANGS.md file generation process.

Overview

This tool is translation tool to make translation catalog into the Portable Object Template(pot) format, and compile po format into the separate markdown(text) file. each work can be done automatically.

Create catalog by extracting message from markdown files

po4gitbook message extraction works in the following step.

  1. Aggregate a list of markdown documentation by recursively traversal sub-directory, and save a list into the po/POTFILES.in
  2. Create pot files per-directory. Message ID catalog for root is saved as doc-root.pot, and another Message ID catalog is named as each directory's own.

Every user can translate using pot file. for the convenience, I recommend to use po editor such as PoEdit, GTranslator, Lokalize, and so on as you want to use.

Run following command if you want to prepare to translate

$ ./update.sh

This command automatically updates pot plus all of po file.

Translate

Please note that,

  • First of all, You need to copy pot to po(like overview.po โ†’ overview.ja.po)
  • You should write your credit(# FULL NAME <[email protected]>, YEAR1, YEAR2-YEAR3, YEAR4.) onto the header description
  • You don't need to leave Copyright (C) ... line.
  • You may leave a license notice as "# This file is distributed under the same license as the gitbook package."
  • You should write Language-team URL. if it doesn't exist, write your name and e-mail alternatively.

Preparate to compile

Before you generate translation result, you need to create po/LINGUAS onto the gitbook(if it doesn't exist).

$ touch po/LINGUAS

and insert your ISO language code, such as

ar az ca de es fi fr it ja ko nl ru zh_CN

and many one as you want to create.

If there is no specified language code related on your language, po4gitbook will not generate result into your language. so, please double check before you try to "Compile".

Compile po

After you complete to translate to your language per one catalog(directory) unit, you can generate translation result into your language by running compile.sh command

$ ./compile.sh

Translation will be generated by compiling po file into the locale/LANG/blabla.md.

po4gitbook's People

Contributors

darkcircle avatar dpshelio avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

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.