@inlang/paraglide-js
Advanced tools
Comparing version 1.0.0-prerelease.17 to 1.0.0-prerelease.18
{ | ||
"name": "@inlang/paraglide-js", | ||
"type": "module", | ||
"version": "1.0.0-prerelease.17", | ||
"version": "1.0.0-prerelease.18", | ||
"license": "Apache-2.0", | ||
@@ -6,0 +6,0 @@ "publishConfig": { |
@@ -101,2 +101,17 @@ <!-- ![Paraglide JS header image](https://cdn.jsdelivr.net/gh/inlang/monorepo@latest/inlang/source-code/paraglide/paraglide-js/assets/paraglide-js-header.png) --> | ||
If you want to dynamically choose between a set of messages, you can create a record of messages and index into it. Note that this will not be tree-shaken by your bundler. | ||
```js | ||
import * as m from "./paraglide/messages" | ||
const season = { | ||
spring: m.spring, | ||
summer: m.summer, | ||
autumn: m.autumn, | ||
winter: m.winter, | ||
} | ||
const msg = season["spring"]() // Hello spring! | ||
``` | ||
Paraglide JS provides five exports in `./paraglide/runtime.js`: | ||
@@ -103,0 +118,0 @@ |
Sorry, the diff of this file is too big to display
352699
8412
366