Comments (8)
My bad for not making a v1 to v2 docs in the wiki! Will do soon. You can use the previous version for now. I'll probably deprecate the current v2 until I fix some bugs in the coming week 😬
from svelte-i18n.
In v2, as stated in the wiki (https://github.com/kaisermann/svelte-i18n/wiki/Formatting#format-or-_-or-t), you should pass your values to be interpolated inside a values
property, instead of directly to passing them to the options object.
{$_('page_indicator', { values: { currentPage: 1, totalPages: 10 }})}
from svelte-i18n.
Didn't see that change, thanks for the information. Perhaps an update guide/changelog when breaking changes occur would be a good addition to the wiki.
However, when adding the values
property it errors out completely right now:
TypeError: intl_messageformat__WEBPACK_IMPORTED_MODULE_3__ is not a constructor
I'l see if I can figure out what causes this..
from svelte-i18n.
Unpublished v2
and released 1.1.2
. Sorry for the inconvenience!
from svelte-i18n.
Formatting still doesn't seem to work in the just released 1.1.2
, but works in the older 1.1.2-beta
from svelte-i18n.
Ok, now THAT is strange. Both are the same code base. What error are you getting?
from svelte-i18n.
No errors at all, just messages not being formatted when using 1.1.2
(without specifing the values
key)
from svelte-i18n.
@wootcake I just released v2.1.0
in case you want to start testing with it. I've also updated the docs and made a quick migration guide from v1 to v2: https://github.com/kaisermann/svelte-i18n/wiki/Migration
Let me know if your issue is fixed after migrating.
from svelte-i18n.
Related Issues (20)
- How much breaking changes?
- Translations are not rendered in +error.svelte HOT 1
- Support Svelte 4 HOT 3
- Allow unit tests with ts-node esm HOT 1
- Sveltekit: Update translation outside of component
- Variable inside html isn't replaced HOT 1
- Inform about unused language keys HOT 1
- When I hover over a <a> the site language changes to the default language. HOT 1
- `intl-getcanocicallocales` is probably not a good idea HOT 2
- CJS / ESM conflict HOT 22
- Change log version comparison links are off
- Production build using svelte-i18n ^3.7.4 throws "Named export 'IntlMessageFormat' not found." HOT 6
- Problems with LIB check in cli extractor HOT 1
- Sapper reference in Getting Started guide
- Allow to restrict some parts of the i18n file to unauthorized users in SvelteKit. HOT 3
- Is it possible when registering several json files to overwrite the previous key contents with latest file?
- Docs on how to use variables in translation strings HOT 1
- How to disable AM/PM in $time formatter
- Leading zeros for day/month when formatting date values
- Add a register store?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from svelte-i18n.