tony84727 / diplomat

Tool, code generator for internationalization.
MIT License
1 stars 0 forks source link

Change layout. #1

Closed MinecraftXwinP closed 6 years ago

MinecraftXwinP commented 6 years ago

outline.yaml will be setting file for diplomat.

version: '1'
preprocessors:
- type: chinese
  options:
    - mode: t2s
      from: zh-TW
      to: zh-CN
- type: copy
  options:
    - from: en
    - to: fr
output:
  - selectors:
      - admin
      - manage
    template:
      type: js
      options:
        filename: "{{.Lang}}.control-panel.js"

selector select keys by prefix

Translations will put in regular yaml file, likes:

admin:
  message:
    hello:
      zh-TW: '您好'
      en: 'Hello!'

to support nested key structure.

language will be determine by last segment

admin.message.hello."zh-TW" admin.message.hello."en"