mozilla

Revision 115130 of Template:fx minversion header

  • Revision slug: Template:fx_minversion_header
  • Revision title: Template:fx minversion header
  • Revision id: 115130
  • Created:
  • Creator: fscholz
  • Is current revision? No
  • Comment simplified script by omitting unnecessary calls to web.text(); 9 words added, 14 words removed
Tags: 

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 = "This content covers features introduced in ";
var newInEnd = ".";

switch(lang) {
  case 'de':
    articleName = "Firefox " + $0 + " für Entwickler";
    newIn = "Dieser Artikel umfasst Features, die in ";
    newInEnd = " eingeführt wurden.";
    break;
  case 'es':
    articleName = "Firefox " + $0 + " para desarrolladores";
    newIn = "Este artículo cubre características introducidas en ";
    break;
  case 'fr':
    articleName = "Firefox " + $0 + " pour les développeurs";
    newIn = "Cet article traite de fonctionnalités introduites dans ";
    break;
  case 'ja':
    newIn = "この記事は ";
    newInEnd = " の新機能について述べています";
    break;
  case 'ko':
    newIn = "이 문서는 Firefox 개발자들을 위한 정보입니다. ";
    break;
  case 'pl':
    articleName = "Firefox " + $0 + " dla programistów";
    newIn = "Ten artykuł obejmuje funkcje wprowadzone w ";
    break;
  case 'pt':
    articleName = "Firefox " + $0 + " para desenvolvedores";
    newIn = "Este artigo cobre características introduzidas no ";
    break;
  case 'zh-cn':
    newIn = "该条目记录了 ";
    newInEnd = " 引入的新特性";
    break;
  case 'zh-tw':
    newIn = "本文描述 ";
    articleName = "Firefox " + $0 + " 技術文件";
    newInEnd = " 之後加入的功能。";
    break;
  case 'ru':
    articleName = "Firefox " + $0 + " для разработчиков";
    break;
}

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

%>

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 = "This content covers features introduced in ";
var newInEnd = ".";

switch(lang) {
  case 'de':
    articleName = "Firefox " + $0 + " für Entwickler";
    newIn = "Dieser Artikel umfasst Features, die in ";
    newInEnd = " eingeführt wurden.";
    break;
  case 'es':
    articleName = "Firefox " + $0 + " para desarrolladores";
    newIn = "Este artículo cubre características introducidas en ";
    break;
  case 'fr':
    articleName = "Firefox " + $0 + " pour les développeurs";
    newIn = "Cet article traite de fonctionnalités introduites dans ";
    break;
  case 'ja':
    newIn = "この記事は ";
    newInEnd = " の新機能について述べています";
    break;
  case 'ko':
    newIn = "이 문서는 Firefox 개발자들을 위한 정보입니다. ";
    break;
  case 'pl':
    articleName = "Firefox " + $0 + " dla programistów";
    newIn = "Ten artykuł obejmuje funkcje wprowadzone w ";
    break;
  case 'pt':
    articleName = "Firefox " + $0 + " para desenvolvedores";
    newIn = "Este artigo cobre características introduzidas no ";
    break;
  case 'zh-cn':
    newIn = "该条目记录了 ";
    newInEnd = " 引入的新特性";
    break;
  case 'zh-tw':
    newIn = "本文描述 ";
    articleName = "Firefox " + $0 + " 技術文件";
    newInEnd = " 之後加入的功能。";
    break;
  case 'ru':
    articleName = "Firefox " + $0 + " для разработчиков";
    break;
}

<div style="overflow:hidden; margin: 10px 0px; padding: 0px 10px; background-color: rgb(254, 244, 156); font-weight: bold; text-align: center;">
  <p style="margin: 4px 0px;">
    newIn;
    web.link(wiki.uri(lang + '/' + articleName), "Firefox " + $0);
    newInEnd;
  </p>
</div>

%>