Skip to content

mrlee23/org-multilingual

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

org-multilingual https://travis-ci.org/mrlee23/org-multilingual.svg?branch=master

Introduction

Org Mode multilingual preprocessor.

How to use

  1. Download source code
    git clone https://github.com/mrlee23/org-multilingual.git
        
  2. Add to load-path
    (add-to-list 'load-path "./org-multilingual")
    (require 'org-multilingual)
        
  3. Execute
(org-multilingual-replace "Hello @@LANG_EN:World@@@@LANG_ES:Mundo@@!" 'es) ;; "Hello Mundo!"

with Publish

(defun org-my-publish-to-html (plist filename pub-dir)
  (org-html-publish-to-html plist
                            (org-multilingual-publish plist filename pub-dir)
                            pub-dir))
(setq org-publish-project-alist
        `(("Project Name"
           :base-directory "BASE_DIR"
           :base-extension "org"
           :auto-index nil
           :exclude: "EXCLUDE_DIR"
           :index-filename nil
           :index-title nil
           :auto-sitemap nil
           :publishing-directory "TARGET_DIR"
           :publishing-function org-my-publish-to-html
           :headline-levels 4
           :recursive nil
           :auto-preamble nil
           )
          ))

Syntax

Property

Replace section name with value of “LANG_XX” property. The property value will be trim left, right spaces.

Remaining not “LANG_XX” properties is remaning.

  • :LANG_<ISO Code>:

Example

*** This is test
:PROPERTIES:
:LANG_EN: Section Name
:LANG_ES: Nombre de la sección
:LANG_KO: 섹션 이름
:LANG_ZH: 部分名称
:LANG_JA: セクション名
:END:
Results
EnglishSection Name
EspañolNombre de la sección
한국어섹션 이름
中文部分名称
日本語セクション名
OthersSection

Block

  • #+BEGIN_LANG <ISO Code>

Example

Contents

contenido

내용

内容

内容
Results
EnglishContents
Españolcontenido
한국어내용
中文内容
日本語内容
Others

Multiple languages

Contents
内容
Results
EnglishContents
EspañolContents
한국어内容
中文内容
日本語内容
Others

Inline

  • #+LANG_<ISO Code>:

Example

#+LANG_EN: Hello World!
#+LANG_ES: Hello Mundo!
#+LANG_KO: 안녕 World!
#+LANG_ZH: 你好 World!
#+LANG_JA: こんにちは World!
Results
EnglishHello World!
EspañolHello Mundo!
한국어안녕 World!
中文你好 World!
日本語こんにちは World!
Others

Quoting

  • @@LANG_<ISO Code>: @@

Example

Hello @@LANG_EN:World@@!
Hello @@LANG_ES:Mundo@@!
@@LANG_KO:안녕@@ World!
你好 @@LANG_ZH:World@@!
こんにちは @@LANG_JA:World@@!
Results
EnglishHello World!
EspañolHello Mundo!
한국어안녕 World!
中文你好 World!
日本語こんにちは World!
Others

Options

  • :language
  • :override

About

Multilingual preprocessor for Org Mode

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published