mozilla

Revision 498661 of Template:cssanimatabledef

  • Revision slug: Template:cssanimatabledef
  • Revision title: Template:cssanimatabledef
  • Revision id: 498661
  • Created:
  • Creator: SJW
  • Is current revision? No
  • Comment

Revision Content

<% // $0 is the name of the definition (property or data type), without < > or '' // $1 is a string containing values describing how the animation will be done // $2 is a string containing an additional to be appended. var lang = env.locale; var str; // Note: Sorting of l10n items are specified at the bottom of this page. switch(lang) { case "de": str = { 'yes': 'Ja, ', 'as': 'als ', 'sep': ', ', // For the variable of s_desc_listof 'repeatablelist': 'mehrfache Werte der folgenden Eigenschaften: ', 'simplelist': 'ein einfacher Wert der folgenden Eigenschaften: ', // For the variable of s_desc (and s_lpc_append which is appended to s_desc_append) 'transform': 'Transformation', 'length': 'Längenangabe', 'lpc': ', Prozentsatz oder Farbe', 'integer': 'Integer', 'number': 'Nummer', 'shadowlist': 'Schatten', 'visibility': 'Sichtbarkeit', 'font_stretch': 'Schriftbreite', 'font_weight': 'Schriftgewichtung', 'rectangle': 'Rechteck' }; break; case "ja": str = { 'yes': '可。', 'as': ' の値として補完します', 'sep': ', ', // For the variable of s_desc_listof 'repeatablelist': 'の反復可能リスト', 'simplelist': 'の単純なリスト形式', // For the variable of s_desc (and s_lpc_append which is appended to s_desc_append) 'transform': 'transform', 'length': 'length', 'lpc': ' または percentage, calc();', 'lpc_append': '。両方の値が length の場合は、length 値として補完されます。両方の値が percentage の場合は、percentage 値として補完されます。それ以外の場合は、両方の値が calc() 関数にコンバートされ、length と percentage の合計になります (または各値が 0)。そして、これらの calc() 関数は、それぞれ半分ずつ補完された実数を持ちます', 'color': 'color', 'integer': 'integer', 'number': 'number', 'shadowlist': 'shadow リスト', 'visibility': 'visibility', 'font_stretch': 'font stretch', 'font_weight': 'font weight', 'rectangle': 'rectangle' }; break; case "fr": str = { 'yes': 'oui, ', 'as': "comme ", 'sep': ', ', // For the variable of s_desc_listof 'repeatablelist': 'une liste répétable de ', 'simplelist': 'une simple liste de ', // For the variable of s_desc (and s_lpc_append which is appended to s_desc_append) 'transform': 'une transformation', 'length': 'une longueur', 'lpc': ', pourcentage ou calc() ;', 'lpc_append': ' quand les deux valeurs sont des longueurs, elles sont interpolées comme des longueurs ; quand les deux valeurs sont des pourcentages, elles sont interpolées comme des pourcentages ; sinon, les deux valeurs sont converties dans une fonction calc() qui est la somme d\'une longueur et d\'un pourcentage (chaque valeur pouvant être à zéro), et cette fonction calc() interpole chaque moitié comme un nombre réel. ', 'color': 'une couleur', 'integer': 'un entier', 'number': 'un nombre', 'shadowlist': 'une liste d\'ombres', 'visibility': 'une visibilité', 'font_stretch': 'une font stretch', 'font_weight': 'une graisse de police', 'rectangle': 'un rectangle' }; break; case "en-US": default: str = { 'yes': 'yes, ', 'as': 'as ', 'sep': ', ', // For the variable of s_desc_listof 'repeatablelist': 'a repeatable list of ', 'simplelist': 'a simple list of ', // For the variable of s_desc (and s_lpc_append which is appended to s_desc_append) 'transform': 'a transform', 'length': 'a length', 'lpc': ', percentage or calc();', 'lpc_append': ' when both values are lengths, they are interpolated as lengths; when both values are percentages, they are interpolated as percentages; otherwise, both values are converted into a calc() function that is the sum of a length and a percentage (each possibly zero), and these calc() functions have each half interpolated as real numbers. ', 'color': 'a color', 'integer': 'an integer', 'number': 'a number', 'shadowlist': 'a shadow list', 'visibility': 'a visibility', 'font_stretch': 'a font stretch', 'font_weight': 'a font weight', 'rectangle': 'a rectangle' }; } // Read the word of the parameters one by one and store them in an array var values = new Array(); values = $1.split(" "); var s_desc_listof = ""; var s_desc = ""; var s_desc_append = $2; for (var i=0; i' + description + ''; %><%- result %>

Revision Source

<%
// $0 is the name of the definition (property or data type), without < > or ''
// $1 is a string containing values describing how the animation will be done
// $2 is a string containing an additional to be appended.

var lang = env.locale;
var str;

// Note: Sorting of l10n items are specified at the bottom of this page.
switch(lang) {
    case "de":
      str = {
        'yes': 'Ja, ',
        'as': 'als ',
        'sep': ', ',
        // For the variable of s_desc_listof
        'repeatablelist': 'mehrfache Werte der folgenden Eigenschaften: ',
        'simplelist': 'ein einfacher Wert der folgenden Eigenschaften: ',
        // For the variable of s_desc (and s_lpc_append which is appended to s_desc_append)
        'transform': 'Transformation',
        'length': '<a href="/' + lang + '/docs/CSS/length#Interpolation">Längenangabe</a>',
        'lpc': ', <a href="/' + lang + '/docs/CSS/percentage#Interpolation">Prozentsatz</a> oder  <a href="/' + lang + '/docs/CSS/calc<code>calc()</code></a>;',
        'lpc_append': ' wenn beides Längenwerte sind, werden sie als Längenwerte gehandhabt. Wenn beides Prozentsätze sind, werden sie als Prozentsätze gehandhabt. Ansonsten werden beide Werte wie in einer <code>calc()</code> Funktion addiert (Wird ggf. zu Null), and these calc() functions have each half interpolated as real numbers. ',
        'color': '<a href="/' + lang + '/docs/CSS/color_value#Interpolation">Farbe</a>',
        'integer': '<a href="/' + lang + '/docs/CSS/integer#Interpolation"">Integer</a>',
        'number': '<a href="/' + lang + '/docs/CSS/number#Interpolation"">Nummer</a>',
        'shadowlist': 'Schatten',
        'visibility': '<a href="/' + lang + '/docs/CSS/visibility#Interpolation">Sichtbarkeit</a>',
        'font_stretch': '<a href="/' + lang + '/docs/CSS/font-stretch#Interpolation">Schriftbreite</a>',
        'font_weight': '<a href="/' + lang + '/docs/CSS/font-weight#Interpolation">Schriftgewichtung</a>',
        'rectangle': '<a href="/' + lang + '/docs/CSS/shape#Interpolation">Rechteck</a>'
      };
      break;
    case "ja":
      str = {
        'yes': '可。',
        'as': ' の値として補完します',
        'sep': ', ',
        // For the variable of s_desc_listof
        'repeatablelist': 'の反復可能リスト',
        'simplelist': 'の単純なリスト形式',
        // For the variable of s_desc (and s_lpc_append which is appended to s_desc_append)
        'transform': 'transform',
        'length': '<a href="/' + lang + '/docs/Web/CSS/length#Interpolation" title="Values of the <length> CSS data type are interpolated as real, floating-point numbers.">length</a>',
        'lpc': ' または <a href="/' + lang + '/docs/Web/CSS/percentage#Interpolation" title="Values of the <percentage> CSS data type are interpolated as real, floating-point numbers.">percentage</a>, calc();',
        'lpc_append': '。両方の値が length の場合は、length 値として補完されます。両方の値が percentage の場合は、percentage 値として補完されます。それ以外の場合は、両方の値が calc() 関数にコンバートされ、length と percentage の合計になります (または各値が 0)。そして、これらの calc() 関数は、それぞれ半分ずつ補完された実数を持ちます',
        'color': '<a href="/' + lang + '/docs/Web/CSS/color_value#Interpolation" title="Values of the <color> CSS data type are interpolated on each of their red, green, blue components, each handled as a real, floating-point number. Note that interpolation of colors happens in the alpha-premultiplied sRGBA color space to prevent unexpected grey colors to appear.">color</a>',
        'integer': '<a href="/' + lang + '/docs/Web/CSS/integer#Interpolation" title="Values of the <integer> CSS data type are interpolated via integer discrete steps. The calculation is done as if they were real, floating-point numbers and the discrete value is obtained using the floor function.">integer</a>',
        'number': '<a href="/' + lang + '/docs/Web/CSS/number#Interpolation" title="Values of the <number> CSS data type are interpolated as real, floating-point, numbers.">number</a>',
        'shadowlist': 'shadow リスト',
        'visibility': '<a href="/' + lang + '/docs/Web/CSS/visibility#Interpolation" title="Values of the visibility CSS property are interpolable if the start or the end value is visible. In that case all values of the timing function which are equal to 1 map to visible and non-equal to 1 to non-visible.">visibility</a>',
        'font_stretch': '<a href="/' + lang + '/docs/Web/CSS/font-stretch#Interpolation" title="Font stretch values are interpolated in discrete steps. The interpolation happens as though the ordered values are equally spaced real numbers; the result is rounded to the nearest value, with values exactly halfway between two values rounded towards the later value, that is the most expanded one.">font stretch</a>',
        'font_weight': '<a href="/' + lang + '/docs/Web/CSS/font-weight#Interpolation" title="Font weight values are interpolated via discrete steps (multiples of 100). The interpolation happens in real number space and is converted to an integer by rounding to the nearest multiple of 100, with values halfway between multiples of 100 rounded towards positive infinity.">font weight</a>',
        'rectangle': '<a href="/' + lang + '/docs/Web/CSS/shape#Interpolation" title="Values of the <shape> CSS data type which are rectangles are interpolated over their top, right, bottom and left component, each treated as a real, floating-point number.">rectangle</a>'
      };
      break;
    case "fr":
      str = {
        'yes': 'oui, ',
        'as': "comme ",
        'sep': ', ',
        // For the variable of s_desc_listof
        'repeatablelist': 'une liste répétable de ',
        'simplelist': 'une simple liste de ',
        // For the variable of s_desc (and s_lpc_append which is appended to s_desc_append)
        'transform': 'une transformation',
        'length': 'une <a href="/' + lang + '/docs/CSS/longueur#Interpolation" title="Les valeurs du type <longueur> sont interpolées comme des nombres réels à virgule flottante.">longueur</a>',
        'lpc': ', <a href="/' + lang + '/docs/CSS/pourcentage#Interpolation" title="Les valeurs du type <pourcentage> sont interpolées comme des nombres réels à virgule flottante.">pourcentage</a> ou calc() ;',
        'lpc_append': ' quand les deux valeurs sont des longueurs, elles sont interpolées comme des longueurs ; quand les deux valeurs sont des pourcentages, elles sont interpolées comme des pourcentages ; sinon, les deux valeurs sont converties dans une fonction calc() qui est la somme d\'une longueur et d\'un pourcentage (chaque valeur pouvant être à zéro), et cette fonction calc() interpole chaque moitié comme un nombre réel. ',
        'color': 'une <a href="/' + lang + '/docs/CSS/valeur_de_couleur#Interpolation" title="Les valeurs de type <couleur> sont interpolées sur chacune des composantes rouge, bleue et verte, considérées chacunes comme un nombre réel à virgule flottante. Notez que l\'interpolation des couleurs a lieu dans l\'espace couleur sRGBA pré-multiplié pour éviter l\'apparition de teintes grises non désirées.">couleur</a>',
        'integer': 'un <a href="/' + lang + '/docs/CSS/entier#Interpolation" title="Les valeurs du type <entier> sont interpolées par incrémentation discrète. Le calcul est réalisé comme si les valeurs étaient des nombres réels, en virgule flottante et la valeur discrète est obtenue en utilisant la fonction partie entière.">entier</a>',
        'number': 'un <a href="/' + lang + '/docs/CSS/nombre#Interpolation" title="Les valeurs du type <nombre> sont interpolées comme des nombres réels, en virgule flottante.">nombre</a>',
        'shadowlist': 'une liste d\'ombres',
        'visibility': 'une <a href="/' + lang + '/docs/CSS/visibility#Interpolation" title="Les valeurs de la propriété CSS visibility sont interpolables si une des valeurs de début ou de fin est visible. Dans ce cas, toutes les valeurs de la fonction de temporisation qui sont égales à 1 sont associées à visible, et celles non égales à 1, à non-visible.">visibilité</a>',
        'font_stretch': 'une <a href="/' + lang + '/docs/CSS/font-stretch#Interpolation" title="Font stretch values are interpolated in discrete steps. The interpolation happens as though the ordered values are equally spaced real numbers; the result is rounded to the nearest value, with values exactly halfway between two values rounded towards the later value, that is the most expanded one.">font stretch</a>',
        'font_weight': 'une <a href="/' + lang + '/docs/CSS/font-weight#Interpolation" title="Les valeurs de graisse de police sont interpolées via des étapes discrètes (multiple de 100). L\'interpolation a lieu dans un espace de nombres réels et est convertis en un entier arroundi au plus proche multiple de 100, avec les valeurs à mis chemin entre les multiples de 100, arrondies vers l\'infini positif.">graisse de police</a>',
        'rectangle': 'un <a href="/' + lang + '/docs/CSS/shape#Interpolation" title="Values of the <shape> CSS data type which are rectangles are interpolated over their top, right, bottom and left component, each treated as a real, floating-point number.">rectangle</a>'
      };
      break;
    case "en-US":
    default:
      str = {
        'yes': 'yes, ',
        'as': 'as ',
        'sep': ', ',
        // For the variable of s_desc_listof
        'repeatablelist': 'a repeatable list of ',
        'simplelist': 'a simple list of ',
        // For the variable of s_desc (and s_lpc_append which is appended to s_desc_append)
        'transform': 'a transform',
        'length': 'a <a href="/' + lang + '/docs/CSS/length#Interpolation" title="Values of the <length> CSS data type are interpolated as real, floating-point numbers.">length</a>',
        'lpc': ', <a href="/' + lang + '/docs/CSS/percentage#Interpolation" title="Values of the <percentage> CSS data type are interpolated as real, floating-point numbers.">percentage</a> or calc();',
        'lpc_append': ' when both values are lengths, they are interpolated as lengths; when both values are percentages, they are interpolated as percentages; otherwise, both values are converted into a calc() function that is the sum of a length and a percentage (each possibly zero), and these calc() functions have each half interpolated as real numbers. ',
        'color': 'a <a href="/' + lang + '/docs/CSS/color_value#Interpolation" title="Values of the <color> CSS data type are interpolated on each of their red, green, blue components, each handled as a real, floating-point number. Note that interpolation of colors happens in the alpha-premultiplied sRGBA color space to prevent unexpected grey colors to appear.">color</a>',
        'integer': 'an <a href="/' + lang + '/docs/CSS/integer#Interpolation" title="Values of the <integer> CSS data type are interpolated via integer discrete steps. The calculation is done as if they were real, floating-point numbers and the discrete value is obtained using the floor function.">integer</a>',
        'number': 'a <a href="/' + lang + '/docs/CSS/number#Interpolation" title="Values of the <number> CSS data type are interpolated as real, floating-point, numbers.">number</a>',
        'shadowlist': 'a shadow list',
        'visibility': 'a <a href="/' + lang + '/docs/CSS/visibility#Interpolation" title="Values of the visibility CSS property are interpolable if the start or the end value is visible. In that case all values of the timing function which are equal to 1 map to visible and non-equal to 1 to non-visible.">visibility</a>',
        'font_stretch': 'a <a href="/' + lang + '/docs/CSS/font-stretch#Interpolation" title="Font stretch values are interpolated in discrete steps. The interpolation happens as though the ordered values are equally spaced real numbers; the result is rounded to the nearest value, with values exactly halfway between two values rounded towards the later value, that is the most expanded one.">font stretch</a>',
        'font_weight': 'a <a href="/' + lang + '/docs/CSS/font-weight#Interpolation" title="Font weight values are interpolated via discrete steps (multiples of 100). The interpolation happens in real number space and is converted to an integer by rounding to the nearest multiple of 100, with values halfway between multiples of 100 rounded towards positive infinity.">font weight</a>',
        'rectangle': 'a <a href="/' + lang + '/docs/CSS/shape#Interpolation" title="Values of the <shape> CSS data type which are rectangles are interpolated over their top, right, bottom and left component, each treated as a real, floating-point number.">rectangle</a>'
      };
}


// Read the word of the parameters one by one and store them in an array
var values = new Array();
values = $1.split(" ");

var s_desc_listof = "";
var s_desc = "";
var s_desc_append = $2;
for (var i=0; i<values.length; i++) {
    if (s_desc != "") {  // if the values has 2 or more s_desc.
        s_desc += str['sep'];
    }

    switch (values[i]) {
        case 'simplelist':
            s_desc_listof += str['simplelist'];
            break;
        case 'repeatablelist':
            s_desc_listof += str['repeatablelist'];
            break;
        case 'transform':
            s_desc += str['transform'];
            break;
        case 'length':
            s_desc += str['length'];
            break;
        case 'lpc':
            s_desc += str['length'] + str['lpc'];
            s_desc_append = str['lpc_append'] + s_desc_append;
            break;
        case 'color':
            s_desc += str['color'];
            break;
        case 'integer':
            s_desc += str['integer'];
            break;
        case 'number':
            s_desc += str['number'];
            break;
        case 'shadowlist':
            s_desc += str['shadowlist'];
            break;
        case 'rectangle':
            s_desc += str['rectangle'];
            break;
        case 'visibility':
            s_desc += str['visibility'];
            break;
        case 'font_stretch':
            s_desc += str['font_stretch'];
            break;
        case 'font_weight':
            s_desc += str['font_weight'];
            break;
        default:
            s_desc += '*Unknown value in DB (' + values[i] + ')*';
    }
}

// Sorting of items in the description.
var description = mdn.localString({
  "en-US": str['yes'] + str['as'] + s_desc_listof + s_desc + s_desc_append,
  "fr"   : str['yes'] + str['as'] + s_desc_listof + s_desc + s_desc_append,
  "ja"   : str['yes'] + s_desc + s_desc_listof + str['as'] + s_desc_append + '。',
  "de"   : str['yes'] + str['as'] + s_desc_listof + s_desc + s_desc_append
});

var result = '<span id="animatable-' + $0 + '">' + description + '</span>';

%><%- result %>