meteor-messageformat icon indicating copy to clipboard operation
meteor-messageformat copied to clipboard

Make strings reactive

Open DSpeichert opened this issue 11 years ago • 2 comments

The documentation says that strings are not reactive on purpose, to avoid content changing when translations are worked on. However, I think it would allow more flexibility in the development and less dependance on waitOn. I have a particular case where I set prototype of DataTable with mf strings and they don't get updated after I change the language. I think the impact of changing the language strings on users is minimal - probably this happens only on development environments and nobody is working on translations forever.

DSpeichert avatar Jun 18 '14 21:06 DSpeichert

The way it's designed is to allow flexibility by the project developers... the strings won't update immediately by default but things can be setup so that waitOn is not required and strings update immediately. We do translations on our production site and I'd prefer users to see the updates next time they change routes, rather than seeing things change in front of their eyes... but agree translations aren't forever and also that this should be the dev's choice. I must admit I'm a bit rusty on the options so am not including an example here but let me know if it's not clear how to do this :) Offhand I think if there isn't an option for it it should be just two lines of code in a Deps.autorun.

DataTables are a specific issue though, and a Blaze issue, not a messageformat issue. If I recall it's because direct updates of DOM element contents breaks reactivity. This is something that needs to be addressed at a Blaze level... (in Blaze or in your code... I don't use datatables so don't recall the current recommendations).

gadicc avatar Jun 23 '14 12:06 gadicc

+1 for reactive strings. even if people do see it update on the fly, it would be rare for users. but in terms of motivating your crowd sourced translators, its instant gratification for them to see their changes in the app immediately. "reload the app" is something that they may not get...

dcsan avatar Sep 25 '14 16:09 dcsan