LanguageLibrary.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472
  1. <!DOCTYPE html>
  2. <html dir="ltr">
  3. <head>
  4. <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
  5. <title>Diagnostics/Scribunto/LanguageLibrary - XOWA</title>
  6. <link rel="shortcut icon" href="https://gnosygnu.github.io/xowa/xowa_logo.png" />
  7. <link rel="stylesheet" href="https://gnosygnu.github.io/xowa/xowa_common.css" type="text/css">
  8. </head>
  9. <body class="mediawiki ltr sitedir-ltr ns-0 ns-subject skin-vector action-submit vector-animateLayout" spellcheck="false">
  10. <div id="mw-page-base" class="noprint"></div>
  11. <div id="mw-head-base" class="noprint"></div>
  12. <div id="content" class="mw-body">
  13. <h1 id="firstHeading" class="firstHeading"><span>Diagnostics/Scribunto/LanguageLibrary</span></h1>
  14. <div id="bodyContent" class="mw-body-content">
  15. <div id="siteSub">From XOWA: the free, open-source, offline wiki application</div>
  16. <div id="contentSub"></div>
  17. <div id="mw-content-text" lang="en" dir="ltr" class="mw-content-ltr">
  18. <h2>
  19. <span class="mw-headline" id="Language_Library">Language Library</span>
  20. </h2>
  21. <ul>
  22. <li>
  23. Calls code in <a href="/wiki/Module:Diagnostics/LanguageLibrary" id="xolnki_2" title="Module:Diagnostics/LanguageLibrary">Module:Diagnostics/LanguageLibrary</a>
  24. </li>
  25. <li>
  26. Tests compatibility for <b>LanguageLibrary.php</b> and <b>mw.language.lua</b>
  27. </li>
  28. </ul>
  29. <table class="wikitable">
  30. <tr>
  31. <th>
  32. name
  33. </th>
  34. <th>
  35. code
  36. </th>
  37. <th>
  38. actl
  39. </th>
  40. <th>
  41. rslt
  42. </th>
  43. </tr>
  44. <tr>
  45. <td>
  46. <span style='color: green;'>pass</span>
  47. </td>
  48. <td>
  49. getContLangCode (by getContentLanguage)
  50. </td>
  51. <td>
  52. {{#invoke:Diagnostics/LanguageLibrary|getContLangCode}}
  53. </td>
  54. <td>
  55. en
  56. <p>
  57. <br>
  58. </p>
  59. </td>
  60. </tr>
  61. <tr>
  62. <td>
  63. <span style='color: green;'>pass</span>
  64. </td>
  65. <td>
  66. isKnownLanguageTag; true
  67. </td>
  68. <td>
  69. {{#invoke:Diagnostics/LanguageLibrary|isKnownLanguageTag|en}}
  70. </td>
  71. <td>
  72. true
  73. <p>
  74. <br>
  75. </p>
  76. </td>
  77. </tr>
  78. <tr>
  79. <td>
  80. <span style='color: green;'>pass</span>
  81. </td>
  82. <td>
  83. isKnownLanguageTag; false
  84. </td>
  85. <td>
  86. {{#invoke:Diagnostics/LanguageLibrary|isKnownLanguageTag|xyz}}
  87. </td>
  88. <td>
  89. false
  90. <p>
  91. <br>
  92. </p>
  93. </td>
  94. </tr>
  95. <tr>
  96. <td>
  97. <span style='color: green;'>pass</span>
  98. </td>
  99. <td>
  100. isValidCode; true
  101. </td>
  102. <td>
  103. {{#invoke:Diagnostics/LanguageLibrary|isValidCode|en}}
  104. </td>
  105. <td>
  106. true
  107. <p>
  108. <br>
  109. </p>
  110. </td>
  111. </tr>
  112. <tr>
  113. <td>
  114. <span style='color: green;'>pass</span>
  115. </td>
  116. <td>
  117. isValidCode; false
  118. </td>
  119. <td>
  120. {{#invoke:Diagnostics/LanguageLibrary|isValidCode|a[b}}
  121. </td>
  122. <td>
  123. false
  124. <p>
  125. <br>
  126. </p>
  127. </td>
  128. </tr>
  129. <tr>
  130. <td>
  131. <span style='color: green;'>pass</span>
  132. </td>
  133. <td>
  134. isValidBuiltInCode; true
  135. </td>
  136. <td>
  137. {{#invoke:Diagnostics/LanguageLibrary|isValidBuiltInCode|en}}
  138. </td>
  139. <td>
  140. true
  141. <p>
  142. <br>
  143. </p>
  144. </td>
  145. </tr>
  146. <tr>
  147. <td>
  148. <span style='color: green;'>pass</span>
  149. </td>
  150. <td>
  151. isValidBuiltInCode; false
  152. </td>
  153. <td>
  154. {{#invoke:Diagnostics/LanguageLibrary|isValidBuiltInCode|a#b}}
  155. </td>
  156. <td>
  157. false
  158. <p>
  159. <br>
  160. </p>
  161. </td>
  162. </tr>
  163. <tr>
  164. <td>
  165. <span style='color: green;'>pass</span>
  166. </td>
  167. <td>
  168. fetchLanguageName; code only
  169. </td>
  170. <td>
  171. {{#invoke:Diagnostics/LanguageLibrary|fetchLanguageName|en|en}}
  172. </td>
  173. <td>
  174. English
  175. <p>
  176. <br>
  177. </p>
  178. </td>
  179. </tr>
  180. <tr>
  181. <td>
  182. <span style='color: green;'>pass</span>
  183. </td>
  184. <td>
  185. fetchLanguageNames_get
  186. </td>
  187. <td>
  188. {{#invoke:Diagnostics/LanguageLibrary|fetchLanguageNames_get|fr}}
  189. </td>
  190. <td>
  191. français
  192. <p>
  193. <br>
  194. </p>
  195. </td>
  196. </tr>
  197. <tr>
  198. <td>
  199. <span style='color: green;'>pass</span>
  200. </td>
  201. <td>
  202. new
  203. </td>
  204. <td>
  205. {{#invoke:Diagnostics/LanguageLibrary|new_lang_code|fr}}
  206. </td>
  207. <td>
  208. fr
  209. <p>
  210. <br>
  211. </p>
  212. </td>
  213. </tr>
  214. <tr>
  215. <td>
  216. <span style='color: green;'>pass</span>
  217. </td>
  218. <td>
  219. formatNum; en
  220. </td>
  221. <td>
  222. {{#invoke:Diagnostics/LanguageLibrary|formatNum|1234}}
  223. </td>
  224. <td>
  225. 1,234
  226. <p>
  227. <br>
  228. </p>
  229. </td>
  230. </tr>
  231. <tr>
  232. <td>
  233. <span style='color: green;'>pass</span>
  234. </td>
  235. <td>
  236. parseFormatteNum; en
  237. </td>
  238. <td>
  239. {{#invoke:Diagnostics/LanguageLibrary|parseFormattedNum|1,234}}
  240. </td>
  241. <td>
  242. 1,234
  243. <p>
  244. <br>
  245. </p>
  246. </td>
  247. </tr>
  248. <tr>
  249. <td>
  250. <span style='color: green;'>pass</span>
  251. </td>
  252. <td>
  253. formatDate via pcall; y;
  254. </td>
  255. <td>
  256. {{#invoke:Diagnostics/LanguageLibrary|formatDate_valid|Y-m-d|2014-03-25}}
  257. </td>
  258. <td>
  259. y
  260. <p>
  261. <br>
  262. </p>
  263. </td>
  264. </tr>
  265. <tr>
  266. <td>
  267. <span style='color: green;'>pass</span>
  268. </td>
  269. <td>
  270. formatDate via pcall; n;
  271. </td>
  272. <td>
  273. {{#invoke:Diagnostics/LanguageLibrary|formatDate_valid|Y-m-d|fail}}
  274. </td>
  275. <td>
  276. n
  277. <p>
  278. <br>
  279. </p>
  280. </td>
  281. </tr>
  282. <tr>
  283. <td>
  284. <span style='color: green;'>pass</span>
  285. </td>
  286. <td>
  287. convertGrammar
  288. </td>
  289. <td>
  290. {{#invoke:Diagnostics/LanguageLibrary|convertGrammar|fi|talo|elative}}
  291. </td>
  292. <td>
  293. talosta
  294. <p>
  295. <br>
  296. </p>
  297. </td>
  298. </tr>
  299. <tr>
  300. <td>
  301. <span style='color: green;'>pass</span>
  302. </td>
  303. <td>
  304. isRTL; en
  305. </td>
  306. <td>
  307. {{#invoke:Diagnostics/LanguageLibrary|isRTL|en}}
  308. </td>
  309. <td>
  310. false
  311. <p>
  312. <br>
  313. </p>
  314. </td>
  315. </tr>
  316. <tr>
  317. <td>
  318. <span style='color: green;'>pass</span>
  319. </td>
  320. <td>
  321. isRTL; ar
  322. </td>
  323. <td>
  324. {{#invoke:Diagnostics/LanguageLibrary|isRTL|ar}}
  325. </td>
  326. <td>
  327. true
  328. <p>
  329. <br>
  330. </p>
  331. </td>
  332. </tr>
  333. <tr>
  334. <td>
  335. <span style='color: green;'>pass</span>
  336. </td>
  337. <td>
  338. format_durations_hms
  339. </td>
  340. <td>
  341. {{#invoke:Diagnostics/LanguageLibrary|format_durations_hms|123}}
  342. </td>
  343. <td>
  344. 2 minutes and 3 seconds
  345. <p>
  346. <br>
  347. </p>
  348. </td>
  349. </tr>
  350. <tr>
  351. <td>
  352. <span style='color: green;'>pass</span>
  353. </td>
  354. <td>
  355. get_duration_intervals_hms
  356. </td>
  357. <td>
  358. {{#invoke:Diagnostics/LanguageLibrary|get_duration_intervals_hms|123}}
  359. </td>
  360. <td>
  361. ,2,3
  362. <p>
  363. <br>
  364. </p>
  365. </td>
  366. </tr>
  367. </table>
  368. </div>
  369. </div>
  370. </div>
  371. <div id="mw-head" class="noprint">
  372. <div id="left-navigation">
  373. <div id="p-namespaces" class="vectorTabs">
  374. <h3>Namespaces</h3>
  375. <ul>
  376. <li id="ca-nstab-main" class="selected"><span><a id="ca-nstab-main-href" href="index.html">Page</a></span></li>
  377. </ul>
  378. </div>
  379. </div>
  380. </div>
  381. <div id='mw-panel' class='noprint'>
  382. <div id='p-logo'>
  383. <a style="background-image: url(https://gnosygnu.github.io/xowa/xowa_logo.png);" href="http://xowa.org/" title="Visit the main page"></a>
  384. </div>
  385. <div class="portal" id='xowa-portal-home'>
  386. <h3>XOWA</h3>
  387. <div class="body">
  388. <ul>
  389. <li><a href="http://xowa.org/index.html" title='Visit the main page'>Main page</a></li>
  390. <li><a href="http://xowa.org/screenshots.html" title='See screenshots of XOWA'>Screenshots</a></li>
  391. <li><a href="https://www.youtube.com/watch?v=q0qbXYXEH6M" title="See a video of XOWA Desktop in action">Video</a></li>
  392. <li><a href="http://xowa.org/home/wiki/Help/Download_XOWA.html" title='Download the XOWA application'>Download XOWA</a></li>
  393. <li><a href="http://xowa.org/home/wiki/Dashboard/Image_databases.html" title='Download offline wikis and image databases'>Download wikis</a></li>
  394. </ul>
  395. </div>
  396. </div>
  397. <div class="portal" id='xowa-portal-started'>
  398. <h3>Getting started</h3>
  399. <div class="body">
  400. <ul>
  401. <li><a href="http://xowa.org/home/wiki/App/Setup/System_requirements.html" title='Get XOWA&apos;s system requirements'>Requirements</a></li>
  402. <li><a href="http://xowa.org/home/wiki/App/Setup/Installation.html" title='Get instructions for installing XOWA'>Installation</a></li>
  403. <li><a href="http://xowa.org/home/wiki/App/Import/Simple_Wikipedia.html" title='Learn how to set up Simple Wikipedia'>Simple Wikipedia</a></li>
  404. <li><a href="http://xowa.org/home/wiki/App/Import/English_Wikipedia.html" title='Learn how to set up English Wikipedia'>English Wikipedia</a></li>
  405. <li><a href="http://xowa.org/home/wiki/App/Import/Other_wikis.html" title='Learn how to set up other Wikipedias'>Other Wikipedias</a></li>
  406. </ul>
  407. </div>
  408. </div>
  409. <div class="portal" id='xowa-portal-android'>
  410. <h3>Android</h3>
  411. <div class="body">
  412. <ul>
  413. <li><a href="http://xowa.org/home/wiki/Android/Setup.html" title='Setup XOWA on your Android device'>Setup</a></li>
  414. <li><a href="https://www.youtube.com/watch?v=jsMTBxGweUw" title="See a video of XOWA Android in action">Video</a></li>
  415. </ul>
  416. </div>
  417. </div>
  418. <div class="portal" id='xowa-portal-help'>
  419. <h3>Help</h3>
  420. <div class="body">
  421. <ul>
  422. <li><a href="http://xowa.org/home/wiki/Help/About.html" title='Get more information about XOWA'>About</a></li>
  423. <li><a href="http://xowa.org/home/wiki/Help/Contents.html" title='View a list of help topics'>Contents</a></li>
  424. <li><a href="http://xowa.org/home/wiki/Help/Media.html" title='Read what others have written about XOWA'>Media</a></li>
  425. <li><a href="http://xowa.org/home/wiki/Help/Feedback.html" title='Questions? Comments? Leave feedback for XOWA'>Feedback</a></li>
  426. </ul>
  427. </div>
  428. </div>
  429. <div class="portal" id='xowa-portal-blog'>
  430. <h3>Blog</h3>
  431. <div class="body">
  432. <ul>
  433. <li><a href="http://xowa.org/home/wiki/Blog.html" title='Follow XOWA''s development process'>Current</a></li>
  434. </ul>
  435. </div>
  436. </div>
  437. <div class="portal" id='xowa-portal-links'>
  438. <h3>Links</h3>
  439. <div class="body">
  440. <ul>
  441. <li><a href="http://dumps.wikimedia.org/backup-index.html" title="Get wiki datababase dumps directly from Wikimedia">Wikimedia dumps</a></li>
  442. <li><a href="https://archive.org/search.php?query=xowa" title="Search archive.org for XOWA files">XOWA @ archive.org</a></li>
  443. <li><a href="http://en.wikipedia.org" title="Visit Wikipedia (and compare to XOWA!)">English Wikipedia</a></li>
  444. </ul>
  445. </div>
  446. </div>
  447. <div class="portal" id='xowa-portal-donate'>
  448. <h3>Donate</h3>
  449. <div class="body">
  450. <ul>
  451. <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/ -->
  452. <li><a href="https://donate.wikimedia.org/wiki/Special:FundraiserRedirector" title="Support Wikipedia!">Wikipedia</a></li>
  453. <li><a href="http://xowa.org/home/wiki/Help/Donate.html" title="Support XOWA!">XOWA</a></li>
  454. </ul>
  455. </div>
  456. </div>
  457. </div>
  458. </body>
  459. </html>