<!DOCTYPE html>
<html dir="ltr">
<head>
  <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
  <title>Diagnostics/Scribunto/LanguageLibrary - XOWA</title>
  <link rel="shortcut icon" href="https://gnosygnu.github.io/xowa/xowa_logo.png" />
  <link rel="stylesheet" href="https://gnosygnu.github.io/xowa/xowa_common.css" type="text/css">
  
</head>
<body class="mediawiki ltr sitedir-ltr ns-0 ns-subject skin-vector action-submit vector-animateLayout" spellcheck="false">
<div id="mw-page-base" class="noprint"></div>
<div id="mw-head-base" class="noprint"></div>
<div id="content" class="mw-body">
  <h1 id="firstHeading" class="firstHeading"><span>Diagnostics/Scribunto/LanguageLibrary</span></h1>
  <div id="bodyContent" class="mw-body-content">
    <div id="siteSub">From XOWA: the free, open-source, offline wiki application</div>
    <div id="contentSub"></div>
    <div id="mw-content-text" lang="en" dir="ltr" class="mw-content-ltr">
    
    <h2>
      <span class="mw-headline" id="Language_Library">Language Library</span>
    </h2>
    <ul>
      <li>
        Calls code in <a href="http://xowa.org/wiki/home/page/Module:Diagnostics/LanguageLibrary.html" id="xolnki_2" title="Module:Diagnostics/LanguageLibrary">Module:Diagnostics/LanguageLibrary</a>
      </li>
      <li>
        Tests compatibility for <b>LanguageLibrary.php</b> and <b>mw.language.lua</b>
      </li>
    </ul>
    <table class="wikitable">
      <tr>
        <th>
          name
        </th>
        <th>
          code
        </th>
        <th>
          actl
        </th>
        <th>
          rslt
        </th>
      </tr>
      <tr>
        <td>
          getContLangCode (by getContentLanguage)
        </td>
        <td>
          {{#invoke:Diagnostics/LanguageLibrary|getContLangCode}}
        </td>
        <td>
          en
        </td>
        <td>
          <span style='color: green;'>pass</span>
        </td>
      </tr>
      <tr>
        <td>
          isKnownLanguageTag; true
        </td>
        <td>
          {{#invoke:Diagnostics/LanguageLibrary|isKnownLanguageTag|en}}
        </td>
        <td>
          true
        </td>
        <td>
          <span style='color: green;'>pass</span>
        </td>
      </tr>
      <tr>
        <td>
          isKnownLanguageTag; false
        </td>
        <td>
          {{#invoke:Diagnostics/LanguageLibrary|isKnownLanguageTag|xyz}}
        </td>
        <td>
          false
        </td>
        <td>
          <span style='color: green;'>pass</span>
        </td>
      </tr>
      <tr>
        <td>
          isValidCode; true
        </td>
        <td>
          {{#invoke:Diagnostics/LanguageLibrary|isValidCode|en}}
        </td>
        <td>
          true
        </td>
        <td>
          <span style='color: green;'>pass</span>
        </td>
      </tr>
      <tr>
        <td>
          isValidCode; false
        </td>
        <td>
          {{#invoke:Diagnostics/LanguageLibrary|isValidCode|a[b}}
        </td>
        <td>
          false
        </td>
        <td>
          <span style='color: green;'>pass</span>
        </td>
      </tr>
      <tr>
        <td>
          isValidBuiltInCode; true
        </td>
        <td>
          {{#invoke:Diagnostics/LanguageLibrary|isValidBuiltInCode|en}}
        </td>
        <td>
          true
        </td>
        <td>
          <span style='color: green;'>pass</span>
        </td>
      </tr>
      <tr>
        <td>
          isValidBuiltInCode; false
        </td>
        <td>
          {{#invoke:Diagnostics/LanguageLibrary|isValidBuiltInCode|a#b}}
        </td>
        <td>
          false
        </td>
        <td>
          <span style='color: green;'>pass</span>
        </td>
      </tr>
      <tr>
        <td>
          fetchLanguageName; code only
        </td>
        <td>
          {{#invoke:Diagnostics/LanguageLibrary|fetchLanguageName|en|en}}
        </td>
        <td>
          English
        </td>
        <td>
          <span style='color: green;'>pass</span>
        </td>
      </tr>
      <tr>
        <td>
          fetchLanguageNames_get
        </td>
        <td>
          {{#invoke:Diagnostics/LanguageLibrary|fetchLanguageNames_get|fr}}
        </td>
        <td>
          French
        </td>
        <td>
          <span style='color: green;'>pass</span>
        </td>
      </tr>
      <tr>
        <td>
          new
        </td>
        <td>
          {{#invoke:Diagnostics/LanguageLibrary|new_lang_code|fr}}
        </td>
        <td>
          fr
        </td>
        <td>
          <span style='color: green;'>pass</span>
        </td>
      </tr>
      <tr>
        <td>
          formatNum; en
        </td>
        <td>
          {{#invoke:Diagnostics/LanguageLibrary|formatNum|1234}}
        </td>
        <td>
          1,234
        </td>
        <td>
          <span style='color: green;'>pass</span>
        </td>
      </tr>
      <tr>
        <td>
          parseFormatteNum; en
        </td>
        <td>
          {{#invoke:Diagnostics/LanguageLibrary|parseFormattedNum|1,234}}
        </td>
        <td>
          1,234
        </td>
        <td>
          <span style='color: green;'>pass</span>
        </td>
      </tr>
      <tr>
        <td>
          formatDate via pcall; y;
        </td>
        <td>
          {{#invoke:Diagnostics/LanguageLibrary|formatDate_valid|Y-m-d|2014-03-25}}
        </td>
        <td>
          y
        </td>
        <td>
          <span style='color: green;'>pass</span>
        </td>
      </tr>
      <tr>
        <td>
          formatDate via pcall; n;
        </td>
        <td>
          {{#invoke:Diagnostics/LanguageLibrary|formatDate_valid|Y-m-d|fail}}
        </td>
        <td>
          n
        </td>
        <td>
          <span style='color: green;'>pass</span>
        </td>
      </tr>
      <tr>
        <td>
          convertGrammar
        </td>
        <td>
          {{#invoke:Diagnostics/LanguageLibrary|convertGrammar|fi|talo|elative}}
        </td>
        <td>
          talosta
        </td>
        <td>
          <span style='color: green;'>pass</span>
        </td>
      </tr>
      <tr>
        <td>
          isRTL; en
        </td>
        <td>
          {{#invoke:Diagnostics/LanguageLibrary|isRTL|en}}
        </td>
        <td>
          false
        </td>
        <td>
          <span style='color: green;'>pass</span>
        </td>
      </tr>
      <tr>
        <td>
          isRTL; ar
        </td>
        <td>
          {{#invoke:Diagnostics/LanguageLibrary|isRTL|ar}}
        </td>
        <td>
          true
        </td>
        <td>
          <span style='color: green;'>pass</span>
        </td>
      </tr>
      <tr>
        <td>
          format_durations_hms
        </td>
        <td>
          {{#invoke:Diagnostics/LanguageLibrary|format_durations_hms|123}}
        </td>
        <td>
          2 minutes and 3 seconds
        </td>
        <td>
          <span style='color: green;'>pass</span>
        </td>
      </tr>
      <tr>
        <td>
          get_duration_intervals_hms
        </td>
        <td>
          {{#invoke:Diagnostics/LanguageLibrary|get_duration_intervals_hms|123}}
        </td>
        <td>
          ,2,3
        </td>
        <td>
          <span style='color: green;'>pass</span>
        </td>
      </tr>
    </table>
  
    </div>
  </div>
</div>


<div id="mw-head" class="noprint">
  <div id="left-navigation">
    <div id="p-namespaces" class="vectorTabs">
      <h3>Namespaces</h3>
      <ul>
        <li  id="ca-nstab-main" class="selected"><span><a id="ca-nstab-main-href" href="index.html">Page</a></span></li>
      </ul>
    </div>
  </div>
</div>

<div id='mw-panel' class='noprint'>
  <div id='p-logo'>
    <a style="background-image: url(https://gnosygnu.github.io/xowa/xowa_logo.png);" href="http://xowa.org/" title="Visit the main page"></a>
  </div>
  <div class="portal" id='xowa-portal-home'>
    <h3>XOWA</h3>
    <div class="body">
      <ul>
        <li><a href="http://xowa.org/index.html" title='Visit the main page'>Main page</a></li>
        <li><a href="http://xowa.org/screenshots.html" title='See screenshots of XOWA'>Screenshots</a></li>
        <li><a href="http://xowa.org/wiki/home/page/Help/Download_XOWA.html" title='Download the XOWA application'>Download XOWA</a></li>
        <li><a href="http://xowa.org/wiki/home/page/Dashboard/Image_databases.html" title='Download offline wikis and image databases'>Download wikis</a></li>
      </ul>
    </div>
  </div>

  <div class="portal" id='xowa-portal-started'>
    <h3>Getting started</h3>
    <div class="body">
      <ul>
        <li><a href="http://xowa.org/wiki/home/page/App/Setup/System_requirements.html" title='Get XOWA&apos;s system requirements'>Requirements</a></li>
        <li><a href="http://xowa.org/wiki/home/page/App/Setup/Installation.html" title='Get instructions for installing XOWA'>Installation</a></li>
        <li><a href="http://xowa.org/wiki/home/page/App/Import/Simple_Wikipedia.html" title='Learn how to set up Simple Wikipedia'>Simple Wikipedia</a></li>
        <li><a href="http://xowa.org/wiki/home/page/App/Import/English_Wikipedia.html" title='Learn how to set up English Wikipedia'>English Wikipedia</a></li>
        <li><a href="http://xowa.org/wiki/home/page/App/Import/Other_wikis.html" title='Learn how to set up other Wikipedias'>Other Wikipedias</a></li>
      </ul>
    </div>
  </div>

  <div class="portal" id='xowa-portal-android'>
    <h3>Android</h3>
    <div class="body">
      <ul>
        <li><a href="http://xowa.org/wiki/home/page/Android/Setup.html" title='Setup XOWA on your Android device'>Setup</a></li>
      </ul>
    </div>
  </div>

  <div class="portal" id='xowa-portal-help'>
    <h3>Help</h3>
    <div class="body">
      <ul>
        <li><a href="http://xowa.org/wiki/home/page/Help/About.html" title='Get more information about XOWA'>About</a></li>
        <li><a href="http://xowa.org/wiki/home/page/Help/Contents.html" title='View a list of help topics'>Contents</a></li>
        <li><a href="http://xowa.org/wiki/home/page/Help/Media.html" title='Read what others have written about XOWA'>Media</a></li>
        <li><a href="http://xowa.org/wiki/home/page/Help/Feedback.html" title='Questions? Comments? Leave feedback for XOWA'>Feedback</a></li>
      </ul>
    </div>
  </div>
  
  <div class="portal" id='xowa-portal-blog'>
    <h3>Blog</h3>
    <div class="body">
      <ul>
        <li><a href="http://xowa.org/wiki/home/page/Blog.html" title='Follow XOWA''s development process'>Current</a></li>
      </ul>
    </div>
  </div>

  <div class="portal" id='xowa-portal-links'>
    <h3>Links</h3>
    <div class="body">
      <ul>
        <li><a href="http://dumps.wikimedia.org/backup-index.html" title="Get wiki datababase dumps directly from Wikimedia">Wikimedia dumps</a></li>
        <li><a href="https://archive.org/search.php?query=xowa" title="Search archive.org for XOWA files">XOWA @ archive.org</a></li>
        <li><a href="http://en.wikipedia.org" title="Visit Wikipedia (and compare to XOWA!)">English Wikipedia</a></li>
      </ul>
    </div>
  </div>

  <div class="portal" id='xowa-portal-donate'>
    <h3>Donate</h3>
    <div class="body">
      <ul>
        <li><a href="https://archive.org/donate/index.php" title="Support archive.org!">archive.org</a></li><!-- listed first due to recent fire damages: http://blog.archive.org/2013/11/06/scanning-center-fire-please-help-rebuild/ -->
        <li><a href="https://donate.wikimedia.org/wiki/Special:FundraiserRedirector" title="Support Wikipedia!">Wikipedia</a></li>
        <!-- <li><a href="" title="Support XOWA! (but only after you've supported archive.org and Wikipedia)">XOWA</a></li> -->
      </ul>
    </div>
  </div>
</div>
</body>
</html>