Dalamud/docs/api/Dalamud.Localization.html
2021-12-06 19:14:46 +01:00

410 lines
19 KiB
HTML

<!DOCTYPE html>
<!--[if IE]><![endif]-->
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Class Localization
</title>
<meta name="viewport" content="width=device-width">
<meta name="title" content="Class Localization
">
<meta name="generator" content="docfx 2.58.9.0">
<link rel="shortcut icon" href="../favicon.ico">
<link rel="stylesheet" href="../styles/docfx.vendor.css">
<link rel="stylesheet" href="../styles/docfx.css">
<link rel="stylesheet" href="../styles/main.css">
<meta property="docfx:navrel" content="">
<meta property="docfx:tocrel" content="toc.html">
</head>
<body data-spy="scroll" data-target="#affix" data-offset="120">
<div id="wrapper">
<header>
<nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="../index.html">
<img id="logo" class="svg" src="../logo.svg" alt="">
</a>
</div>
<div class="collapse navbar-collapse" id="navbar">
<form class="navbar-form navbar-right" role="search" id="search">
<div class="form-group">
<input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
</div>
</form>
</div>
</div>
</nav>
<div class="subnav navbar navbar-default">
<div class="container hide-when-search" id="breadcrumb">
<ul class="breadcrumb">
<li></li>
</ul>
</div>
</div>
</header>
<div role="main" class="container body-content hide-when-search">
<div class="sidenav hide-when-search">
<a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
<div class="sidetoggle collapse" id="sidetoggle">
<div id="sidetoc"></div>
</div>
</div>
<div class="article row grid-right">
<div class="col-md-10">
<article class="content wrap" id="_content" data-uid="Dalamud.Localization">
<h1 id="Dalamud_Localization" data-uid="Dalamud.Localization" class="text-break">Class Localization
</h1>
<div class="markdown level0 summary"><p>Class handling localization.</p>
</div>
<div class="markdown level0 conceptual"></div>
<div class="inheritance">
<h5>Inheritance</h5>
<div class="level0"><span class="xref">System.Object</span></div>
<div class="level1"><span class="xref">Localization</span></div>
</div>
<div class="inheritedMembers">
<h5>Inherited Members</h5>
<div>
<span class="xref">System.Object.Equals(System.Object)</span>
</div>
<div>
<span class="xref">System.Object.Equals(System.Object, System.Object)</span>
</div>
<div>
<span class="xref">System.Object.GetHashCode()</span>
</div>
<div>
<span class="xref">System.Object.GetType()</span>
</div>
<div>
<span class="xref">System.Object.MemberwiseClone()</span>
</div>
<div>
<span class="xref">System.Object.ReferenceEquals(System.Object, System.Object)</span>
</div>
<div>
<span class="xref">System.Object.ToString()</span>
</div>
</div>
<h6><strong>Namespace</strong>: <a class="xref" href="Dalamud.html">Dalamud</a></h6>
<h6><strong>Assembly</strong>: Dalamud.dll</h6>
<h5 id="Dalamud_Localization_syntax">Syntax</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public class Localization</code></pre>
</div>
<h3 id="constructors">Constructors
</h3>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/goatcorp/Dalamud/new/master/apiSpec/new?filename=Dalamud_Localization__ctor_System_String_System_String_System_Boolean_.md&amp;value=---%0Auid%3A%20Dalamud.Localization.%23ctor(System.String%2CSystem.String%2CSystem.Boolean)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/goatcorp/Dalamud/blob/master/Dalamud/Localization.cs/#L35">View Source</a>
</span>
<a id="Dalamud_Localization__ctor_" data-uid="Dalamud.Localization.#ctor*"></a>
<h4 id="Dalamud_Localization__ctor_System_String_System_String_System_Boolean_" data-uid="Dalamud.Localization.#ctor(System.String,System.String,System.Boolean)">Localization(String, String, Boolean)</h4>
<div class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="Dalamud.Localization.html">Localization</a> class.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public Localization(string locResourceDirectory, string locResourcePrefix = &quot;&quot;, bool useEmbedded = false)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.String</span></td>
<td><span class="parametername">locResourceDirectory</span></td>
<td><p>The working directory to load language files from.</p>
</td>
</tr>
<tr>
<td><span class="xref">System.String</span></td>
<td><span class="parametername">locResourcePrefix</span></td>
<td><p>The prefix on the loc resource file name (e.g. dalamud_).</p>
</td>
</tr>
<tr>
<td><span class="xref">System.Boolean</span></td>
<td><span class="parametername">useEmbedded</span></td>
<td><p>Use embedded loc resource files.</p>
</td>
</tr>
</tbody>
</table>
<h3 id="fields">Fields
</h3>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/goatcorp/Dalamud/new/master/apiSpec/new?filename=Dalamud_Localization_ApplicableLangCodes.md&amp;value=---%0Auid%3A%20Dalamud.Localization.ApplicableLangCodes%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/goatcorp/Dalamud/blob/master/Dalamud/Localization.cs/#L20">View Source</a>
</span>
<h4 id="Dalamud_Localization_ApplicableLangCodes" data-uid="Dalamud.Localization.ApplicableLangCodes">ApplicableLangCodes</h4>
<div class="markdown level1 summary"><p>Array of language codes which have a valid translation in Dalamud.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static readonly string[] ApplicableLangCodes</code></pre>
</div>
<h5 class="fieldValue">Field Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.String</span>[]</td>
<td></td>
</tr>
</tbody>
</table>
<h3 id="methods">Methods
</h3>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/goatcorp/Dalamud/new/master/apiSpec/new?filename=Dalamud_Localization_ExportLocalizable.md&amp;value=---%0Auid%3A%20Dalamud.Localization.ExportLocalizable%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/goatcorp/Dalamud/blob/master/Dalamud/Localization.cs/#L131">View Source</a>
</span>
<a id="Dalamud_Localization_ExportLocalizable_" data-uid="Dalamud.Localization.ExportLocalizable*"></a>
<h4 id="Dalamud_Localization_ExportLocalizable" data-uid="Dalamud.Localization.ExportLocalizable">ExportLocalizable()</h4>
<div class="markdown level1 summary"><p>Saves localizable JSON data in the current working directory for the provided assembly.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void ExportLocalizable()</code></pre>
</div>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/goatcorp/Dalamud/new/master/apiSpec/new?filename=Dalamud_Localization_Localize_System_String_System_String_.md&amp;value=---%0Auid%3A%20Dalamud.Localization.Localize(System.String%2CSystem.String)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/goatcorp/Dalamud/blob/master/Dalamud/Localization.cs/#L63">View Source</a>
</span>
<a id="Dalamud_Localization_Localize_" data-uid="Dalamud.Localization.Localize*"></a>
<h4 id="Dalamud_Localization_Localize_System_String_System_String_" data-uid="Dalamud.Localization.Localize(System.String,System.String)">Localize(String, String)</h4>
<div class="markdown level1 summary"><p>Search the set-up localization data for the provided assembly for the given string key and return it.
If the key is not present, the fallback is shown.
The fallback is also required to create the string files to be localized.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static string Localize(string key, string fallBack)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.String</span></td>
<td><span class="parametername">key</span></td>
<td><p>The string key to be returned.</p>
</td>
</tr>
<tr>
<td><span class="xref">System.String</span></td>
<td><span class="parametername">fallBack</span></td>
<td><p>The fallback string, usually your source language.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.String</span></td>
<td><p>The localized string, fallback or string key if not found.</p>
</td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/goatcorp/Dalamud/new/master/apiSpec/new?filename=Dalamud_Localization_SetupWithFallbacks.md&amp;value=---%0Auid%3A%20Dalamud.Localization.SetupWithFallbacks%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/goatcorp/Dalamud/blob/master/Dalamud/Localization.cs/#L97">View Source</a>
</span>
<a id="Dalamud_Localization_SetupWithFallbacks_" data-uid="Dalamud.Localization.SetupWithFallbacks*"></a>
<h4 id="Dalamud_Localization_SetupWithFallbacks" data-uid="Dalamud.Localization.SetupWithFallbacks">SetupWithFallbacks()</h4>
<div class="markdown level1 summary"><p>Set up the UI language with &quot;fallbacks&quot;(original English text).</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void SetupWithFallbacks()</code></pre>
</div>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/goatcorp/Dalamud/new/master/apiSpec/new?filename=Dalamud_Localization_SetupWithLangCode_System_String_.md&amp;value=---%0Auid%3A%20Dalamud.Localization.SetupWithLangCode(System.String)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/goatcorp/Dalamud/blob/master/Dalamud/Localization.cs/#L107">View Source</a>
</span>
<a id="Dalamud_Localization_SetupWithLangCode_" data-uid="Dalamud.Localization.SetupWithLangCode*"></a>
<h4 id="Dalamud_Localization_SetupWithLangCode_System_String_" data-uid="Dalamud.Localization.SetupWithLangCode(System.String)">SetupWithLangCode(String)</h4>
<div class="markdown level1 summary"><p>Set up the UI language with the provided language code.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void SetupWithLangCode(string langCode)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.String</span></td>
<td><span class="parametername">langCode</span></td>
<td><p>The language code to set up the UI language with.</p>
</td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/goatcorp/Dalamud/new/master/apiSpec/new?filename=Dalamud_Localization_SetupWithUiCulture.md&amp;value=---%0Auid%3A%20Dalamud.Localization.SetupWithUiCulture%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/goatcorp/Dalamud/blob/master/Dalamud/Localization.cs/#L71">View Source</a>
</span>
<a id="Dalamud_Localization_SetupWithUiCulture_" data-uid="Dalamud.Localization.SetupWithUiCulture*"></a>
<h4 id="Dalamud_Localization_SetupWithUiCulture" data-uid="Dalamud.Localization.SetupWithUiCulture">SetupWithUiCulture()</h4>
<div class="markdown level1 summary"><p>Set up the UI language with the users' local UI culture.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void SetupWithUiCulture()</code></pre>
</div>
<h3 id="events">Events
</h3>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/goatcorp/Dalamud/new/master/apiSpec/new?filename=Dalamud_Localization_LocalizationChanged.md&amp;value=---%0Auid%3A%20Dalamud.Localization.LocalizationChanged%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/goatcorp/Dalamud/blob/master/Dalamud/Localization.cs/#L52">View Source</a>
</span>
<h4 id="Dalamud_Localization_LocalizationChanged" data-uid="Dalamud.Localization.LocalizationChanged">LocalizationChanged</h4>
<div class="markdown level1 summary"><p>Event that occurs when the language is changed.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public event Localization.LocalizationChangedDelegate LocalizationChanged</code></pre>
</div>
<h5 class="eventType">Event Type</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Dalamud.Localization.LocalizationChangedDelegate.html">Localization.LocalizationChangedDelegate</a></td>
<td></td>
</tr>
</tbody>
</table>
</article>
</div>
<div class="hidden-sm col-md-2" role="complementary">
<div class="sideaffix">
<div class="contribution">
<ul class="nav">
<li>
<a href="https://github.com/goatcorp/Dalamud/new/master/apiSpec/new?filename=Dalamud_Localization.md&amp;value=---%0Auid%3A%20Dalamud.Localization%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A" class="contribution-link">Improve this Doc</a>
</li>
<li>
<a href="https://github.com/goatcorp/Dalamud/blob/master/Dalamud/Localization.cs/#L15" class="contribution-link">View Source</a>
</li>
</ul>
</div>
<nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
<h5>In This Article</h5>
<div></div>
</nav>
</div>
</div>
</div>
</div>
<footer>
<div class="grad-bottom"></div>
<div class="footer">
<div class="container">
<span class="pull-right">
<a href="#top">Back to top</a>
</span>
<span>Generated by <strong>DocFX</strong></span>
</div>
</div>
</footer>
</div>
<script type="text/javascript" src="../styles/docfx.vendor.js"></script>
<script type="text/javascript" src="../styles/docfx.js"></script>
<script type="text/javascript" src="../styles/main.js"></script>
</body>
</html>