GooglePlaySwitchLang

Easily switch between languages for app comments on Google Play

  1. // ==UserScript==
  2. // @name GooglePlaySwitchLang
  3. // @namespace IzzySoft
  4. // @description Easily switch between languages for app comments on Google Play
  5. // @license CC BY-NC-SA
  6. // @include https://play.google.com/store/apps/details?id=*
  7. // @version 3
  8. // @run-at document-idle
  9. // @grant unsafeWindow
  10. // ==/UserScript==
  11.  
  12. anchorlist = document.getElementsByClassName('Fd93Bb');
  13. if ( anchorlist.length < 1 ) anchorlist = document.getElementsByClassName('AHFaub');
  14. if (anchorlist.length > 0) {
  15. anchor = anchorlist.item(0);
  16.  
  17. span = document.createElement('span');
  18. span.setAttribute('style','margin-left:1em;font-size:13px;');
  19. //span.appendChild(document.createTextNode('(');
  20.  
  21. link = document.createElement('a');
  22. link.setAttribute('href',window.location.href + '&hl=en');
  23. link.setAttribute('title','English');
  24. link.appendChild(document.createTextNode('EN'));
  25. span.appendChild(link);
  26. span.appendChild(document.createTextNode(' | '));
  27.  
  28. link2 = document.createElement('a');
  29. link2.setAttribute('href',window.location.href + '&hl=de');
  30. link2.setAttribute('title','Deutsch');
  31. link2.appendChild(document.createTextNode('DE'));
  32. span.appendChild(link2);
  33.  
  34. //span.appendChild(document.createTextNode(')');
  35. anchor.appendChild(span);
  36. } else {
  37. console.log('Anchor not found!');
  38. }