Skip to content

Translation tool for the gitbook. It creates gettext catalog and compile po file to generate translated documents.

License

Notifications You must be signed in to change notification settings

carpentries-i18n/po4gitbook

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Translation tool for the gitbook. It creates gettext catalog and compile po file to generate translated documents.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.5%
  • Shell 0.5%