localization.html 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width,initial-scale=1">
  6. <title>Localizing jME 3 Games :: jMonkeyEngine Docs</title>
  7. <link rel="canonical" href="https://wiki.jmonkeyengine.org/docs/jme3/advanced/localization.html">
  8. <meta name="generator" content="Antora 2.3.3">
  9. <link rel="stylesheet" href="../../../_/css/site.css">
  10. <meta property="og:image" content="https://wiki.jmonkeyengine.org/_/img/iconx128.png">
  11. <meta property="og:description" content="Localizing jME 3 Games">
  12. <meta property="og:title" content="jMonkeyEngine Docs">
  13. <link rel="stylesheet" href="../../../_/css/site-extra.css">
  14. <link rel="stylesheet" href="../../../_/css/vendor/docsearch.min.css">
  15. <!-- fetched from https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css -->
  16. <link rel="icon" href="../../../_/img/favicon.ico" type="image/x-icon">
  17. </head>
  18. <body class="article">
  19. <header class="header">
  20. <nav class="navbar">
  21. <div class="navbar-brand">
  22. <a class="navbar-item" href="https://wiki.jmonkeyengine.org">
  23. <img alt="" src="../../../_/img/jme-logo.png" height="32" type="image/x-icon">
  24. </a>
  25. <div class="navbar-item hide-for-print">
  26. <input id="search-input" type="text" placeholder="Search docs">
  27. </div>
  28. <button class="navbar-burger" data-target="topbar-nav">
  29. <span></span>
  30. <span></span>
  31. <span></span>
  32. </button>
  33. </div>
  34. <div id="topbar-nav" class="navbar-menu">
  35. <div class="navbar-end">
  36. <div class="navbar-item theme-switch-wrapper">
  37. <label class="theme-switch" for="checkbox">
  38. <input type="checkbox" id="checkbox" />
  39. <div class="slider round"></div>
  40. </label>
  41. </div>
  42. <a class="navbar-item" href="https://github.com/jmonkeyengine/wiki">Github</a>
  43. </div>
  44. </div>
  45. </nav>
  46. </header>
  47. <div class="body">
  48. <div class="nav-container" data-component="docs" data-version="master">
  49. <aside class="nav">
  50. <div class="panels">
  51. <div class="nav-panel-menu is-active" data-panel="menu">
  52. <nav class="nav-menu">
  53. <h3 class="title"><a href="../../documentation.html">Docs</a></h3>
  54. <ul class="nav-list">
  55. <li class="nav-item" data-depth="0">
  56. <ul class="nav-list">
  57. <li class="nav-item" data-depth="1">
  58. <a class="nav-link" href="../../documentation.html">Getting Started</a>
  59. </li>
  60. <li class="nav-item" data-depth="1">
  61. <a class="nav-link" href="https://javadoc.jmonkeyengine.org/v3.3.2-stable">JavaDoc</a>
  62. </li>
  63. <li class="nav-item" data-depth="1">
  64. <button class="nav-item-toggle"></button>
  65. <a class="nav-link" href="../../jme3.html">jMonkeyEngine 3</a>
  66. <ul class="nav-list">
  67. <li class="nav-item" data-depth="2">
  68. <button class="nav-item-toggle"></button>
  69. <span class="nav-text">Beginner Tutorials</span>
  70. <ul class="nav-list">
  71. <li class="nav-item" data-depth="3">
  72. <a class="nav-link" href="../beginner/hello_simpleapplication.html">Hello SimpleApplication</a>
  73. </li>
  74. <li class="nav-item" data-depth="3">
  75. <a class="nav-link" href="../beginner/hello_node.html">Hello Node</a>
  76. </li>
  77. <li class="nav-item" data-depth="3">
  78. <a class="nav-link" href="../beginner/hello_asset.html">Hello Asset</a>
  79. </li>
  80. <li class="nav-item" data-depth="3">
  81. <a class="nav-link" href="../beginner/hello_main_event_loop.html">Hello Main Event Loop</a>
  82. </li>
  83. <li class="nav-item" data-depth="3">
  84. <a class="nav-link" href="../beginner/hello_input_system.html">Hello Input System</a>
  85. </li>
  86. <li class="nav-item" data-depth="3">
  87. <a class="nav-link" href="../beginner/hello_material.html">Hello Material</a>
  88. </li>
  89. <li class="nav-item" data-depth="3">
  90. <a class="nav-link" href="../beginner/hello_animation.html">Hello Animation</a>
  91. </li>
  92. <li class="nav-item" data-depth="3">
  93. <a class="nav-link" href="../beginner/hello_picking.html">Hello Picking</a>
  94. </li>
  95. <li class="nav-item" data-depth="3">
  96. <a class="nav-link" href="../beginner/hello_collision.html">Hello Collision</a>
  97. </li>
  98. <li class="nav-item" data-depth="3">
  99. <a class="nav-link" href="../beginner/hello_terrain.html">Hello Terrain</a>
  100. </li>
  101. <li class="nav-item" data-depth="3">
  102. <a class="nav-link" href="../beginner/hello_audio.html">Hello Audio</a>
  103. </li>
  104. <li class="nav-item" data-depth="3">
  105. <a class="nav-link" href="../beginner/hello_effects.html">Hello Effects</a>
  106. </li>
  107. <li class="nav-item" data-depth="3">
  108. <a class="nav-link" href="../beginner/hello_physics.html">Hello Physics</a>
  109. </li>
  110. </ul>
  111. </li>
  112. <li class="nav-item" data-depth="2">
  113. <button class="nav-item-toggle"></button>
  114. <span class="nav-text">Intermediate Tutorials</span>
  115. <ul class="nav-list">
  116. <li class="nav-item" data-depth="3">
  117. <button class="nav-item-toggle"></button>
  118. <span class="nav-text">Concepts</span>
  119. <ul class="nav-list">
  120. <li class="nav-item" data-depth="4">
  121. <a class="nav-link" href="../intermediate/best_practices.html">Best Practices</a>
  122. </li>
  123. <li class="nav-item" data-depth="4">
  124. <a class="nav-link" href="../intermediate/simpleapplication.html">Simple Application</a>
  125. </li>
  126. <li class="nav-item" data-depth="4">
  127. <a class="nav-link" href="../features.html">Features</a>
  128. </li>
  129. <li class="nav-item" data-depth="4">
  130. <a class="nav-link" href="../intermediate/optimization.html">Optimization</a>
  131. </li>
  132. <li class="nav-item" data-depth="4">
  133. <a class="nav-link" href="../faq.html">FAQ</a>
  134. </li>
  135. </ul>
  136. </li>
  137. <li class="nav-item" data-depth="3">
  138. <button class="nav-item-toggle"></button>
  139. <span class="nav-text">Math Concepts</span>
  140. <ul class="nav-list">
  141. <li class="nav-item" data-depth="4">
  142. <a class="nav-link" href="../math_for_dummies.html">Math For Dummies</a>
  143. </li>
  144. <li class="nav-item" data-depth="4">
  145. <a class="nav-link" href="../intermediate/math.html">Math</a>
  146. </li>
  147. <li class="nav-item" data-depth="4">
  148. <a class="nav-link" href="../math.html">More Math</a>
  149. </li>
  150. <li class="nav-item" data-depth="4">
  151. <a class="nav-link" href="../rotate.html">Rotate</a>
  152. </li>
  153. <li class="nav-item" data-depth="4">
  154. <a class="nav-link" href="../math_video_tutorials.html">Math Video Tutorials</a>
  155. </li>
  156. </ul>
  157. </li>
  158. <li class="nav-item" data-depth="3">
  159. <button class="nav-item-toggle"></button>
  160. <span class="nav-text">3D Graphics Concepts</span>
  161. <ul class="nav-list">
  162. <li class="nav-item" data-depth="4">
  163. <a class="nav-link" href="../intermediate/multi-media_asset_pipeline.html">Multi-Media Asset Pipeline</a>
  164. </li>
  165. <li class="nav-item" data-depth="4">
  166. <a class="nav-link" href="../scenegraph_for_dummies.html">Scenegraph for Dummies</a>
  167. </li>
  168. <li class="nav-item" data-depth="4">
  169. <a class="nav-link" href="../beginner/hellovector.html">Hello Vector</a>
  170. </li>
  171. <li class="nav-item" data-depth="4">
  172. <a class="nav-link" href="../terminology.html">Terminology</a>
  173. </li>
  174. <li class="nav-item" data-depth="4">
  175. <a class="nav-link" href="../intermediate/how_to_use_materials.html">How to Use Materials</a>
  176. </li>
  177. <li class="nav-item" data-depth="4">
  178. <a class="nav-link" href="../intermediate/transparency_sorting.html">Transparency and Sorting</a>
  179. </li>
  180. <li class="nav-item" data-depth="4">
  181. <a class="nav-link" href="../external/blender.html">Importing from Blender</a>
  182. </li>
  183. <li class="nav-item" data-depth="4">
  184. <a class="nav-link" href="../external/3dsmax.html">Importing from 3DS Max</a>
  185. </li>
  186. </ul>
  187. </li>
  188. </ul>
  189. </li>
  190. </ul>
  191. </li>
  192. <li class="nav-item" data-depth="1">
  193. <a class="nav-link" href="../../logo.html">Logo Usage</a>
  194. </li>
  195. <li class="nav-item" data-depth="1">
  196. <a class="nav-link" href="../../bsd_license.html">License</a>
  197. </li>
  198. <li class="nav-item" data-depth="1">
  199. <a class="nav-link" href="../../github_tips.html">Github Tips</a>
  200. </li>
  201. </ul>
  202. </li>
  203. <li class="nav-item" data-depth="0">
  204. <button class="nav-item-toggle"></button>
  205. <span class="nav-text">SDK</span>
  206. <ul class="nav-list">
  207. <li class="nav-item" data-depth="1">
  208. <a class="nav-link" href="../../sdk.html">jMonkeyEngine SDK</a>
  209. </li>
  210. </ul>
  211. </li>
  212. </ul>
  213. </nav>
  214. </div>
  215. <div class="nav-panel-explore" data-panel="explore">
  216. <div class="context">
  217. <span class="title">Docs</span>
  218. <span class="version">master</span>
  219. </div>
  220. <ul class="components">
  221. <li class="component is-current">
  222. <span class="title">Docs</span>
  223. <ul class="versions">
  224. <li class="version is-current is-latest">
  225. <a href="../../documentation.html">master</a>
  226. </li>
  227. </ul>
  228. </li>
  229. <li class="component">
  230. <span class="title">Wiki UI</span>
  231. <ul class="versions">
  232. <li class="version is-latest">
  233. <a href="../../../wiki-ui/index.html">master</a>
  234. </li>
  235. </ul>
  236. </li>
  237. </ul>
  238. </div>
  239. </div>
  240. </aside>
  241. </div>
  242. <main class="article">
  243. <div class="toolbar" role="navigation">
  244. <button class="nav-toggle"></button>
  245. <nav class="breadcrumbs" aria-label="breadcrumbs">
  246. <ul>
  247. <li><a href="../../documentation.html">Docs</a></li>
  248. <li><a href="localization.html">Localizing jME 3 Games</a></li>
  249. </ul>
  250. </nav>
  251. <div class="edit-this-page"><a href="https://github.com/jMonkeyEngine/wiki/edit/master/docs/modules/ROOT/pages/jme3/advanced/localization.adoc">Edit this Page</a></div>
  252. </div>
  253. <div class="content">
  254. <article class="doc">
  255. <h1 class="page">Localizing jME 3 Games</h1>
  256. <div class="sect1">
  257. <h2 id="scope"><a class="anchor" href="#scope"></a>Scope</h2>
  258. <div class="sectionbody">
  259. <div class="paragraph">
  260. <p>Localizing an application can mean several things:</p>
  261. </div>
  262. <div class="ulist">
  263. <ul>
  264. <li>
  265. <p>At minimum you translate all messages and dialogs in the user interface to your target languages.</p>
  266. </li>
  267. <li>
  268. <p>You should also translate the “read me, help, and other documentation.</p>
  269. </li>
  270. <li>
  271. <p>Also translating web content related to the application makes sure international users find out about your localized game.</p>
  272. </li>
  273. <li>
  274. <p>If you go the whole way of internationalization, you also “translate metaphors in icons or symbols used.<br>
  275. E.g. For localizations to right-to-left languages, you must also adjust the whole flow of the UI (order of menus and buttons).</p>
  276. </li>
  277. </ul>
  278. </div>
  279. <div class="paragraph">
  280. <p>There are tools that assist you with localizing Java Swing GUIs. jME3 applications do not typically have a Swing <abbr title="Graphical User Interface">GUI</abbr>, so those tools are not of much help. Just stick to the normal Java rules about using Bundle Properties:</p>
  281. </div>
  282. </div>
  283. </div>
  284. <div class="sect1">
  285. <h2 id="preparing-the-localization"><a class="anchor" href="#preparing-the-localization"></a>Preparing the Localization</h2>
  286. <div class="sectionbody">
  287. <div class="admonitionblock tip">
  288. <table>
  289. <tr>
  290. <td class="icon">
  291. <i class="fa icon-tip" title="Tip"></i>
  292. </td>
  293. <td class="content">
  294. <div class="paragraph">
  295. <p>The jMonkeyEngine SDK supports opening and editing Bundle.properties files. Also note the Tools &gt; Localization menu.</p>
  296. </div>
  297. </td>
  298. </tr>
  299. </table>
  300. </div>
  301. <div class="paragraph">
  302. <p>To prepare the application for localization, you have to first identify all hard-coded messages.</p>
  303. </div>
  304. <div class="olist arabic">
  305. <ol class="arabic">
  306. <li>
  307. <p>Find every line in your jME3 game where you hard-coded message strings, e.g.</p>
  308. <div class="listingblock">
  309. <div class="content">
  310. <pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">System.out.print("Hello World!");
  311. UiText.setText("Score: " + score);</code></pre>
  312. </div>
  313. </div>
  314. </li>
  315. <li>
  316. <p>Create one file named <code>Bundle.properties</code> in each directory where there are Java file that contain messages.</p>
  317. </li>
  318. <li>
  319. <p>For every hard-coded message, you add one line to the <code>Bundle.properties</code> file: First specify a unique key that identifies this string; then an equal sign; and the literal string itself.</p>
  320. <div class="listingblock">
  321. <div class="content">
  322. <pre class="highlightjs highlight"><code>greeting=Hello World!
  323. score.display=Score:</code></pre>
  324. </div>
  325. </div>
  326. </li>
  327. <li>
  328. <p>In the source code, replace every occurence of a hard-coded message with the appropriate Resource Bundle call to its unique key:</p>
  329. <div class="listingblock">
  330. <div class="content">
  331. <pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">System.out.print(ResourceBundle.getBundle("Bundle").getString("greeting"));
  332. UiText.setText(ResourceBundle.getBundle("Bundle").getString("score.display") + score);</code></pre>
  333. </div>
  334. </div>
  335. </li>
  336. </ol>
  337. </div>
  338. <div class="paragraph">
  339. <p>The language used in the Bundle.properties files will be the default language for your game.</p>
  340. </div>
  341. </div>
  342. </div>
  343. <div class="sect1">
  344. <h2 id="translating-the-messages"><a class="anchor" href="#translating-the-messages"></a>Translating the Messages</h2>
  345. <div class="sectionbody">
  346. <div class="paragraph">
  347. <p>Each additional language comes in a set of files that is marked with a (usually) two-letter suffix. Common locales are de for German, en for English, fr for French, ja for Japanese, pt for Portuguese, etc.</p>
  348. </div>
  349. <div class="paragraph">
  350. <p>To translate the messages to another language, for example, German:</p>
  351. </div>
  352. <div class="olist arabic">
  353. <ol class="arabic">
  354. <li>
  355. <p>Make a copy of the <code>Bundle.properties</code> files.</p>
  356. </li>
  357. <li>
  358. <p>Name the copy <code>Bundle_de.properties</code> for German. Note the added suffix _de.</p>
  359. </li>
  360. <li>
  361. <p>Translate all strings (text on the right side of the equal sign) in the <code>Bundle_de.properties</code> to German.</p>
  362. <div class="listingblock">
  363. <div class="content">
  364. <pre class="highlightjs highlight"><code>greeting=Hallo Welt!
  365. score.display=Spielstand:</code></pre>
  366. </div>
  367. </div>
  368. <div class="admonitionblock important">
  369. <table>
  370. <tr>
  371. <td class="icon">
  372. <i class="fa icon-important" title="Important"></i>
  373. </td>
  374. <td class="content">
  375. <div class="paragraph">
  376. <p>Do not modify any of the keys (text to the left of the equal sign)!</p>
  377. </div>
  378. </td>
  379. </tr>
  380. </table>
  381. </div>
  382. </li>
  383. <li>
  384. <p>To test the German localization, start the application from the command line with <code>-Duser.language=de</code>. Note the parameter <code>de</code>.</p>
  385. <div class="admonitionblock tip">
  386. <table>
  387. <tr>
  388. <td class="icon">
  389. <i class="fa icon-tip" title="Tip"></i>
  390. </td>
  391. <td class="content">
  392. <div class="paragraph">
  393. <p>In the jMonkeyEngine SDK, you set this VM Option in the Project properties under Run. Here you can also save individual run configuraions for each language you want to test.</p>
  394. </div>
  395. </td>
  396. </tr>
  397. </table>
  398. </div>
  399. </li>
  400. </ol>
  401. </div>
  402. <div class="paragraph">
  403. <p>To get the full list of language suffixes use</p>
  404. </div>
  405. <div class="listingblock">
  406. <div class="content">
  407. <pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">System.out.println(Arrays.toString(Locale.getISOLanguages()));</code></pre>
  408. </div>
  409. </div>
  410. </div>
  411. </div>
  412. <div class="sect1">
  413. <h2 id="which-strings-not-to-translate"><a class="anchor" href="#which-strings-not-to-translate"></a>Which Strings Not to Translate</h2>
  414. <div class="sectionbody">
  415. <div class="admonitionblock important">
  416. <table>
  417. <tr>
  418. <td class="icon">
  419. <i class="fa icon-important" title="Important"></i>
  420. </td>
  421. <td class="content">
  422. <div class="paragraph">
  423. <p>In the Bundle.properties file, do not include any strings that are asset paths, node or geometry names, input mappings, or material layers.</p>
  424. </div>
  425. </td>
  426. </tr>
  427. </table>
  428. </div>
  429. <div class="ulist">
  430. <ul>
  431. <li>
  432. <p>Keep material layers:</p>
  433. <div class="listingblock">
  434. <div class="content">
  435. <pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">mat.setTexture("ColorMap", tex);</code></pre>
  436. </div>
  437. </div>
  438. </li>
  439. <li>
  440. <p>Keep paths:</p>
  441. <div class="listingblock">
  442. <div class="content">
  443. <pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">teapot = assetManager.loadModel("Models/Teapot/Teapot.obj");</code></pre>
  444. </div>
  445. </div>
  446. </li>
  447. <li>
  448. <p>Keep geometry and node names:</p>
  449. <div class="listingblock">
  450. <div class="content">
  451. <pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">Geometry thing=new Geometry("A thing", mesh);
  452. Node vehicle = new Node("Vehicle");</code></pre>
  453. </div>
  454. </div>
  455. </li>
  456. <li>
  457. <p>Keep mappings:</p>
  458. <div class="listingblock">
  459. <div class="content">
  460. <pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">inputManager.addMapping("Shoot", trigger);
  461. inputManager.addListener(actionListener, "Shoot");</code></pre>
  462. </div>
  463. </div>
  464. </li>
  465. </ul>
  466. </div>
  467. <div class="paragraph">
  468. <p>Only localize messages and UI text!</p>
  469. </div>
  470. </div>
  471. </div>
  472. <div class="sect1">
  473. <h2 id="common-localization-problems"><a class="anchor" href="#common-localization-problems"></a>Common Localization Problems</h2>
  474. <div class="sectionbody">
  475. <div class="paragraph">
  476. <p>Typical problems include:</p>
  477. </div>
  478. <div class="ulist">
  479. <ul>
  480. <li>
  481. <p>Localized strings will be of vastly different lengths and will totally break your UI layout. ⇒ Test every localization.</p>
  482. </li>
  483. <li>
  484. <p>Strings with variable text or numbers don&#8217;t work the same in different languages. ⇒ Either work in grammatical cases/numbers/gender for each language, or use <a href="http://www.gnu.org/software/gettext/manual/gettext.html#Plural-forms">gettext</a> or <a href="http://userguide.icu-project.org/formatparse/messages">ICU4J</a>.</p>
  485. </li>
  486. <li>
  487. <p>The localizer only sees the strings, without any context. E.g. does “Search History mean “display the history of searches, or “search through the history? ⇒ Use clear key labels. Work closely with the localizers if they require extra info, and add that info as comments to the translation file.</p>
  488. </li>
  489. <li>
  490. <p>Broken international characters ⇒ Make sure the files are saved with the same character encoding as the font file(s) you&#8217;re using. Nowadays, that usually means UTF-8 since font files tend to come for Unicode.</p>
  491. </li>
  492. <li>
  493. <p>Missing international characters ⇒ Make sure that there&#8217;s a glyph for every needed character in your font, either by using more complete font files or by having the translation changed.</p>
  494. </li>
  495. </ul>
  496. </div>
  497. </div>
  498. </div>
  499. <div class="sect1">
  500. <h2 id="more-documentation"><a class="anchor" href="#more-documentation"></a>More Documentation</h2>
  501. <div class="sectionbody">
  502. <div class="paragraph">
  503. <p><a href="http://java.sun.com/developer/technicalArticles/Intl/ResourceBundles/">http://java.sun.com/developer/technicalArticles/Intl/ResourceBundles/</a></p>
  504. </div>
  505. <div class="paragraph">
  506. <p><a href="http://sourceforge.net/apps/mediawiki/nifty-gui/index.php?title=Localisation">http://sourceforge.net/apps/mediawiki/nifty-gui/index.php?title=Localisation</a></p>
  507. </div>
  508. </div>
  509. </div>
  510. </article>
  511. <aside class="toc sidebar" data-title="Contents" data-levels="2">
  512. <div class="toc-menu"></div>
  513. </aside>
  514. </div>
  515. </main>
  516. </div>
  517. <footer class="footer">
  518. <p>Copyright 2020 jMonkeyEngine Wiki Contributors. Licensed BSD-3.</p>
  519. </footer>
  520. <script src="../../../_/js/vendor/docsearch.min.js"></script>
  521. <!-- fetched from https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js -->
  522. <script>
  523. var search = docsearch({
  524. apiKey: 'a736b6d93de805e26ec2f49b55013fbd',
  525. indexName: 'jmonkeyengine',
  526. inputSelector: '#search-input',
  527. autocompleteOptions: { hint: false, keyboardShortcuts: ['s'] },
  528. algoliaOptions: { hitsPerPage: 10 }
  529. }).autocomplete
  530. search.on('autocomplete:closed', function () { search.autocomplete.setVal() })
  531. function focusSearchInput () { document.querySelector('#search-input').focus() }
  532. if (document.querySelector('.home-link.is-current')) window.addEventListener('load', focusSearchInput)
  533. </script>
  534. <script src="../../../_/js/site.js"></script>
  535. <script async src="../../../_/js/vendor/highlight.js"></script>
  536. </body>
  537. </html>