mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-24 08:13:05 +00:00
209 lines
15 KiB
HTML
209 lines
15 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="art-pir" dir="rtl">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="height=device-height, width=device-width, initial-scale=1.0, minimum-scale=1.0">
|
|
<meta name="generator" content="Hugo 0.123.6">
|
|
<meta name="generator" content="Relearn 5.24.3+tip">
|
|
<meta name="description" content="Documentation for Hugo Relearn Theme">
|
|
<meta name="author" content="Sören Weber">
|
|
<meta name="twitter:card" content="summary_large_image">
|
|
<meta name="twitter:image" content="https://mcshelby.github.io/hugo-theme-relearn/images/hero.png">
|
|
<meta name="twitter:title" content="Multilingual an' i18n :: Cap'n Hugo Relearrrn Theme">
|
|
<meta name="twitter:description" content="Documentation for Hugo Relearn Theme">
|
|
<meta property="og:title" content="Multilingual an' i18n :: Cap'n Hugo Relearrrn Theme">
|
|
<meta property="og:description" content="Documentation for Hugo Relearn Theme">
|
|
<meta property="og:type" content="website">
|
|
<meta property="og:url" content="https://mcshelby.github.io/hugo-theme-relearn/pir/cont/i18n/index.html">
|
|
<meta property="og:image" content="https://mcshelby.github.io/hugo-theme-relearn/images/hero.png">
|
|
<meta property="og:site_name" content="Cap'n Hugo Relearrrn Theme">
|
|
<title>Multilingual an' i18n :: Cap'n Hugo Relearrrn Theme</title>
|
|
<link href="https://mcshelby.github.io/hugo-theme-relearn/cont/i18n/index.html" rel="alternate" hreflang="x-default">
|
|
<link href="https://mcshelby.github.io/hugo-theme-relearn/cont/i18n/index.html" rel="alternate" hreflang="en">
|
|
<link href="https://mcshelby.github.io/hugo-theme-relearn/pir/cont/i18n/index.html" rel="alternate" hreflang="art-pir">
|
|
<link href="https://mcshelby.github.io/hugo-theme-relearn/pir/cont/i18n/index.html" rel="canonical" type="text/html" title="Multilingual an' i18n :: Cap'n Hugo Relearrrn Theme">
|
|
<link href="/hugo-theme-relearn/pir/cont/i18n/index.xml" rel="alternate" type="application/rss+xml" title="Multilingual an' i18n :: Cap'n Hugo Relearrrn Theme">
|
|
<link href="/hugo-theme-relearn/images/logo.svg?1709219066" rel="icon" type="image/svg+xml">
|
|
<!-- https://github.com/filamentgroup/loadCSS/blob/master/README.md#how-to-use -->
|
|
<link href="/hugo-theme-relearn/css/fontawesome-all.min.css?1709219068" rel="stylesheet" media="print" onload="this.media='all';this.onload=null;"><noscript><link href="/hugo-theme-relearn/css/fontawesome-all.min.css?1709219068" rel="stylesheet"></noscript>
|
|
<link href="/hugo-theme-relearn/css/nucleus.css?1709219068" rel="stylesheet">
|
|
<link href="/hugo-theme-relearn/css/auto-complete.css?1709219068" rel="stylesheet" media="print" onload="this.media='all';this.onload=null;"><noscript><link href="/hugo-theme-relearn/css/auto-complete.css?1709219068" rel="stylesheet"></noscript>
|
|
<link href="/hugo-theme-relearn/css/perfect-scrollbar.min.css?1709219068" rel="stylesheet">
|
|
<link href="/hugo-theme-relearn/css/fonts.css?1709219068" rel="stylesheet" media="print" onload="this.media='all';this.onload=null;"><noscript><link href="/hugo-theme-relearn/css/fonts.css?1709219068" rel="stylesheet"></noscript>
|
|
<link href="/hugo-theme-relearn/css/theme.css?1709219068" rel="stylesheet">
|
|
<link href="/hugo-theme-relearn/css/theme-relearn-auto.css?1709219068" rel="stylesheet" id="R-variant-style">
|
|
<link href="/hugo-theme-relearn/css/chroma-relearn-auto.css?1709219068" rel="stylesheet" id="R-variant-chroma-style">
|
|
<link href="/hugo-theme-relearn/css/variant.css?1709219068" rel="stylesheet">
|
|
<link href="/hugo-theme-relearn/css/print.css?1709219068" rel="stylesheet" media="print">
|
|
<link href="/hugo-theme-relearn/css/format-print.css?1709219068" rel="stylesheet">
|
|
<link href="/hugo-theme-relearn/css/ie.css?1709219068" rel="stylesheet">
|
|
<script src="/hugo-theme-relearn/js/url.js?1709219068"></script>
|
|
<script src="/hugo-theme-relearn/js/variant.js?1709219068"></script>
|
|
<script>
|
|
// hack to let hugo tell us how to get to the root when using relativeURLs, it needs to be called *url= for it to do its magic:
|
|
// https://github.com/gohugoio/hugo/blob/145b3fcce35fbac25c7033c91c1b7ae6d1179da8/transform/urlreplacers/absurlreplacer.go#L72
|
|
window.index_js_url="/hugo-theme-relearn/pir/index.search.js";
|
|
var root_url="/";
|
|
var baseUri=root_url.replace(/\/$/, '');
|
|
window.relearn = window.relearn || {};
|
|
window.relearn.baseUriFull='https:\/\/mcshelby.github.io\/hugo-theme-relearn/';
|
|
// variant stuff
|
|
window.relearn.themeVariantModifier='';
|
|
window.variants && variants.init( [ 'relearn-auto', 'relearn-light', 'relearn-dark', 'relearn-bright', 'zen-auto', 'zen-light', 'zen-dark', 'neon', 'learn', 'blue', 'green', 'red' ] );
|
|
// translations
|
|
window.T_Copy_to_clipboard = `Copy t' clipboard`;
|
|
window.T_Copied_to_clipboard = `Copied t' clipboard!`;
|
|
window.T_Copy_link_to_clipboard = `Copy link t' clipboard`;
|
|
window.T_Link_copied_to_clipboard = `Copied link t' clipboard!`;
|
|
window.T_Reset_view = `Rrreset view`;
|
|
window.T_View_reset = `View rrreset!`;
|
|
window.T_No_results_found = `No rrresults found fer "{0}"`;
|
|
window.T_N_results_found = `{1} rrresults found fer "{0}"`;
|
|
</script>
|
|
<style>
|
|
#R-body img.bg-white {
|
|
background-color: white;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body class="mobile-support print disableInlineCopyToClipboard" data-url="/hugo-theme-relearn/pir/cont/i18n/index.html">
|
|
<div id="R-body" class="default-animation">
|
|
<div id="R-body-overlay"></div>
|
|
<nav id="R-topbar">
|
|
<div class="topbar-wrapper">
|
|
<div class="topbar-sidebar-divider"></div>
|
|
<div class="topbar-area topbar-area-start" data-area="start">
|
|
<div class="topbar-button topbar-button-sidebar" data-content-empty="disable" data-width-s="show" data-width-m="hide" data-width-l="hide"><button class="topbar-control" onclick="toggleNav()" type="button" title="Menu (CTRL+ALT+n)"><i class="fa-fw fas fa-bars"></i></button>
|
|
</div>
|
|
</div>
|
|
<ol class="topbar-breadcrumbs breadcrumbs highlightable" itemscope itemtype="http://schema.org/BreadcrumbList"><li
|
|
itemscope itemtype="https://schema.org/ListItem" itemprop="itemListElement"><a itemprop="item" href="/hugo-theme-relearn/pir/cont/index.html"><span itemprop="name">Rambl'n</span></a><meta itemprop="position" content="1"> > </li><li
|
|
itemscope itemtype="https://schema.org/ListItem" itemprop="itemListElement"><span itemprop="name">Multilingual an' i18n</span><meta itemprop="position" content="2"></li>
|
|
</ol>
|
|
<div class="topbar-area topbar-area-end" data-area="end">
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
<div id="R-main-overlay"></div>
|
|
<main id="R-body-inner" class="highlightable default" tabindex="-1">
|
|
<div class="flex-block-wrapper">
|
|
<article class="default">
|
|
<header class="headline">
|
|
</header>
|
|
<h1 id="multilingual-an-i18n">Multilingual an' i18n</h1>
|
|
|
|
|
|
<p>Th' Relearrrn theme be fully compat'ble wit' Cap'n Hugo multilingual mode.</p>
|
|
<ul>
|
|
<li>Avail'ble languages: Arabic, Simplified Chinese, Traditional Chinese, Czech, Dutch, English, Finnish, French, German, Hindi, Hungarian, Indonesian, Italian, Japanese, Korean, Polish, Portuguese, Russian, Spanish, Swahili, Turkish, Vietnamese. Feel free t' contribute!</li>
|
|
<li>Full support fer languages written right t' left</li>
|
|
<li>Automatic menu generat'n from multilingual rrrambl'n</li>
|
|
<li>In-browser language switch'n</li>
|
|
</ul>
|
|
<p><a href="#R-image-b6d93306a9461263128cdf5aa8c6ede1" class="lightbox-link"><img src="/hugo-theme-relearn/cont/i18n/i18n-menu.gif?width=18.75rem" alt="I18n menu" class="figure-image bg-white border lightbox noshadow" style="height: auto; width: 18.75rem;" loading="lazy"></a>
|
|
<a href="javascript:history.back();" class="lightbox-back" id="R-image-b6d93306a9461263128cdf5aa8c6ede1"><img src="/hugo-theme-relearn/cont/i18n/i18n-menu.gif?width=18.75rem" alt="I18n menu" class="lightbox-image bg-white border lightbox noshadow" loading="lazy"></a></p>
|
|
<h2 id="basic-configuration">Basic configurat'n</h2>
|
|
<p>Aft learn'n <a href="https://gohugo.io/content-management/multilingual" target="_blank">how Cap'n Hugo handle multilingual websites</a>, define yer languages 'n yer <code>hugo.toml</code> file.</p>
|
|
<p>For example wit' current English an' Piratized English website.</p>
|
|
|
|
<div class="box notices cstyle note">
|
|
<div class="box-label"><i class="fa-fw fas fa-exclamation-circle"></i> Avast</div>
|
|
<div class="box-content">
|
|
|
|
<p>Make sure yer default language be defined as th' first one 'n th' <code>[languages]</code> array, as th' theme needs t' make assumpt'ns on it</p>
|
|
</div>
|
|
</div>
|
|
<div class="wrap-code highlight"><pre tabindex="0" class="chroma"><code class="language-toml" data-lang="toml"><span class="line"><span class="cl"><span class="c"># English be th' default language</span>
|
|
</span></span><span class="line"><span class="cl"><span class="nx">defaultContentLanguage</span> <span class="p">=</span> <span class="s2">"en"</span>
|
|
</span></span><span class="line"><span class="cl">
|
|
</span></span><span class="line"><span class="cl"><span class="p">[</span><span class="nx">languages</span><span class="p">]</span>
|
|
</span></span><span class="line"><span class="cl"><span class="p">[</span><span class="nx">languages</span><span class="p">.</span><span class="nx">en</span><span class="p">]</span>
|
|
</span></span><span class="line"><span class="cl"><span class="nx">title</span> <span class="p">=</span> <span class="s2">"Hugo Relearrrn Theme"</span>
|
|
</span></span><span class="line"><span class="cl"><span class="nx">weight</span> <span class="p">=</span> <span class="mi">1</span>
|
|
</span></span><span class="line"><span class="cl"><span class="nx">languageName</span> <span class="p">=</span> <span class="s2">"English"</span>
|
|
</span></span><span class="line"><span class="cl">
|
|
</span></span><span class="line"><span class="cl"><span class="p">[</span><span class="nx">languages</span><span class="p">.</span><span class="nx">pir</span><span class="p">]</span>
|
|
</span></span><span class="line"><span class="cl"><span class="nx">title</span> <span class="p">=</span> <span class="s2">"Cap'n Hugo Relearrrn Theme"</span>
|
|
</span></span><span class="line"><span class="cl"><span class="nx">weight</span> <span class="p">=</span> <span class="mi">2</span>
|
|
</span></span><span class="line"><span class="cl"><span class="nx">languageName</span> <span class="p">=</span> <span class="s2">"Arrr! Pirrrates"</span></span></span></code></pre></div><p>Then, fer each new plank, append th' <em>id</em> o' th' language t' th' file.</p>
|
|
<ul>
|
|
<li>Single file <code>my-page.md</code> be split 'n two files:
|
|
<ul>
|
|
<li>'n English: <code>my-page.md</code></li>
|
|
<li>'n Piratized English: <code>my-page.pir.md</code></li>
|
|
</ul>
|
|
</li>
|
|
<li>Single file <code>_index.md</code> be split 'n two files:
|
|
<ul>
|
|
<li>'n English: <code>_index.md</code></li>
|
|
<li>'n Piratized English: <code>_index.pir.md</code></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
|
|
<div class="box notices cstyle info">
|
|
<div class="box-label"><i class="fa-fw fas fa-info-circle"></i> Ahoi</div>
|
|
<div class="box-content">
|
|
|
|
<p>Be aware that only translated planks be displayed 'n menu. It’s not replaced wit' default language rrrambl'n.</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="box notices cstyle tip">
|
|
<div class="box-label"><i class="fa-fw fas fa-lightbulb"></i> Smarrrt Arrrse</div>
|
|
<div class="box-content">
|
|
|
|
<p>Use <a href="https://gohugo.io/content-management/multilingual/#translate-your-content" target="_blank">slug</a> frontmatter parameter t' translate urls too.</p>
|
|
</div>
|
|
</div>
|
|
<h2 id="search">Search</h2>
|
|
<p>In case each page’s rrrambl'n be written 'n one single language only, th' above configurat'n will already configure th' site’s search functionality correctly.</p>
|
|
|
|
<div class="box notices cstyle warning">
|
|
<div class="box-label"><i class="fa-fw fas fa-exclamation-triangle"></i> Arrr</div>
|
|
<div class="box-content">
|
|
|
|
<p>Although th' theme supports a wide variety o' supported languages, th' site’s search via th' <a href="https://lunrjs.com" target="_blank">Lunr</a> search library does not.
|
|
You’ll see error reports 'n yer browsers console log fer each unsupported language. Currently unsupported be:</p>
|
|
<ul>
|
|
<li>Czech</li>
|
|
<li>Indonesian</li>
|
|
<li>Polish</li>
|
|
<li>Swahili</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<h3 id="search-with-mixed-language-support">Search wit' mixed language support</h3>
|
|
<p>In case yer page’s rrrambl'n contains text 'n multiple languages (e.g. ye be writ'n a Russian documentat'n fer yer english API), ye can add those languages t' yer <code>hugo.toml</code> t' broaden search.</p>
|
|
<div class="wrap-code highlight"><pre tabindex="0" class="chroma"><code class="language-toml" data-lang="toml"><span class="line"><span class="cl"><span class="p">[</span><span class="nx">params</span><span class="p">]</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="nx">additionalContentLanguage</span> <span class="p">=</span> <span class="p">[</span> <span class="s2">"en"</span> <span class="p">]</span></span></span></code></pre></div><p>As this be an array, ye can add multiple additional languages.</p>
|
|
|
|
<div class="box notices cstyle note">
|
|
<div class="box-label"><i class="fa-fw fas fa-exclamation-circle"></i> Avast</div>
|
|
<div class="box-content">
|
|
|
|
<p>Keep 'n mind that th' language code required here, be th' base language code. E.g. if ye have additional rrrambl'n 'n <code>zh-CN</code>, ye have t' add just <code>zh</code> t' this parameter.</p>
|
|
</div>
|
|
</div>
|
|
<h2 id="overwrite-translation-strings">Overwrite translat'n str'ns</h2>
|
|
<p>Translat'ns str'ns be used fer common default values used 'n th' theme (<em>Edit</em> button, <em>Search placeholder</em> an' so on). Translat'ns be avail'ble 'n English an' Piratized English but ye may use another language or want t' override default values.</p>
|
|
<p>T' override these values, create a new file 'n yer local i18n folder <code>i18n/<idlanguage>.toml</code> an' inspire yourself from th' theme <code>themes/hugo-theme-relearn/i18n/en.toml</code></p>
|
|
<h2 id="disable-language-switching">Dis'ble language switch'n</h2>
|
|
<p>Switch'n th' language 'n th' browser be a great feature, but fer some reasons ye may want t' dis'ble it.</p>
|
|
<p>Just set <code>disableLanguageSwitchingButton=true</code> 'n yer <code>hugo.toml</code></p>
|
|
<div class="wrap-code highlight"><pre tabindex="0" class="chroma"><code class="language-toml" data-lang="toml"><span class="line"><span class="cl"><span class="p">[</span><span class="nx">params</span><span class="p">]</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="c"># When us'n multilingual website, dis'ble th' switch language button.</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="nx">disableLanguageSwitchingButton</span> <span class="p">=</span> <span class="kc">true</span></span></span></code></pre></div>
|
|
|
|
<footer class="footline">
|
|
</footer>
|
|
</article>
|
|
|
|
</div>
|
|
</main>
|
|
</div>
|
|
<script src="/hugo-theme-relearn/js/clipboard.min.js?1709219068" defer></script>
|
|
<script src="/hugo-theme-relearn/js/perfect-scrollbar.min.js?1709219068" defer></script>
|
|
<script src="/hugo-theme-relearn/js/theme.js?1709219068" defer></script>
|
|
</body>
|
|
</html>
|