Jump to content

Template:Translated From/code: Difference between revisions

From CC Public Wiki
No edit summary
Matt Lee (talk | contribs)
Blanked the page
 
(14 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly><!--
--><table width=100% {{#if:{{{rtl|}}}|dir="rtl"}} style="background:#EEF3E2; border-collapse:collapse; font-size:90%;">
      <tr>
        <td width=1% valign=top style="padding-left:10px; padding-top:4px; padding-bottom:4px;"><!--
        -->[[{{Translation of|CC Wiki:Translate}}|{{{message-languages|}}}]]&nbsp;<!--
      --></td>
        <td style="padding-right:10px; padding-top:4px; padding-bottom:4px;"><!--
        -->{{#if:{{{source|}}}


                param "source=" provided, produce list of languages
              | {{#arraydefine:a|<!--
              -->{{#arraymap:{{#ask: [[:{{{source}}}]][[Has translation::+]]|?Has translation#=|format=list}},{{{source}}}<!--
                -->|,<!--
                -->|@@@@<!--
                    hidden sort element, to sort language names properly (space at end is needed)
                -->|<span style="display:none">{{#language:{{#ask:[[:@@@@]]|?Has language#=}}}} </span><!--
                    if the language we are treating is the translation source language
                  -->{{#if:{{#ask: [[:@@@@]][[Has translation::+]]|?Has translation#=|format=list}}<!--
                        it is, output the language with a title that contains the revision number
                    -->|[[:@@@@|<span class="plainlinks" title="@@@@ (rev:{{#ask:[[:@@@@]]|?Last revision#=}})"><!--
                                -->{{#language: {{#ask:[[:@@@@]]|?Has language#=}}}}<!--
                            --></span>]]<!--
                        it's not, normal output
                        language name
                    -->|[[:@@@@|{{#language: {{#ask:[[:@@@@]]|?Has language#=}}}}]]<!--
                        if a revision was specified
                    -->{{#if:{{{rev|}}}<!--
                          if the language we are treating now is this page's language
                      -->|{{#ifeq:{{Language code of page|@@@@}}|{{Language code of page}}<!--
                              produce the up-to-date indicator
                          -->|&nbsp;{{{{Translation of|Template:Diff since trans}}|source={{{source}}}|rev={{{rev}}}}}<!--
                        -->}}<!--
                    -->}}<!--
                  -->}}<!--
              -->}}<!-- close #arraymap
              -->|,<!--
                  get rid of duplicates and sort alphabetically (see hidden sort element above)
              -->|unique,sort=asc<!--
            -->}}<!-- close #arraydefine
                  output array with the pipe separators
            -->{{#arrayprint:a|&nbsp;&nbsp;&#124;&nbsp;&#32;|@@@@|@@@@}}<!--
            -->{{#arrayreset:a}}<!--
                no param "source=" provided, categorize as untranslated
          -->| {{{message-no-known-translations|}}}
                [[{{Translation of|Category:Untranslated}}]]
            }}<!--
      --></td><!--
  --></tr>
  </table><!--
-->{{Assign property Translated from|{{{source|}}}}}<!--
-->{{Assign property Has language}}</includeonly><noinclude>
This is the code page for [[Template:Translated From]]. Please refer to that template for instructions.
[[Category:Support translation templates]]
</noinclude>

Latest revision as of 21:10, 9 June 2015