Skip to content

Why the need for a leptos-specific i18n library? How does this library differ from rust-i18n ? #47

Answered by Baptistemontan
dessalines asked this question in Q&A
Discussion options

You must be logged in to vote

Multiple reasons:

  • Integration with the reactive system of leptos
  • Support interpolation of any leptos::IntoView types
  • Support interpolation of Leptos components

Also rust-i18n use a different philosophie, they do load locales at compile time but just to embbed them in the binary and avoid loading them at runtime, it is still some kind of HashMap<Key, String> (not exactly, but you get the point). Here the locale is completly reconstructed as the type level, if you try to access a key not existing it will not compile, when you access a key it's a direct access of the value (minus the match on the locale). Even the declared languages are turned into a Enum, you can't set the lang to an unsu…

Replies: 2 comments 8 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by dessalines
Comment options

You must be logged in to vote
8 replies
@dessalines
Comment options

@Baptistemontan
Comment options

@Baptistemontan
Comment options

@dessalines
Comment options

@Baptistemontan
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants