<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://www.wlabsocks.com/wiki/index.php?action=history&amp;feed=atom&amp;title=ChangeLanguage</id>
	<title>ChangeLanguage - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://www.wlabsocks.com/wiki/index.php?action=history&amp;feed=atom&amp;title=ChangeLanguage"/>
	<link rel="alternate" type="text/html" href="http://www.wlabsocks.com/wiki/index.php?title=ChangeLanguage&amp;action=history"/>
	<updated>2026-05-13T00:01:16Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.5</generator>
	<entry>
		<id>http://www.wlabsocks.com/wiki/index.php?title=ChangeLanguage&amp;diff=854&amp;oldid=prev</id>
		<title>Tayfunwiki: Created page with &quot;== &lt;code&gt;ChangeLanguage&lt;/code&gt; Method in IM Class ==  === Overview === The &lt;code&gt;ChangeLanguage&lt;/code&gt; method in the IM (Intrigue Manager) class is responsible for changing the current language of the game based on the specified language key.  === Description ===  * Method Signature: &lt;code&gt;public static void ChangeLanguage(string languageKey)&lt;/code&gt; * Parameters: ** &lt;code&gt;languageKey&lt;/code&gt;: A string representing the key for the language to switch to. This key should cor...&quot;</title>
		<link rel="alternate" type="text/html" href="http://www.wlabsocks.com/wiki/index.php?title=ChangeLanguage&amp;diff=854&amp;oldid=prev"/>
		<updated>2024-01-04T18:35:32Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;== &amp;lt;code&amp;gt;ChangeLanguage&amp;lt;/code&amp;gt; Method in IM Class ==  === Overview === The &amp;lt;code&amp;gt;ChangeLanguage&amp;lt;/code&amp;gt; method in the IM (Intrigue Manager) class is responsible for changing the current language of the game based on the specified language key.  === Description ===  * Method Signature: &amp;lt;code&amp;gt;public static void ChangeLanguage(string languageKey)&amp;lt;/code&amp;gt; * Parameters: ** &amp;lt;code&amp;gt;languageKey&amp;lt;/code&amp;gt;: A string representing the key for the language to switch to. This key should cor...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== &amp;lt;code&amp;gt;ChangeLanguage&amp;lt;/code&amp;gt; Method in IM Class ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
The &amp;lt;code&amp;gt;ChangeLanguage&amp;lt;/code&amp;gt; method in the IM (Intrigue Manager) class is responsible for changing the current language of the game based on the specified language key.&lt;br /&gt;
&lt;br /&gt;
=== Description ===&lt;br /&gt;
&lt;br /&gt;
* Method Signature: &amp;lt;code&amp;gt;public static void ChangeLanguage(string languageKey)&amp;lt;/code&amp;gt;&lt;br /&gt;
* Parameters:&lt;br /&gt;
** &amp;lt;code&amp;gt;languageKey&amp;lt;/code&amp;gt;: A string representing the key for the language to switch to. This key should correspond to one of the languages available in the game.&lt;br /&gt;
&lt;br /&gt;
=== Functionality ===&lt;br /&gt;
&lt;br /&gt;
* The method first checks if the current language is already set to the specified &amp;lt;code&amp;gt;languageKey&amp;lt;/code&amp;gt;. If so, it returns immediately, avoiding unnecessary changes.&lt;br /&gt;
* If the &amp;lt;code&amp;gt;languageKey&amp;lt;/code&amp;gt; is valid (i.e., it exists in the &amp;lt;code&amp;gt;IEDatabase.Texts&amp;lt;/code&amp;gt; collection), the method updates the &amp;lt;code&amp;gt;currentLanguage&amp;lt;/code&amp;gt; to the new value and triggers the &amp;lt;code&amp;gt;onLanguageChanged&amp;lt;/code&amp;gt; event.&lt;br /&gt;
* If the &amp;lt;code&amp;gt;languageKey&amp;lt;/code&amp;gt; is invalid or not found, it logs an error message indicating an invalid language key.&lt;br /&gt;
&lt;br /&gt;
=== Usage ===&lt;br /&gt;
This method is used to switch the game's language dynamically, allowing for multilingual support. It facilitates the localization process, making the game accessible to a broader audience by adapting to different language preferences.&lt;br /&gt;
&lt;br /&gt;
=== Example of Usage ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c#&amp;quot;&amp;gt;&lt;br /&gt;
public class LanguageSelection : MonoBehaviour {&lt;br /&gt;
    public void SetGameLanguage(string newLanguageKey) {&lt;br /&gt;
        IM.ChangeLanguage(newLanguageKey);&lt;br /&gt;
        // Additional logic after language change (if needed)&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Description: ====&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;SetGameLanguage&amp;lt;/code&amp;gt;: A method that calls &amp;lt;code&amp;gt;IM.ChangeLanguage&amp;lt;/code&amp;gt; to update the game's language based on the user's selection. It can be connected to language selection options in the game's settings menu.&lt;br /&gt;
&lt;br /&gt;
=== Remarks ===&lt;br /&gt;
&lt;br /&gt;
* The &amp;lt;code&amp;gt;ChangeLanguage&amp;lt;/code&amp;gt; method is essential in games offering multiple language options, enhancing the user experience by providing localization.&lt;br /&gt;
* Correct implementation ensures that the game can dynamically adapt its language settings, catering to a diverse, global player base.&lt;br /&gt;
* The method also ensures stability by checking the validity of the language key before attempting to make changes.&lt;/div&gt;</summary>
		<author><name>Tayfunwiki</name></author>
	</entry>
</feed>