-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
storing raw JSON values #248
Comments
No, such functionality doesn't exist in Paraglide JS but isn't the
Example message that stores a JSON as string
Calling the message and parse it as json const features = JSON.parse(m.blue_moon())
for (const feature of features) {
feature.iconName
feature.title
// ...
} |
Oh well, if that's just gonna work, then that's fair enough. However I think that it would be |
A utility function could surely be added, but I am wary of implications in an end-to-end localization process.
If the workaround works, can you close the issue for now? |
Reopening the issue as the workaround doesn't work @samuelstroschein e.g. message snippet I used: Output function of paraglide js after compilation: It makes sence as paraglide expects for the data in |
Yep certainly so. Good catch. Small clarification: Paraglide JS compiles what a plugin imported. Hence, it's the message format plugin which interprets I recommend to split the json properties into messages e.g. Updating the message format plugin or Paraglide JS does not make sense atm as both are on a new major version in the dev branch waiting for lix 1.0 to be released. |
Hey,
I am just curious if such functionalty as this exists in the paraglide-js
I would be interested in storing JSON structures which change dependingly on the language of course. Example use case:
Assuming I have
10
or more features seems to be pointless for me to store everyfeature
as standalone stringThe text was updated successfully, but these errors were encountered: