Last active
December 22, 2015 16:19
-
-
Save smsohan/6498918 to your computer and use it in GitHub Desktop.
Finds and auto generates the default translations for all missing translations on a Ruby on Rails generated page. Copy this in your chrome console.
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
// this mehtod is taken from: https://gist.github.com/cyberfox/1301931 | |
var humanize = function(property) { | |
return property.replace(/_/g, ' ') | |
.replace(/(\w+)/g, function(match) { | |
return match.charAt(0).toUpperCase() + match.slice(1); | |
}); | |
}; | |
console.dir($.map($('.translation_missing'), function(e){ var key = e.title.split(":")[1].trim().substring(3); return key + ": '" + humanize(key) + "' "; })); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment