0.0.32 • Published 7 months ago

@8n/tran_md v0.0.32

Weekly downloads
-
License
BSL1.1
Repository
github
Last release
7 months ago

@8n/tran_md

test/main.coffee :

#!/usr/bin/env coffee

> ../lib/index.js:tranMd
  @w5/uridir
  @w5/read
  @w5/write
  path > join

ROOT = uridir(import.meta)
lang = 'en'
langfp = join(ROOT,lang+'.md')
form_lang = 'zh'
md = await tranMd(
  read join ROOT, form_lang+'.md'
  form_lang
)(
  lang
  join ROOT, 'cache.'+form_lang+'.'+lang
  # langfp
)
console.log md
if md
  write(
    langfp
    md
  )

output :

# I18N.SITE · Language Without Borders<img Src="//ok0.pw/5l" Style="float:right;width:42px;margin-Top:6px">

I18N.SITE, a multi-language static site generator, can automatically translate Markdown into [more than a hundred different languages](https://github.com/i18n-site/node/blob/main/lang/src/index.js) .

<img src="http://s-cd-3653-i18n-img.oss.dogecdn.com/i18n.lang.webp" alt="" />

Some people may want to ask, now that browsers have built-in translation functions, is it unnecessary to internationalize the website?

I want to say that **only by internationalizing the entire site can we support multi-lingual in-site full-text search and search engine optimization** .

## Tutorial

## Function Introduction

### Keep Markdown Format

### Modify Translation

After modifying the translation, you need to re-run `./i18n.sh` to update the cache.

### Translation Notes

Translation comments need to indicate the language after \```, such as ` ```rust` .

Currently supports comment translation for rust, c, cpp, java, js, coffee, python, and bash.

Edit [tran_md/src/comment.coffee](https://github.com/i18n-site/node/blob/main/tran_md/src/comment.coffee) to add translation support for comments in more languages.

### Configure Proxy

Setting the following environment variables allows Google Translate API calls to go through the proxy.

```bash
export https_proxy=http://127.0.0.1:7890

Variable Embedding

test: 测试变量<br 0>嵌入

Empty The Cache

rm -rf .i18n/.cache

Quote 1

Quote 2

toc

0.0.32

7 months ago

0.0.31

7 months ago

0.0.30

7 months ago

0.0.29

7 months ago

0.0.28

7 months ago

0.0.27

7 months ago

0.0.26

7 months ago

0.0.25

7 months ago

0.0.23

7 months ago

0.0.22

7 months ago

0.0.21

7 months ago

0.0.20

7 months ago

0.0.19

7 months ago

0.0.18

7 months ago

0.0.17

7 months ago

0.0.16

7 months ago

0.0.15

7 months ago

0.0.14

7 months ago

0.0.13

7 months ago

0.0.12

8 months ago

0.0.11

8 months ago

0.0.10

8 months ago

0.0.9

8 months ago

0.0.8

8 months ago