fulcrologic / fulcro-i18n Goto Github PK
View Code? Open in Web Editor NEWInternationalization Support For Fulcro
License: MIT License
Internationalization Support For Fulcro
License: MIT License
I have a (RAD) application which supports two languages (German and Italian).
All the translations are provided by the server
Now when I initialize the application in the default language (:de) the client doesn't have any localized strings and it does not download the translations. When I switch the language to :it the localized Italian texts are downloaded. I wan't to initialize the app with the freshly downloaded localized strings from the server but I don't know if I am missing something.
I have followed every step. The only step I didn't understand was the step mentioned here:
Your Root UI component MUST query for ::i18n/current-locale and should also set the initial locale in application state. The shared-fn extracts denormalized data from your UI root’s props. This also sets the "default" locale of your application.
Now I am not sure. Is this explained in the next step?
I've tried to leave out the :translations key from the line:
::i18n/current-locale (comp/get-initial-state i18n/Locale {:locale :de :translations {}})
::i18n/current-locale (comp/get-initial-state i18n/Locale {:locale :de})
This at least downloads the translations when I switch from :it back to :de again. If I provide a :translations map nothing will ever be translated to :de.
What also works is to set the :locale to :en. So that when i change the locale the translation get's downloaded. But thats not acceptable from a UX perspective.
I am sure I am missing something. I've also tried to execute the (i18n/change-locale {:locale :de})
when I start the application (in the init function), but it didn't work.
Sorry, I am very new to the whole Fulcro (RAD) development experience so I may be making a very very silly mistake!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.