Code Monkey home page Code Monkey logo

fulcro-i18n's People

Contributors

awkay avatar fjolne avatar rynkowsg avatar timovanderkamp avatar yenda avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

fulcro-i18n's Issues

Loading server translations on first start

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!

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.