mooi-cli
TypeScript icon, indicating that this package has built-in type declarations

1.0.14 • Public • Published

mooi

Tool for generating AI translations.

A more detailed README is coming soon, stay tuned!

Installation

Install it via npm:

npm i -g mooi-cli

Use it

Define a mooi folder in the root of your repository. Within that folder, put the original untranslated string copies (currently English is assumed) and specify what languages you want to generate. Here is an example:

# Assuming that this file is mooi/translations.yaml

languages: ['de', 'nl']
entries:
    - key: myCodeFriendlyKey                                            # a key that you will later use to look up this value
      value: Hello World                                                # what you actually want to translate
      description: This value is shown as a title of the home screen    # (optional, but recommended) Let mooi know in what context this value is used to get a better quality of translation

Then run

npx mooi-cli translate --openAiKey {YOUR OPEN AI API KEY}

Format the output

By default, results are generated in mooi/translations folder. If you want to provide an additional output, you can do so via mooi/config.yaml file using Handlebar.js syntax

formats:
  - name: default     # 'default' is a keyword. We are going to allow selecting between formats in future releases
    outputFormat: src/translations/{{languageCode}}/index.js  # where to write the results for a given language
    format: |
    export default {
    {{#each translations}}
      {{this.key}}: '{{this.value}}',
    {{/each}}
    }

Readme

Keywords

Package Sidebar

Install

npm i mooi-cli

Weekly Downloads

2

Version

1.0.14

License

Apache-2.0

Unpacked Size

40.7 kB

Total Files

57

Last publish

Collaborators

  • gloriousdima