tryggvigy/pseudo-localization

Add support for toggling pseudo localization on/off

jopdeklein opened this issue · 4 comments

It could be interesting to be able to toggle between the original and the pseudo localized text on demand.

Closing this as it's just as easy as to call the start() method externally and refreshing the page as needed to reset the pseudo localization.

@jopdeklein it's an interesting idea. I've thought about this in the past but not gotten around to exploring it. Requires keeping all text nodes in memory and in sync. It's a bit involved but definitely worth looking into

True, for our particular project it's not worth the hassle, but could be interesting indeed.
My initial hacky thought was to store the original text right on the text node and flip between the original and pesudolocalized text, but not sure what Pandora's box we're opening up here.
Then again I hope nobody's needing this in a production environment :)

Yeah exactly! As long as hamlet.html is < 2s to be processed I'm happy with the performance and we can do what ever we want. I don't think it's common that projects have more than 13130 text nodes in the DOM at once. The Spotify desktop client has less than 10 times that.