Created
May 27, 2014 13:35
-
-
Save beratdogan/3bfcaf22901630fb6c54 to your computer and use it in GitHub Desktop.
Google Chrome Extension Utils - with contributions of Limk.com
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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