fabi1cazenave / webL10n

Client-side internationalization / localization library
http://fabi1cazenave.github.com/webL10n/
278 stars 70 forks source link

Add basic IE support and better manage node content translation. #6

Closed clochix closed 12 years ago

clochix commented 12 years ago

Add some tests in order to not throw exceptions in IE;

If a node as children, replace the content of the first textNode among them by the translation.

"Monsieur le Crétin des Alpes, vous serait-il possible d'intégrer dans un proche avenir les menues modifications que je viens d'effectuer avec mes humbles moyens sur votre géniale bibliothèque"

fabi1cazenave commented 12 years ago

Your patch looks good, thanks! Before I can land it I’d need:

In a perfect world, I’d love to have a “clean” code that works OK on IE9+ and modern browsers, plus a specific “dirty” code that overrides the “clean” one for IE6/7/8 — I usually put the “dirty” code in a section like:

if (window.attachEvent) { // IE<9 only
  window.attachEvent("load", function() {
    /* dirty code comes here */
  });
)

… but that could be in another patch. Thanks again for your improvements!

Le crétin des Alpes te salue bien bas.

fabi1cazenave commented 12 years ago

FTR, following our IRC conversation: this patch should enable IE8+ support.

For IE6 and IE7 we’ll have at least to have a .querySelectorAll shim (e.g. sizzle / jQuery or qwery.js).