Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ivanhofer/inlang-plugin-typesafe-i18n
the official `typesafe-i18n` plugin for `inlang`
https://github.com/ivanhofer/inlang-plugin-typesafe-i18n
i18n inlang internationalization plugin typesafe-i18n typescript
Last synced: 3 months ago
JSON representation
the official `typesafe-i18n` plugin for `inlang`
- Host: GitHub
- URL: https://github.com/ivanhofer/inlang-plugin-typesafe-i18n
- Owner: ivanhofer
- License: mit
- Created: 2023-01-09T07:00:54.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-08-24T05:00:55.000Z (over 1 year ago)
- Last Synced: 2024-05-01T16:10:40.494Z (8 months ago)
- Topics: i18n, inlang, internationalization, plugin, typesafe-i18n, typescript
- Language: TypeScript
- Homepage:
- Size: 186 KB
- Stars: 11
- Watchers: 2
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# inlang-plugin-typesafe-i18n
This is the official [typesafe-i18n](https://github.com/ivanhofer/typesafe-i18n) plugin for [inlang](https://inlang.com).\
You can use this plugin to read and write resources that can be used in a project with `typesafe-i18n` as the internationalization library.> It is not meant to be used together with the [SDK](https://inlang.com/documentation/sdk/overview) inlang provides.
## Usage
```js
// filename: inlang.config.js/**
* @type {import("@inlang/core/config").DefineConfig}
*/
export async function defineConfig(env) {
// initialize the plugin
const { default: typesafeI18nPlugin } = await env.$import(
"https://cdn.jsdelivr.net/gh/ivanhofer/inlang-plugin-typesafe-i18n@2/dist/index.js"
)return {
plugins: [typesafeI18nPlugin()],
}
}
```### Limitations
- [namespaces](https://github.com/ivanhofer/typesafe-i18n/tree/main/packages/generator#namespaces) are currently not supported in the `inlang` Editor
- types don't get updated if you make changes to your `BaseTranslation`
workaround: to update the types run the [generator](https://github.com/ivanhofer/typesafe-i18n/tree/main/packages/generator) in CI after the Editor pushes new Messages to the repository