Skip to content

Instantly share code, notes, and snippets.

@scott-ad-riley
Last active August 5, 2016 11:15
Show Gist options
  • Save scott-ad-riley/c611f6dc8becbe2cc25678c47460a4bd to your computer and use it in GitHub Desktop.
Save scott-ad-riley/c611f6dc8becbe2cc25678c47460a4bd to your computer and use it in GitHub Desktop.
Rails/Generic JS Snippets
// paste into the console of the page you are testing
// gives you a count of the times it occurs on the page, with the key for the text that is missing
(function () {var missing = {};$(".translation_missing").each(function (i, $el) {
var text = $el.title.replace('translation missing: ', '')
missing[text] = missing[text] ? missing[text] + 1 : 1;
});return missing;}())
(function () {var missing = {};[].forEach.call(document.getElementsByClassName('translation_missing'), function (div) {
var text = div.title.replace('translation missing: ','');
missing[text] = missing[text] ? missing[text] + 1 : 1;
});return missing;})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment