Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/huntersofbook/i18n
It's basically a tool that takes a template with translation keys and syncs them to the given language. You can directly connect the outputs to the i18n libraries you use.
https://github.com/huntersofbook/i18n
i18n
Last synced: 1 day ago
JSON representation
It's basically a tool that takes a template with translation keys and syncs them to the given language. You can directly connect the outputs to the i18n libraries you use.
- Host: GitHub
- URL: https://github.com/huntersofbook/i18n
- Owner: huntersofbook
- License: mit
- Created: 2023-05-24T07:50:32.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-18T22:54:00.000Z (28 days ago)
- Last Synced: 2024-10-18T23:31:44.791Z (28 days ago)
- Topics: i18n
- Language: TypeScript
- Homepage: https://opensource.huntersofbook.com/npm/i18n
- Size: 1.88 MB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![alt text](https://github.com/huntersofbook/i18n/blob/main/.github/assets/i18n.png?raw=true)
# i18n
Create i18n templates and automatically export them to your desired languages. Unplugin support.
It's basically a tool that takes a template with translation keys and syncs them to the given language. You can directly connect the outputs to the i18n libraries you use.
## Installation
```bash
pnpm add -D @huntersofbook/i18n
```
It will be the `.i18n` folder. Save there by adding `en.json`, `tr.json`. It will automatically create a `language` folder for you and import your data there.## Youtube Setup Video
[![Youtube](https://github.com/huntersofbook/i18n/blob/main/.github/assets/youtube_cover.png?raw=true)](https://www.youtube.com/watch?v=b33Zk0LfKkM)
## Usage
### Vite
```ts
import i18n from '@huntersofbook/i18n/vite'export default defineConfig({
plugins: [
i18n({
languages: ['tr', 'en', 'cn'],
}),
],
})
```### Nuxt 3
```ts
export default defineNuxtConfig({
modules: [
'@huntersofbook/i18n/nuxt',
],
huntersofbookI18n: {
languages: ['tr', 'en', 'cn'],
},
})
```# [Documentation](https://opensource.huntersofbook.com/npm/i18n)
Documentation of the project is available at [https://opensource.huntersofbook.com/npm/i18n](https://opensource.huntersofbook.com/npm/i18n).![alt text](https://github.com/huntersofbook/i18n/blob/main/.github/assets/i18n_works.png?raw=true)
## Support
Join our [Discord channel](https://discord.gg/xAj9uqMrjC) or [open an issue](https://github.com/huntersofbook/i18n/issues).
## Configuration
| Name | Type | Default | Description |
| --- | --- | --- | --- |
| **languages** | `string[]` | `['tr', 'en', 'cn']` | Languages extensions to export |
| **templateDir** | `string` | `'.i18n'` | Template folder |
| **exportDir** | `string` | `'language'` | Template export folder |
... soon more detail## 💻 Development
Node version >= 18
Pnpm version >= 7- Clone this repository
- Open the project folder `packages/i18n`
- Enable [Corepack](https://github.com/nodejs/corepack) using `corepack enable` (use `npm i -g corepack` for Node.js < 16.10)
- Install dependencies using `pnpm install`
- Go to `i18n/packages` pnpm dev or pnpm build
- Go to `i18n/playground` pnpm dev
- or `packages/i18n` in `dev:package` | `dev:playground-vite` used.## Thank you
Thanks to @antfu, this project is heavily inspired by [unplugin-vue-components](https://github.com/antfu/unplugin-vue-components).## Sponsors
## License
MIT License © 2023-PRESENT [productdevbook](https://github.com/productdevbook)