Code Monkey home page Code Monkey logo

Comments (11)

jamuhl avatar jamuhl commented on June 14, 2024

Basically using i18next-icu - non of the i18next specific stuff is available...only what intl-messageformat provides...

so all things that are bound to i18next plurals, interpolation, context does not get applied...only the direct t call with messageformat specific options.

Alternative: use locize.com -> the i18next plurals work perfectly there (beside other benefits). And you directly support the people bringing i18next to you.

from i18next-icu.

jamuhl avatar jamuhl commented on June 14, 2024

if not sure if i18next format is mature enough in comparison to intl...just check https://npmtrends.com/react-i18next-vs-react-intl

from i18next-icu.

hermanbanken avatar hermanbanken commented on June 14, 2024

Note that my use case is NOT React, but something server-side. I need to be able to render to string, not asynchronous via React Suspense, etc.

Alternative: use locize.com -> the i18next plurals work perfectly there (beside other benefits). And you directly support the people bringing i18next to you.

I can't make that decision.

from i18next-icu.

jamuhl avatar jamuhl commented on June 14, 2024

i18next with both client and serverside in mind. first version basically was pure clientside js and serverside nodejs with expressjs

--> latest module for serverside: https://github.com/i18next/i18next-http-middleware

from i18next-icu.

hermanbanken avatar hermanbanken commented on June 14, 2024

Thanks for your quick reply.

Basically using i18next-icu - non of the i18next specific stuff is available...only what intl-messageformat provides...

so all things that are bound to i18next plurals, interpolation, context does not get applied...only the direct t call with messageformat specific options.

I really think this should be part of the docs! A big fat disclaimer a the top.

from i18next-icu.

jamuhl avatar jamuhl commented on June 14, 2024

https://github.com/i18next/i18next-icu/tree/master?tab=readme-ov-file#hints

from i18next-icu.

hermanbanken avatar hermanbanken commented on June 14, 2024

8811eb0
👍 ❤️

i18next-icu calls Intl immediately. I have the feeling though this is a design choice, and instead the plugin could also be implemented in a way that only the interpolation is handed off to Intl, still supporting objects, don't you agree?

from i18next-icu.

jamuhl avatar jamuhl commented on June 14, 2024

just one other sidenote to consider...there is a working group for messageformat 2 https://github.com/unicode-org/message-format-wg so the current icu stuff might be outdated midterm

from i18next-icu.

jamuhl avatar jamuhl commented on June 14, 2024

the design choice was supporting some formats beside i18next: https://www.i18next.com/overview/plugins-and-utils#i18n-formats

as those are very different eg. fluent coming with some catalog format not only single strings we made the decision you get stuff like language-detectors, backends, ... but all the interpolation, nesting, formatting,... will be as in the raw format

from i18next-icu.

hermanbanken avatar hermanbanken commented on June 14, 2024

Clear. It just wasn't clear to me that switching format you then loose all i18n features I was looking for 😅 I have static resources and a language is also already given (set in user profile), so really the only relevant thing was the interpolation & formatting. (Coming from a place where we did dictionary lookups and { } splitting & XSS-protection ourselves).

from i18next-icu.

jamuhl avatar jamuhl commented on June 14, 2024

then why not just use https://formatjs.io/docs/intl-messageformat/

from i18next-icu.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.