Git Product home page Git Product logo

logseq-l10n-clone-json's Introduction

logseq-l10n-clone-json

Clone JSON files for Logseq full languages based on one translation file

Logseq full Language list

English Local Language
Afrikaans Afrikaans
German Deutsch
Spanish Español
French Français
Indonesian Bahasa Indonesia
Italian Italiano
Japanese 日本語
Korean 한국어
Norwegian Norsk
Dutch Nederlands
Polish Polski
Portuguese Português
Russian Русский
Slovak Slovenčina
Turkish Türkçe
Ukrainian Українська
Chinese Simplified 简体中文
Chinese Traditional 繁體中文

Dependencies

  • Use Microsoft Azure Cognitive Services Translation API
  • Use logseq-l10n: L10N framework for Logseq plugins

Install

  1. Clone this repo. Run command 'pnpm install' for dependencies.
  2. Edit config.js and change the API key etc. (Azure Portal)

Usage

  1. First, set up "logseq-l10n". Then, create one translation file.
  2. Enter the file name and path in config.js.
  3. Run “node index.cjs” command in terminal.
  4. Files will be created.

    If a file with the same name exists, it will not be updated.

  5. The sample code for importing the created translation files is as follows.
import { setup as l10nSetup } from "logseq-l10n" //https://github.com/sethyuan/logseq-l10n
import af from "./translations/af.json"
import de from "./translations/de.json"
import es from "./translations/es.json"
import fr from "./translations/fr.json"
import id from "./translations/id.json"
import it from "./translations/it.json"
import ja from "./translations/ja.json"
import ko from "./translations/ko.json"
import nbNO from "./translations/nb-NO.json"
import nl from "./translations/nl.json"
import pl from "./translations/pl.json"
import ptBR from "./translations/pt-BR.json"
import ptPT from "./translations/pt-PT.json"
import ru from "./translations/ru.json"
import sk from "./translations/sk.json"
import tr from "./translations/tr.json"
import uk from "./translations/uk.json"
import zhCN from "./translations/zh-CN.json"
import zhHant from "./translations/zh-Hant.json"

const main = async () => {
await l10nSetup({
    builtinTranslations: {//Full translations
    af, de, es, fr, id, it, ja, ko, "nb-NO": nbNO, nl, pl, "pt-BR": ptBR, "pt-PT": ptPT, ru, sk, tr, uk, "zh-CN": zhCN, "zh-Hant": zhHant
    }
})

}

Recommend

  1. Generate JSON file for translation > logseq-l10n-generate-json: Extract ' t("string") ' from the scripts in the folder and create one JSON file.

logseq-l10n-clone-json's People

Contributors

yu000jp avatar

Stargazers

Seth Yuan avatar

Watchers

 avatar

logseq-l10n-clone-json's Issues

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.