Template:fx minversion inline

  • Revision slug: Template:fx_minversion_inline
  • Revision title: Template:fx minversion inline
  • Revision id: 102363
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment 1 words added, 3 words removed

Revision Content

/* one parameter: Firefox version */
/* get the page language */

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

var articleName = "Firefox " + $0 + " for developers";
var newIn = "New in ";

switch(lang) {
  case 'de':
    articleName = "Firefox " + $0 + " für Entwickler";
    newIn = "Neu in ";
    break;
  case 'es':
    articleName = "Firefox " + $0 + " para desarrolladores";
    newIn = "Nuevo en ";
    break;
  case 'fr':
    articleName = "Firefox " + $0 + " pour les développeurs";
    newIn = "Nouveau dans ";
    break;
  case 'pl':
    articleName = "Firefox " + $0 + " dla programistów";
    newIn = "Nowość w ";
    break;
  case 'pt':
    articleName = "Firefox " + $0 + " para desenvolvedores";
    newIn = "Novidade no ";
    break;
  case 'ru':
    articleName = "Firefox " + $0 + " для разработчиков";
    newIn = "Нововведение в ";
    break;
}

(web.link(wiki.uri(lang + '/' + articleName), "Firefox " + $0))

%>

Revision Source

<pre class="script">
/* one parameter: Firefox version */
/* get the page language */

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

var articleName = "Firefox " + $0 + " for developers";
var newIn = "New in ";

switch(lang) {
  case 'de':
    articleName = "Firefox " + $0 + " für Entwickler";
    newIn = "Neu in ";
    break;
  case 'es':
    articleName = "Firefox " + $0 + " para desarrolladores";
    newIn = "Nuevo en ";
    break;
  case 'fr':
    articleName = "Firefox " + $0 + " pour les développeurs";
    newIn = "Nouveau dans ";
    break;
  case 'pl':
    articleName = "Firefox " + $0 + " dla programistów";
    newIn = "Nowość w ";
    break;
  case 'pt':
    articleName = "Firefox " + $0 + " para desenvolvedores";
    newIn = "Novidade no ";
    break;
  case 'ru':
    articleName = "Firefox " + $0 + " для разработчиков";
    newIn = "Нововведение в ";
    break;
}

<span style="border: 1px solid rgb(129, 129, 81); background-color: rgb(255, 255, 225); font-size: x-small; white-space: nowrap;">(web.link(wiki.uri(lang + '/' + articleName), "Firefox " + $0))</span>

%>
Revert to this revision