Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lencx/i18n
🌐 i18n
https://github.com/lencx/i18n
i18n
Last synced: 6 days ago
JSON representation
🌐 i18n
- Host: GitHub
- URL: https://github.com/lencx/i18n
- Owner: lencx
- Created: 2018-03-24T08:31:12.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-03-25T09:09:15.000Z (over 6 years ago)
- Last Synced: 2024-05-23T05:35:29.950Z (6 months ago)
- Topics: i18n
- Language: JavaScript
- Homepage:
- Size: 136 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# i18n
```bash
yarn
yarn dev
```## Project Structure
```
[project]
|- [i18n]
| |- [{lang}]
| | `- *.json
| `- ...
` ..OR
[project]
|- [i18n]
| |- [**]
| | `- *.{lang}.json
| `- ...
` ...
```---
## HTML Tags Attributes
|type|arrtibute|describe|use|
|---|---|---|---|
|common|i18n-c|common|i18n-c='key_name'|
|keywords|i18n-k|keywords|i18n-k='key_name'|
|page|i18n-p|page|i18n-p='key_name'|
|style|i18n-s|currect element style|i18n-s|
|image|i18n-(c \| p)-i|common image path \| page image path|i18n-c-i='key_name'|
|pleceholder|i18n-(c \| k \| p)-ph|common placeholder \| ...|i18n-c-ph='key_name' \| ...|\* key_name: `i18n key name`
---
## Config### There are two ways i18n file organization
*\* path:* `~/i18n/{lang}/**/*.json` | `~/i18n/**/*.{lang}.json`
```yml
# {lang}/index.json | index.{lang}.json
http:localhost:8080/index.html
http:localhost:8080# {lang}/aa.json | aa.{lang}.json
http:localhost:8080/aa/index.html
http:localhost:8080/aa# {lang}/aa/a.json | aa/a.{lang}.json
http:localhost:8080/aa/a.html
```### i18n matches the corresponding page in two ways
> `currect URL`(default) | ``
When the current page is not internationalized, add `` to
the HTML`i18n-unset` value:
* When the value is not set, the current page is completely not internationalized
* When the 'p' value is set, the current page has international content in `common(common.{lang}.json)` and `keyword(keyword.{lang}.json)`