[CLOSED] Template and Localization

  1. #1

    [CLOSED] Template and Localization

    Hi,

    I have a template in a RowExpander plug-in. In this template I have a label
    that must be translated on the basis of the language.
    I have tried to put <asp:literal> but it doesn't work.

    <asp:Literal ID="Literal1" runat="server" Text="<%$ I18n: Label_Sequence%>" />
    How could I do? I have seen this old thread but actually I don't understand the answer.

    http://forums.ext.net/showthread.php...localized-text

    See the example below. The label to translate is "LabelToLocalize"

    Thank you


    
    <ext:GridPanel runat="server" ID="TempBlockGrid" AutoScroll="true" StoreID="TemplateBlockStore">
     
                <ColumnModel>
                    <Columns>
    
                        <%--Fields for List Mode--%>
                        <ext:Column ID="Column4" runat="server" DataIndex="Id" Hidden="True"  />
                        <ext:Column ID="Column5" runat="server" DataIndex="Sortidx" Header="<%$ I18n: Label_Sequence %>" Width="75" Groupable="false" Sortable="false" MenuDisabled="true" />                    
                        <ext:Column ID="Column6" 
                            runat="server" 
                            DataIndex="TextShort"                     
                            Text="<%$ I18n: Label_Text %>"
                            Flex="1" Sortable="False" MenuDisabled="true">
                        </ext:Column>  
                        <ext:Column ID="colTextComplete" runat="server" DataIndex="Text" Hidden="True"/>             
                    </Columns>
                </ColumnModel>
    
                             <Plugins>
                    <ext:RowExpander ID="RowExpander2" runat="server">
                      <Listeners>
                         <BeforeExpand Handler="if(record.data.Text.length > 100) return true; else return false;"></BeforeExpand>
                      </Listeners>
                        
                      <Template ID="Template2" runat="server">
                          
                        <Html>
                          <p><b> LabelToLocalize :</b> {Text}</p>
                          <br />
                        </Html>
                      </Template>
                    </ext:RowExpander>
                  </Plugins>
            </ext:GridPanel>
    Last edited by Daniil; Dec 03, 2013 at 1:25 PM. Reason: [CLOSED]
  2. #2
    Hi @alessandra.monica,

    @Baidaly's suggestion is to do it in code behind:
    this.RowExpander2.Template.Html = string.Format("something {0} something", "localized label");
    or
    this.RowExpander2.Template.Html = fullLocalizedTemplateString;
    You can read from Resources as @Baidaly suggested:
    Resources.Labels.String1
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi @alessandra.monica,

    @Baidaly's suggestion is to do it in code behind:
    this.RowExpander2.Template.Html = string.Format("something {0} something", "localized label");
    or
    this.RowExpander2.Template.Html = fullLocalizedTemplateString;
    You can read from Resources as @Baidaly suggested:
    Resources.Labels.String1
    Ok, but that means that I should put in the code behind the whole content of the template?

    So in my case:

    this.RowExpander2.Template.Html="<p><b> LabelToLocalize :</b> {Text}</p><br />"
    ?

    But the html contains also the dynamic field related to the row of the Grid (in this case {Text}).
    How could I manage it in code-behind?

    Thank you
  4. #4
    Quote Originally Posted by alessandra.monica View Post
    But the html contains also the dynamic field related to the row of the Grid (in this case {Text}).
    How could I manage it in code-behind?
    Well, it is not a problem, please just leave "{Text}" in the template string.
  5. #5
    Quote Originally Posted by Daniil View Post
    Well, it is not a problem, please just leave "{Text}" in the template string.
    Yes Daniil, it works. :-)

    Thank you very much. You can close the thread.

Similar Threads

  1. [CLOSED] International and Localization with Ext.net
    By alscg in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Dec 11, 2012, 9:42 AM
  2. [CLOSED] Localization
    By softmachine2011 in forum 2.x Legacy Premium Help
    Replies: 5
    Last Post: Sep 21, 2012, 11:00 AM
  3. [CLOSED] Ext.NET + MVC 3 + Localization
    By jlosi in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: May 18, 2011, 8:20 PM
  4. Localization
    By ahmadezzeir in forum 1.x Help
    Replies: 13
    Last Post: Dec 21, 2010, 10:19 AM
  5. Localization and Skining
    By Dominik in forum 1.x Help
    Replies: 0
    Last Post: Mar 18, 2010, 11:19 AM

Posting Permissions