<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Translating Plugin Text</title><link>https://community.telligent.com/community/11/w/developer-training/65125/translating-plugin-text</link><description /><dc:language>en-US</dc:language><generator>14.0.0.586 14</generator><item><title>Translating Plugin Text</title><link>https://community.telligent.com/community/11/w/developer-training/65125/translating-plugin-text</link><pubDate>Tue, 04 Aug 2020 22:02:59 GMT</pubDate><guid isPermaLink="false">c2b6465e-5274-4c18-931f-c7a33de4dbe2</guid><dc:creator>Former Member</dc:creator><comments>https://community.telligent.com/community/11/w/developer-training/65125/translating-plugin-text#comments</comments><description>Current Revision posted to Developer Training by Former Member on 08/04/2020 22:02:59&lt;br /&gt;
&lt;p&gt;The [[api-documentation:ITranslatablePlugin Plugin Type|ITranslatablePlugin]] allows you to define language resource strings for use within a [[Plugins|plugin]] that can be translated&amp;nbsp;through the Verint Community platform.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;[toc]&lt;/p&gt;
&lt;h2&gt;&lt;a id="Why_Should_I_Translate_My_Plugins" name="Why_Should_I_Translate_My_Plugins"&gt;&lt;/a&gt;Why Should I Translate My Plugins?&lt;/h2&gt;
&lt;p&gt;When creating a plugin for reuse or creating a plugin to be used in a community that may grow beyond the scope of a single language or culture, it is important to plan for globalization. One step in that process is ensuring that the text generated for end-user consumption can be easily translated. Verint Community provides support for translating text used by plugins via interaction with the [[api-documentation:ITranslatablePlugin Plugin Type|ITranslatablePlugin plugin type]].&lt;/p&gt;
&lt;h2&gt;&lt;a id="Creating_a_Translatable_Plugin" name="Creating_a_Translatable_Plugin"&gt;&lt;/a&gt;Creating a Translatable Plugin&lt;/h2&gt;
&lt;p&gt;To add support for translating the text rendered by your plugin, implement the [[api-documentation:ITranslatablePlugin Plugin Type|ITranslatablePlugin]] interface (which requires a reference to Telligent.Evolution.Components.dll). The &lt;code&gt;ITranslatablePlugin&lt;/code&gt; interface extends [[Plugins|IPlugin]] to add support for translation.&lt;/p&gt;
&lt;p&gt;First, we&amp;#39;ll define one or more&amp;nbsp;primary set of translations using the &lt;code&gt;DefaultTranslations&lt;/code&gt;&amp;nbsp;property of the &lt;code&gt;ITranslatablePlugin&lt;/code&gt; interface:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="csharp"&gt;public Translation[] DefaultTranslations
{
    get 
    { 
        var translation = new Translation(&amp;quot;en-us&amp;quot;);

        translation.Set(&amp;quot;my_translation_hello&amp;quot;, &amp;quot;Hello&amp;quot;);
        translation.Set(&amp;quot;my_translation_world&amp;quot;, &amp;quot;World&amp;quot;);
        
        return new Translation[] { translation };
    }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This sample defines a default translation for US English (&lt;code&gt;en-us&lt;/code&gt;) with two translated resources: &amp;quot;hello&amp;quot; named&amp;nbsp;&lt;code&gt;my_translation_hello&lt;/code&gt; and &amp;quot;world&amp;quot; named&amp;nbsp;&lt;code&gt;my_translation_world&lt;/code&gt;. The resource name is used to retrieve the translated string from the platform.&lt;/p&gt;
&lt;p&gt;By defining the default set of translations, Verint Community can expose these options via the plugin resource export and import process to enable the default strings to be translated into other languages enabled by the community. to retrieve these translations, the plugin should request the translation from the platform using the [[api-documentation:ITranslatablePluginController Plugin Supplementary Type|translation controller]] provided to the plugin via the &lt;code&gt;SetController()&lt;/code&gt; method of &lt;code&gt;ITranslatablePlugin&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="csharp"&gt;private ITranslatablePluginController _translationController;

public void SetController(ITranslatablePluginController controller)
{
    _translationController = controller;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Generally, the controller is stored in an instance variable of the plugin for later use. Once received during [[Plugin Lifecycle|plugin initialization]], the [[api-documentation:ITranslatablePluginController Plugin Supplementary Type|translation controller]] can be used to retrieve translated resource strings.&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s the complete source of our sample translatable plugin:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://community.telligent.com/cfs-file/__key/communityserver-wikis-components-files/00-00-00-12-83/SampleTranslationPlugin_2E00_cs"&gt;community.telligent.com/.../SampleTranslationPlugin_2E00_cs&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Once this sample is deployed to Verint Community, the plugin will&amp;nbsp;show in &lt;strong&gt;Administration &amp;gt; Translations &amp;gt; Translatables &lt;/strong&gt;to enable on-site translation:&lt;/p&gt;
&lt;p&gt;&lt;a href="/cfs-file/__key/communityserver-wikis-components-files/00-00-00-12-83/8666.png"&gt;&lt;img alt=" " src="/resized-image/__size/1040x0/__key/communityserver-wikis-components-files/00-00-00-12-83/8666.png" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;and its language resources will be included in the import/export of language resources for all plugins at &lt;strong&gt;Administration &amp;gt; Translations &amp;gt; Plugin Translations &lt;/strong&gt;to enable bulk/off-site translation.&lt;/p&gt;
&lt;h2&gt;&lt;a id="Using_Translated_Resource_Strings" name="Using_Translated_Resource_Strings"&gt;&lt;/a&gt;Using Translated Resource Strings&lt;/h2&gt;
&lt;p&gt;Once you&amp;#39;ve implemented &lt;code&gt;ITranslatablePlugin&lt;/code&gt;, you should use the [[api-documentation:ITranslatablePluginController Plugin Supplementary Type|translation controller]] to retrieve translated text using the resource names you defined in your default translation. Using the sample above, we could interact with the&amp;nbsp;&lt;code&gt;_translationController&lt;/code&gt; instance variable&amp;nbsp;of the plugin to retrieve the translation for &amp;quot;hello&amp;quot;:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="csharp"&gt;string hello = _translationController.GetLanguageResourceValue(&amp;quot;my_translation_hello&amp;quot;);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The [[api-documentation:ITranslatablePluginController Plugin Supplementary Type|GetLanguageResourceValue()]]&amp;nbsp;method of the translation controller will return the best matching translation of the requested language resource&amp;nbsp;for the current accessing user (if the explicit language is not provided) or for the explicit language provided.&lt;/p&gt;
&lt;p&gt;Translated language resource strings are useful when implementing other [[Plugins|plugin types]] that interact with users via the UI or background processes.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: ITranslatablePlugin&lt;/div&gt;
</description></item><item><title>Translating Plugin Text</title><link>https://community.telligent.com/community/11/w/developer-training/65125/translating-plugin-text/revision/2</link><pubDate>Tue, 04 Aug 2020 22:02:24 GMT</pubDate><guid isPermaLink="false">c2b6465e-5274-4c18-931f-c7a33de4dbe2</guid><dc:creator>Former Member</dc:creator><comments>https://community.telligent.com/community/11/w/developer-training/65125/translating-plugin-text#comments</comments><description>Revision 2 posted to Developer Training by Former Member on 08/04/2020 22:02:24&lt;br /&gt;
&lt;p&gt;The [[api-documentation:ITranslatablePlugin Plugin Type|ITranslatablePlugin]] allows you to define language resource strings for use within a [[Plugins|plugin]] that can be translated&amp;nbsp;through the Verint Community platform.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;[toc]&lt;/p&gt;
&lt;h2&gt;&lt;a id="Why_Should_I_Translate_My_Plugins" name="Why_Should_I_Translate_My_Plugins"&gt;&lt;/a&gt;Why Should I Translate My Plugins?&lt;/h2&gt;
&lt;p&gt;When creating a plugin for reuse or creating a plugin to be used in a community that may grow beyond the scope of a single language or culture, it is important to plan for globalization. One step in that process is ensuring that the text generated for end-user consumption can be easily translated. Verint Community provides support for translating text used by plugins via interaction with the [[api-documentation:ITranslatablePlugin Plugin Type|ITranslatablePlugin plugin type]].&lt;/p&gt;
&lt;h2&gt;&lt;a id="Creating_a_Translatable_Plugin" name="Creating_a_Translatable_Plugin"&gt;&lt;/a&gt;Creating a Translatable Plugin&lt;/h2&gt;
&lt;p&gt;To add support for translating the text rendered by your plugin, implement the [[api-documentation:ITranslatablePlugin Plugin Type|ITranslatablePlugin]] interface (which requires a reference to Telligent.Evolution.Components.dll). The &lt;code&gt;ITranslatablePlugin&lt;/code&gt; interface extends [[Plugins|IPlugin]] to add support for translation.&lt;/p&gt;
&lt;p&gt;First, we&amp;#39;ll define one or more&amp;nbsp;primary set of translations using the &lt;code&gt;DefaultTranslations&lt;/code&gt;&amp;nbsp;property of the &lt;code&gt;ITranslatablePlugin&lt;/code&gt; interface:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="csharp"&gt;public Translation[] DefaultTranslations
{
    get 
    { 
        var translation = new Translation(&amp;quot;en-us&amp;quot;);

        translation.Set(&amp;quot;my_translation_hello&amp;quot;, &amp;quot;Hello&amp;quot;);
        translation.Set(&amp;quot;my_translation_world&amp;quot;, &amp;quot;World&amp;quot;);
        
        return new Translation[] { translation };
    }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This sample defines a default translation for US English (&lt;code&gt;en-us&lt;/code&gt;) with two translated resources: &amp;quot;hello&amp;quot; named&amp;nbsp;&lt;code&gt;my_translation_hello&lt;/code&gt; and &amp;quot;world&amp;quot; named&amp;nbsp;&lt;code&gt;my_translation_world&lt;/code&gt;. The resource name is used to retrieve the translated string from the platform.&lt;/p&gt;
&lt;p&gt;By defining the default set of translations, Verint Community can expose these options via the plugin resource export and import process to enable the default strings to be translated into other languages enabled by the community. to retrieve these translations, the plugin should request the translation from the platform using the [[api-documentation:ITranslatablePluginController Plugin Supplementary Type|translation controller]] provided to the plugin via the &lt;code&gt;SetController()&lt;/code&gt; method of &lt;code&gt;ITranslatablePlugin&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="csharp"&gt;private ITranslatablePluginController _translationController;

public void SetController(ITranslatablePluginController controller)
{
    _translationController = controller;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Generally, the controller is stored in an instance variable of the plugin for later use. Once received during [[Plugin Lifecycle|plugin initialization]], the [[api-documentation:ITranslatablePluginController Plugin Supplementary Type|translation controller]] can be used to retrieve translated resource strings.&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s the complete source of our sample translatable plugin:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://community.telligent.com/cfs-file/__key/communityserver-wikis-components-files/00-00-00-12-83/SampleTranslationPlugin_2E00_cs"&gt;community.telligent.com/.../SampleTranslationPlugin_2E00_cs&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Once this sample is deployed to Verint Community, the plugin will&amp;nbsp;show in &lt;strong&gt;Administration &amp;gt; Translations &amp;gt; Translatables &lt;/strong&gt;to enable on-site translation:&lt;/p&gt;
&lt;p&gt;&lt;a href="/cfs-file/__key/communityserver-wikis-components-files/00-00-00-12-83/8666.png"&gt;&lt;img alt=" " src="/resized-image/__size/1040x0/__key/communityserver-wikis-components-files/00-00-00-12-83/8666.png" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;and its language resources will be included in the import/export of language resources for all plugins at &lt;strong&gt;Administration &amp;gt; Translations &amp;gt; Plugin Translations &lt;/strong&gt;to enable bulk/off-site translation.&lt;/p&gt;
&lt;h2&gt;&lt;a id="Using_Translated_Resource_Strings" name="Using_Translated_Resource_Strings"&gt;&lt;/a&gt;Using Translated Resource Strings&lt;/h2&gt;
&lt;p&gt;Once you&amp;#39;ve implemented &lt;code&gt;ITranslatablePlugin&lt;/code&gt;, you should use the [[api-documentation:ITranslatablePluginController Plugin Supplementary Type|translation controller]] to retrieve translated text using the resource names you defined in your default translation. Using the sample above, we could interact with the&amp;nbsp;&lt;code&gt;_translationController&lt;/code&gt; instance variable&amp;nbsp;of the plugin to retrieve the translation for &amp;quot;hello&amp;quot;:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="csharp"&gt;string hello = _translationController.GetLanguageResourceValue(&amp;quot;my_translation_hello&amp;quot;);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The [[api-documentation:ITranslatablePluginController Plugin Supplementary Type|GetLanguageResourceValue()]]&amp;nbsp;method of the translation controller will return the best matching translation of the requested language resource&amp;nbsp;for the current accessing user (if the explicit language is not provided) or for the explicit language provided.&lt;/p&gt;
&lt;p&gt;Translated language resource strings are useful when implementing other [[Plugins|plugin types]] that interact with users via the UI or background processes.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item><item><title>Translating Plugin Text</title><link>https://community.telligent.com/community/11/w/developer-training/65125/translating-plugin-text/revision/1</link><pubDate>Thu, 13 Jun 2019 19:29:04 GMT</pubDate><guid isPermaLink="false">c2b6465e-5274-4c18-931f-c7a33de4dbe2</guid><dc:creator>Ben Tiedt</dc:creator><comments>https://community.telligent.com/community/11/w/developer-training/65125/translating-plugin-text#comments</comments><description>Revision 1 posted to Developer Training by Ben Tiedt on 06/13/2019 19:29:04&lt;br /&gt;
&lt;p&gt;The [[api-documentation:ITranslatablePlugin Plugin Type|ITranslatablePlugin]] allows you to define language resource strings for use within a [[Plugins|plugin]] that can be translated&amp;nbsp;through the Telligent Community platform.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;[toc]&lt;/p&gt;
&lt;h2&gt;&lt;a id="Why_Should_I_Translate_My_Plugins" name="Why_Should_I_Translate_My_Plugins"&gt;&lt;/a&gt;Why Should I Translate My Plugins?&lt;/h2&gt;
&lt;p&gt;When creating a plugin for reuse or creating a plugin to be used in a community that may grow beyond the scope of a single language or culture, it is important to plan for globalization. One step in that process is ensuring that the text generated for end-user consumption can be easily translated. Telligent Community provides support for translating text used by plugins via interaction with the [[api-documentation:ITranslatablePlugin Plugin Type|ITranslatablePlugin plugin type]].&lt;/p&gt;
&lt;h2&gt;&lt;a id="Creating_a_Translatable_Plugin" name="Creating_a_Translatable_Plugin"&gt;&lt;/a&gt;Creating a Translatable Plugin&lt;/h2&gt;
&lt;p&gt;To add support for translating the text rendered by your plugin, implement the [[api-documentation:ITranslatablePlugin Plugin Type|ITranslatablePlugin]] interface (which requires a reference to Telligent.Evolution.Components.dll). The &lt;code&gt;ITranslatablePlugin&lt;/code&gt; interface extends [[Plugins|IPlugin]] to add support for translation.&lt;/p&gt;
&lt;p&gt;First, we&amp;#39;ll define one or more&amp;nbsp;primary set of translations using the &lt;code&gt;DefaultTranslations&lt;/code&gt;&amp;nbsp;property of the &lt;code&gt;ITranslatablePlugin&lt;/code&gt; interface:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="csharp"&gt;public Translation[] DefaultTranslations
{
    get 
    { 
        var translation = new Translation(&amp;quot;en-us&amp;quot;);

        translation.Set(&amp;quot;my_translation_hello&amp;quot;, &amp;quot;Hello&amp;quot;);
        translation.Set(&amp;quot;my_translation_world&amp;quot;, &amp;quot;World&amp;quot;);
        
        return new Translation[] { translation };
    }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This sample defines a default translation for US English (&lt;code&gt;en-us&lt;/code&gt;) with two translated resources: &amp;quot;hello&amp;quot; named&amp;nbsp;&lt;code&gt;my_translation_hello&lt;/code&gt; and &amp;quot;world&amp;quot; named&amp;nbsp;&lt;code&gt;my_translation_world&lt;/code&gt;. The resource name is used to retrieve the translated string from the platform.&lt;/p&gt;
&lt;p&gt;By defining the default set of translations, Telligent Community can expose these options via the plugin resource export and import process to enable the default strings to be translated into other languages enabled by the community. to retrieve these translations, the plugin should request the translation from the platform using the [[api-documentation:ITranslatablePluginController Plugin Supplementary Type|translation controller]] provided to the plugin via the &lt;code&gt;SetController()&lt;/code&gt; method of &lt;code&gt;ITranslatablePlugin&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="csharp"&gt;private ITranslatablePluginController _translationController;

public void SetController(ITranslatablePluginController controller)
{
    _translationController = controller;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Generally, the controller is stored in an instance variable of the plugin for later use. Once received during [[Plugin Lifecycle|plugin initialization]], the [[api-documentation:ITranslatablePluginController Plugin Supplementary Type|translation controller]] can be used to retrieve translated resource strings.&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s the complete source of our sample translatable plugin:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://community.telligent.com/cfs-file/__key/communityserver-wikis-components-files/00-00-00-12-83/SampleTranslationPlugin_2E00_cs"&gt;community.telligent.com/.../SampleTranslationPlugin_2E00_cs&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Once this sample is deployed to Telligent Community, the plugin will&amp;nbsp;show in &lt;strong&gt;Administration &amp;gt; Translations &amp;gt; Translatables &lt;/strong&gt;to enable on-site translation:&lt;/p&gt;
&lt;p&gt;&lt;a href="/cfs-file/__key/communityserver-wikis-components-files/00-00-00-12-83/8666.png"&gt;&lt;img src="/resized-image/__size/1040x0/__key/communityserver-wikis-components-files/00-00-00-12-83/8666.png" alt=" " /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;and its language resources will be included in the import/export of language resources for all plugins at &lt;strong&gt;Administration &amp;gt; Translations &amp;gt; Plugin Translations &lt;/strong&gt;to enable bulk/off-site translation.&lt;/p&gt;
&lt;h2&gt;&lt;a id="Using_Translated_Resource_Strings" name="Using_Translated_Resource_Strings"&gt;&lt;/a&gt;Using Translated Resource Strings&lt;/h2&gt;
&lt;p&gt;Once you&amp;#39;ve implemented &lt;code&gt;ITranslatablePlugin&lt;/code&gt;, you should use the [[api-documentation:ITranslatablePluginController Plugin Supplementary Type|translation controller]] to retrieve translated text using the resource names you defined in your default translation. Using the sample above, we could interact with the&amp;nbsp;&lt;code&gt;_translationController&lt;/code&gt; instance variable&amp;nbsp;of the plugin to retrieve the translation for &amp;quot;hello&amp;quot;:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="csharp"&gt;string hello = _translationController.GetLanguageResourceValue(&amp;quot;my_translation_hello&amp;quot;);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The [[api-documentation:ITranslatablePluginController Plugin Supplementary Type|GetLanguageResourceValue()]]&amp;nbsp;method of the translation controller will return the best matching translation of the requested language resource&amp;nbsp;for the current accessing user (if the explicit language is not provided) or for the explicit language provided.&lt;/p&gt;
&lt;p&gt;Translated language resource strings are useful when implementing other [[Plugins|plugin types]] that interact with users via the UI or background processes.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item></channel></rss>