# C1.WPF.Localization.C1Localizer.GetString

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_WPF_Localization_C1Localizer_GetString_" data-uid="C1.WPF.Localization.C1Localizer.GetString*">GetString Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_WPF_Localization_C1Localizer_GetString_" data-uid="C1.WPF.Localization.C1Localizer.GetString*"></a>
<h4 id="C1_WPF_Localization_C1Localizer_GetString_System_String_System_String_System_String_System_String_System_Reflection_Assembly_" data-uid="C1.WPF.Localization.C1Localizer.GetString(System.String,System.String,System.String,System.String,System.Reflection.Assembly)">GetString(string, string, string, string, Assembly)</h4>
<div class="markdown level1 summary"><p>Returns the localized string for the specified culture.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static string GetString(string resourceAssembly, string resourceDictionary, string resourceKey, string defaultValue, Assembly currentAssembly = null)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function GetString(resourceAssembly As String, resourceDictionary As String, resourceKey As String, defaultValue As String, Optional currentAssembly As Assembly = Nothing) As String</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">resourceAssembly</span></td>
      <td><p>The name of executing assembly.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">resourceDictionary</span></td>
      <td><p>The name of resource dictionary.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">resourceKey</span></td>
      <td><p>The resource key.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">defaultValue</span></td>
      <td><p>The default value.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.reflection.assembly">Assembly</a></td>
      <td><span class="parametername">currentAssembly</span></td>
      <td><p>The current executing assembly.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td></td>
    </tr>
  </tbody>
</table>
<h5 id="C1_WPF_Localization_C1Localizer_GetString_System_String_System_String_System_String_System_String_System_Reflection_Assembly__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>Search order:
- searching in the specified resource Assembly;
- searching in satellite Assemblies of the specified resource Assembly;
- searching in the executing assembly;
- repeating the search in above assemblies for the parent culture;
- if result is not found, returning the specified default value.</p>
</div>


<a id="C1_WPF_Localization_C1Localizer_GetString_" data-uid="C1.WPF.Localization.C1Localizer.GetString*"></a>
<h4 id="C1_WPF_Localization_C1Localizer_GetString_System_String_System_String_System_String_System_String_System_Globalization_CultureInfo_System_Reflection_Assembly_" data-uid="C1.WPF.Localization.C1Localizer.GetString(System.String,System.String,System.String,System.String,System.Globalization.CultureInfo,System.Reflection.Assembly)">GetString(string, string, string, string, CultureInfo, Assembly)</h4>
<div class="markdown level1 summary"><p>Returns the localized string for the specified culture.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static string GetString(string resourceAssembly, string resourceDictionary, string resourceKey, string defaultValue, CultureInfo culture, Assembly currentAssembly = null)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function GetString(resourceAssembly As String, resourceDictionary As String, resourceKey As String, defaultValue As String, culture As CultureInfo, Optional currentAssembly As Assembly = Nothing) As String</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">resourceAssembly</span></td>
      <td><p>The name of resource assembly.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">resourceDictionary</span></td>
      <td><p>The name of resource dictionary.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">resourceKey</span></td>
      <td><p>The resource key.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">defaultValue</span></td>
      <td><p>The default value.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.globalization.cultureinfo">CultureInfo</a></td>
      <td><span class="parametername">culture</span></td>
      <td><p>The <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.globalization.cultureinfo">CultureInfo</a> info.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.reflection.assembly">Assembly</a></td>
      <td><span class="parametername">currentAssembly</span></td>
      <td><p>The current executing assembly.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td></td>
    </tr>
  </tbody>
</table>
<h5 id="C1_WPF_Localization_C1Localizer_GetString_System_String_System_String_System_String_System_String_System_Globalization_CultureInfo_System_Reflection_Assembly__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>Search order:
- searching in the specified resource Assembly;
- searching in satellite Assemblies of the specified resource Assembly;
- searching in the executing assembly;
- repeating the search in above assemblies for the parent culture;
- if result is not found, returning the specified default value.</p>
</div>


<a id="C1_WPF_Localization_C1Localizer_GetString_" data-uid="C1.WPF.Localization.C1Localizer.GetString*"></a>
<h4 id="C1_WPF_Localization_C1Localizer_GetString_System_String_System_String_System_String_System_Reflection_Assembly_" data-uid="C1.WPF.Localization.C1Localizer.GetString(System.String,System.String,System.String,System.Reflection.Assembly)">GetString(string, string, string, Assembly)</h4>
<div class="markdown level1 summary"><p>Returns the localized string for the specified culture.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static string GetString(string resourceDictionary, string resourceKey, string defaultValue, Assembly currentAssembly = null)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function GetString(resourceDictionary As String, resourceKey As String, defaultValue As String, Optional currentAssembly As Assembly = Nothing) As String</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">resourceDictionary</span></td>
      <td><p>The name of resource dictionary.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">resourceKey</span></td>
      <td><p>The resource key.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">defaultValue</span></td>
      <td><p>The default value.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.reflection.assembly">Assembly</a></td>
      <td><span class="parametername">currentAssembly</span></td>
      <td><p>The executing assembly.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td></td>
    </tr>
  </tbody>
</table>
<h5 id="C1_WPF_Localization_C1Localizer_GetString_System_String_System_String_System_String_System_Reflection_Assembly__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>Search order:
- searching in the executing Assembly;
- repeating the search for the parent culture;
- if result is not found, returning the specified default value.</p>
</div>


<a id="C1_WPF_Localization_C1Localizer_GetString_" data-uid="C1.WPF.Localization.C1Localizer.GetString*"></a>
<h4 id="C1_WPF_Localization_C1Localizer_GetString_System_String_System_String_System_String_System_Globalization_CultureInfo_System_Reflection_Assembly_" data-uid="C1.WPF.Localization.C1Localizer.GetString(System.String,System.String,System.String,System.Globalization.CultureInfo,System.Reflection.Assembly)">GetString(string, string, string, CultureInfo, Assembly)</h4>
<div class="markdown level1 summary"><p>Returns the localized string for the specified culture.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static string GetString(string resourceDictionary, string resourceKey, string defaultValue, CultureInfo culture, Assembly currentAssembly = null)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function GetString(resourceDictionary As String, resourceKey As String, defaultValue As String, culture As CultureInfo, Optional currentAssembly As Assembly = Nothing) As String</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">resourceDictionary</span></td>
      <td><p>The name of resource dictionary.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">resourceKey</span></td>
      <td><p>The resource key.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">defaultValue</span></td>
      <td><p>The default value.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.globalization.cultureinfo">CultureInfo</a></td>
      <td><span class="parametername">culture</span></td>
      <td><p>The <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.globalization.cultureinfo">CultureInfo</a> object.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.reflection.assembly">Assembly</a></td>
      <td><span class="parametername">currentAssembly</span></td>
      <td><p>The current executing assembly.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td></td>
    </tr>
  </tbody>
</table>
<h5 id="C1_WPF_Localization_C1Localizer_GetString_System_String_System_String_System_String_System_Globalization_CultureInfo_System_Reflection_Assembly__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>Search order:
- searching in the executing Assembly;
- repeating the search for the parent culture;
- if result is not found, returning the specified default value.</p>
</div>
</div>
