Skip to content

Instantly share code, notes, and snippets.

@beratdogan
Created May 27, 2014 13:35
Show Gist options
  • Save beratdogan/3bfcaf22901630fb6c54 to your computer and use it in GitHub Desktop.
Save beratdogan/3bfcaf22901630fb6c54 to your computer and use it in GitHub Desktop.
Google Chrome Extension Utils - with contributions of Limk.com
# You can easly internionalize your extension's HTMLs with this.
$('[data-i18n]').each ->
me = $(@)
key = me.data 'i18n'
switch me.attr 'data-i18n-method'
when 'placeholder'
me.attr 'placeholder', chrome.i18n.getMessage key
when 'value'
me.attr 'value', chrome.i18n.getMessage key
else
me.html chrome.i18n.getMessage key
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment