question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support number skeleton

See original GitHub issue

I’m currently migrating one of my projects from svelte-i18n to svelte-intl-precompile and got the following error.

foo/locales/de-DE.json: Property value expected type of string but got object
TypeError: foo/locales/de-DE.json: Property value expected type of string but got object
    at Object.validate (foo/node_modules/@babel/types/lib/definitions/utils.js:159:13)
    at validateField (foo/node_modules/@babel/types/lib/validators/validate.js:24:9)
    at validate (foo/node_modules/@babel/types/lib/validators/validate.js:17:3)
    at String.builder (foo/node_modules/@babel/types/lib/builders/builder.js:39:27)
    at Object.stringLiteral (foo/node_modules/@babel/types/lib/builders/generated/index.js:357:27)
    at buildCallExpression (foo/node_modules/babel-plugin-precompile-intl/src/index.js:52:42)
    at buildTemplateLiteral (foo/node_modules/babel-plugin-precompile-intl/src/index.js:110:30)
    at buildFunction (foo/node_modules/babel-plugin-precompile-intl/src/index.js:160:67)
    at PluginPass.ObjectProperty (foo/node_modules/babel-plugin-precompile-intl/src/index.js:202:26)
    at newFn (foo/node_modules/@babel/traverse/lib/visitors.js:177:21)

After some digging I found out that the use of number skeletons (e.g Account balance {balance, number, ::currency/EUR}) is causing this error.

IMO the number skeletons are a very important part of the ICU Message Format and it would be nice if they where supported by svelte-intl-precompile

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
cibernoxcommented, May 3, 2022

Agreed. I must have missed that one as it’s one I haven’t used myself. I’m going to check https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html and see if I can get an initial implementation by the end of the week. When I do I’ll ping you so you can test if works as you expect

0reactions
cibernoxcommented, May 30, 2022

Closing since this has been released in 0.10

Read more comments on GitHub >

github_iconTop Results From Across the Web

Contact Us - SkeletonHD
Do you have a question? A suggestion? Feel free to contact us and we will be happy to help you! Get coupons and...
Read more >
ICU - Number format skeleton support
ICU number formatters support different styles, like percent, currency, scientific or decimal. Those produce locale appropriate results, ...
Read more >
Support - Skeleton Key
Get Started With A Free Consultation Today! · First Name* · Last Name* · Company* · Phone Number* · Email* · Tell Us...
Read more >
5124738_HAL-22452_12 Foot Skeleton_IS_HD_BILT_OL
Please follow the step by step guide and enjoy your 12 Foot Skeleton! ... If the item still does not work, call 1-877-527-0313...
Read more >
[3.18]Summon Skeleton Mages Necromancer build - Odealo
Absolution - A Spell that creates Minions on Kill and refreshes their duration if you've reached the maximum number of them. Onslaught Support...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found