mozilla

Revision 59931 of Template:bug

  • Revision slug: Template:bug
  • Revision title: Template:bug
  • Revision id: 59931
  • Created:
  • Creator: user01
  • Is current revision? No
  • Comment Included "Project_talk:" case of language determination. In fact, it strips off the start of the string up to and including colon; 36 words added, 10 words removed

Revision Content

/* get the page language */

// var u = uri.parts(Page.uri);
var lang = string.tolower(uri.parts(Page.uri).path[0]);
//if (string.contains(lang, "project")){
//  lang = string.substr(lang, 8);
//}
/* fall back to page.language on a user page */
if (string.StartsWith(lang, "user:"))
  lang = page.language;
else if (string.contains(lang, ":")
  lang = string.substr(lang, string.indexOf(lang, ":") + 1);
lang;

var bug = "bug ";

switch(lang){
  case 'ca':
    bug = "errada ";
    break;
  case 'cs':
    bug = "chyba ";
    break;
  case 'pl':
    bug = "błąd ";
    break;
}
var link = 'https://bugzilla.mozilla.org/show_bug.cgi?id=' + $0;
var linktext = bug + $0;

(linktext)

%>
      

Revision Source

<pre class="script">
/* get the page language */

// var u = uri.parts(Page.uri);
var lang = string.tolower(uri.parts(Page.uri).path[0]);
//if (string.contains(lang, "project")){
//  lang = string.substr(lang, 8);
//}
/* fall back to page.language on a user page */
if (string.StartsWith(lang, "user:"))
  lang = page.language;
else if (string.contains(lang, ":")
  lang = string.substr(lang, string.indexOf(lang, ":") + 1);
lang;

var bug = "bug ";

switch(lang){
  case 'ca':
    bug = "errada ";
    break;
  case 'cs':
    bug = "chyba ";
    break;
  case 'pl':
    bug = "błąd ";
    break;
}
var link = 'https://bugzilla.mozilla.org/show_bug.cgi?id=' + $0;
var linktext = bug + $0;

<a rel="external" href=(link) class="external">(linktext)</a>

%>
Revert to this revision