coderifous / jquery-localize

a jQuery plugin that makes it easy to internationalize your web site.
465 stars 142 forks source link

Localize images (src and alt attributes) #5

Closed beavisnz closed 13 years ago

beavisnz commented 13 years ago

I'm using your great plugin on a site that also requires some images to be display in the local language, along with the alternative text.

My quick and dirty implementation based on the existing code is below.

if (elem.is('img')) {
  value = valueForKey(key+'.alt', data);
  if (value) {
    elem.attr("alt", value);
  }
  value = valueForKey(key+'.src', data);
  if (value) {
    elem.attr("src", value);
  }
}
coderifous commented 13 years ago

Good idea. Coming soon.