martinandert / react-translate-component

A component for React that utilizes the Counterpart module to provide multi-lingual/localized text content.
MIT License
322 stars 31 forks source link

Question: why not translate in the rendering engine #13

Closed jcalfee closed 8 years ago

jcalfee commented 8 years ago

Seems like one could apply translations in react's DOM patch before it hits the real DOM. A simple set of regular expressions would take most of the translations out of the code and move it into the external translation resources. This seems more consistent with modern localization software in my experience.

Please comment... Thank you.

martinandert commented 8 years ago

@jcalfee Sorry but I don't get it. Could you give me an example (a gist) of what you're trying to achieve?

Thanks

martinandert commented 8 years ago

Closing because of staleness.

jcalfee commented 8 years ago

I'm just suggesting to not have translations in the code and instead move it to the dom rendering layer. This will save a ton of effort on the part of the coders. In react this needs to happen in a way so that reacts DOM comparison is always translating then comparing to the translated DOM. You can still put translations in the code, most of the tedious translation work will not be needed anymore.

jcalfee commented 8 years ago

I apologize, I missed your first comment.