Questions tagged [messageformat.js]

MessageFormat (PluralFormat + SelectFormat) is a mechanism for handling both pluralization and gender in applications.

12 questions
3
votes
0 answers

react-intl composite message

I'm struggling to work out the best way to structure messages whereby one of the dynamic values also needs a translation. For example if I have the message 'Type in Spanish...' I would like to use this message in every different combination for all…
djskinner
  • 8,035
  • 4
  • 49
  • 72
2
votes
1 answer

Fractional plural forms in react-intl or intl-messageformat (javascript i18n packages)

I am using react-intl package for internationalization. The package, in turn, relies on intl-messageformat. I’ve been searching through the docs in both packages, but am still confused about whether it is possible to internationalize messages for…
azangru
  • 2,644
  • 5
  • 34
  • 55
1
vote
1 answer

ICU expression *select* not detecting empty value

I am translating my app using i18n angular 7, and I'm having problems with a ICU expression select. The issue is that I want the condition to recognize and empty value like this: animal: string
MichaelShake
  • 238
  • 2
  • 13
1
vote
1 answer

Get JS date format string

For our Angular 4 application I'm using ngx-translate with messageformat.js for handling internationalization and localization. Is it possible to get the format string of shortdate of a date object ie. 'YYYY-MM-dd'? ie: new…
bjorkblom
  • 1,849
  • 3
  • 21
  • 31
1
vote
1 answer

Load multiple resource files in Webpack for use in messageformat.js

I have a webpack loader called messageformat-loader that takes in JSON, passes it through messageformat.js, and outputs the resulting map of format functions. It works fine with a single file. ./simple-messages.json { "simple-example": "A simple…
CletusW
  • 3,890
  • 1
  • 27
  • 42
1
vote
0 answers

Changing language with angular-translate causes error with messageformat and binding

I am trying to learn angular-translate using messageformat. When I click my button to change language, i get an error 'undefined is not a function' - but it's not 100% reliable. It happens very easily, but I am not sure which change triggers the…
0
votes
0 answers

(Format.JS) Remove '$CA' For Canadian Dollars

new IntlMessageFormat('The price is: {price, number, CAD}', 'en', { number: { CAD: { style : 'currency', currency: 'CAD' } } }).format({price: 100}) How do I modify the Intl MessageFormat to remove…
0
votes
1 answer

How to escape '/' for `SelectFormat` with MessageFormat.js

My messageFormat string looks like this: {foo, select, one/two{1-2} other{3}}, but messageFormat parser throws error because of / usage in it. I have tried, but not working: {foo, select, one'/'two{1-2} other{3}} {foo, select, 'one/two'{1-2}…
Toms Tumshais
  • 333
  • 1
  • 5
  • 15
0
votes
1 answer

Getting ngx-translate-messageformat-compiler to work with ionic

I'm trying to get an Ionic app to work with ICU messageformat translations. I'm not actually a "web" guy, I'm just trying to get a test frontend working as a proof-of-concept for my C# backend that delivers those ICU strings, so bear with me if I…
nvoigt
  • 75,013
  • 26
  • 93
  • 142
0
votes
2 answers

How to use messageformat from npm

I installed messageformat from npm for use in my angular-boostrap project in conjunction with angular-translate. If I simply add messageformat v0.3.1 via CDN, everything works as expected. But I would like to use messageformat installed from npm.…
Jette
  • 2,459
  • 28
  • 37
0
votes
1 answer

Use {select} format (format.js) with polymers app-localize-behavior

I'm doing some trials with Polymers app-localize-behavior, and I'm having a hard time to find some clear documentation regarding how to use format.js's {select} Format found here. The app-localization-behavior documentation says :…
Getter Jetter
  • 2,033
  • 1
  • 16
  • 37
0
votes
1 answer

ngTranslate with pluralization and HTML

I have a template with ngTranslate pluralization: en-US "{count, plural, one{1 accepted} other{# accepted}}" pt-BR "{count, plural, one{1 aceito} other{# aceitos}}" But I want to put the number between a span tag: en-US "{count, plural,…
Marcos Lima
  • 761
  • 1
  • 10
  • 26