YAFLogo

izar
  • izar
  • 55.4% (Neutral)
  • YAF Camper Topic Starter
14 years ago
I want to convert admin area of the forums multilanguage.

For example, I have change

<tr>
          <td class="header1" colspan="5">
            Who is online</td>
</tr>

<tr>
          <td class="header1" colspan="5">
            <YAF:LocalizedLabel ID="Localizedwhoonline" runat="server" LocalizedTag="WHO_ONLINE" /></td>
</tr>

And I have added in the languages/english.xml:

 <page name="ADMIN">
    <Resource tag="WHO_ONLINE">Who is online</Resource>
    <Resource tag="NAME">Name</Resource>
    <Resource tag="IP_ADDRESS">IP Address</Resource>
    <Resource tag="LOCATION">Location</Resource>
    <Resource tag="FORUM_LOCATION">Forum Location</Resource>
    <Resource tag="TOPIC_LOCATION">Topic Location</Resource>
    <Resource tag="UNVERIFIED_USERS">Unverified Users</Resource>
    <Resource tag="EMAIL">Email</Resource>
    <Resource tag="LOCATION">Location</Resource>
    <Resource tag="JOINED">Joined</Resource>
	</page>

What are the steps to convert admin Area multi-language?

thanks

Sponsor
Ederon
  • Ederon
  • 100% (Exalted)
  • YAF Developer
14 years ago
You're doing it right. You just need to add following constructor to the code-behind of admin.ascx

  public partial class admin : AdminPage
  {
	  public admin()
		  : base("ADMIN")
	  {
	  }
	  ...

Anyway, if you are going to do this, you do it right and share it with others, you'll earn big recognition. 😎


When I post FP:Ederon in a topic, I'm leaving my footprint there so I can track it once I get into coding/supporting.
bbobb
  • bbobb
  • 100% (Exalted)
  • YAF Developer
14 years ago
Some notions:

1.How much adding of the tons of rarely used new tags to a single file will decrease access time to other tags which are used in 99,9% cases?

2.Adding all the tags to a single page parent node will make even XPath queries work slow, as the total number of tags to localize is huge.

izar
  • izar
  • 55.4% (Neutral)
  • YAF Camper Topic Starter
14 years ago

You're doing it right. You just need to add following constructor to the code-behind of admin.ascx

  public partial class admin : AdminPage
  {
	  public admin()
		  : base("ADMIN")
	  {
	  }
	  ...

Anyway, if you are going to do this, you do it right and share it with others, you'll earn big recognition. 😎

Ederon wrote:

mmmm my labels appear blank....

Im writing the labels in forum/languages/.xml

well

step 1: for example in admin/admin.ascx I changed


<td class="header2">
            IP Address</td>
          <td class="header2">
to


<td class="header2">
            <YAF:LocalizedLabel ID="IP_ADDRESS" runat="server" LocalizedTag="IP_ADDRESS" /></td>
          <td class="header2">

I change

public partial class admin : AdminPage
  {
      
to

    public partial class admin : AdminPage
  {
      public admin()
          : base("ADMIN")
      {
      }

And in forum/Languages/ I added

<page name="ADMIN">
 ..............
    <Resource tag="IP_ADDRESS">Ip Address</Resource>
...........
	</page>

But in the control panel the labels are blank

What is missing?

thanks

izar
  • izar
  • 55.4% (Neutral)
  • YAF Camper Topic Starter
14 years ago
Any advice? thanks
Ederon
  • Ederon
  • 100% (Exalted)
  • YAF Developer
14 years ago
Dunno what are you doing wrong, but there may be typo somewhere in your code/files.

I tried it and it works just, see for yourself.


When I post FP:Ederon in a topic, I'm leaving my footprint there so I can track it once I get into coding/supporting.
izar
  • izar
  • 55.4% (Neutral)
  • YAF Camper Topic Starter
14 years ago
Thanks, Now is working fine!!

But I have a problem. Some buttons trnaslate fine and others are blank.

For example in pages/admin/admin.ascx


<FooterTemplate>
      <tr>
        <td class="footer1" colspan="5">
          <asp:Button OnLoad="ApproveAll_Load" CommandName="approveall" CssClass="pbutton" runat="server" Text='<%# PageContext.Localization.GetText("APROVEALL") %>' runat="server" />
          <asp:Button OnLoad="DeleteAll_Load" CommandName="deleteall" CssClass="pbutton" runat="server" Text='<%# PageContext.Localization.GetText("DELETE_OLD") %>' runat="server" /></td>
      </tr>
      
    		</FooterTemplate>

works fine

but Pages/admin/bannedip_edit.ascx


<tr>
			<td class="footer1" colspan="2" align="center">
			<asp:Button ID="save" runat="server" Text='<%# PageContext.Localization.GetText("ADMIN_SAVE") %>' OnClick="Save_Click"></asp:Button>
				<asp:Button ID="cancel" runat="server" Text='<%# PageContext.Localization.GetText("ADMIN_CANCEL") %>' OnClick="Cancel_Click"></asp:Button>

			</td>
		</tr>

Doesnt work. Why?

Thanks

Ederon
  • Ederon
  • 100% (Exalted)
  • YAF Developer
14 years ago
Because <%# is evaluated on data binding (for instance within repeater as in first example). Try using <%= instead
When I post FP:Ederon in a topic, I'm leaving my footprint there so I can track it once I get into coding/supporting.
izar
  • izar
  • 55.4% (Neutral)
  • YAF Camper Topic Starter
14 years ago
<asp:Button ID="save" runat="server" Text='<%= PageContext.Localization.GetText("ADMIN_SAVE") %>' OnClick="Save_Click"></asp:Button>

Is showing the literal

"<%= PageContext.Localization.GetText("ADMIN_SAVE") %>"

And text without single quotes

<asp:Button ID="save" runat="server" Text=<%= PageContext.Localization.GetText("ADMIN_SAVE")%> OnClick="Save_Click"></asp:Button>

shows the error ="Server labels can not contain <% ... %>."

bbobb
  • bbobb
  • 100% (Exalted)
  • YAF Developer
izar
  • izar
  • 55.4% (Neutral)
  • YAF Camper Topic Starter
14 years ago

As you know, I´m transatin the Admin part of YAF forums. But I´m Havig a trouble. I tranlated The top bar Of Edit User like this


<DotNetAge:Tabs ID="EditUserTabs" runat="server" ActiveTabEvent="Click" AsyncLoad="false"
		AutoPostBack="false" Collapsible="false" ContentCssClass="" ContentStyle="" Deselectable="false"
		EnabledContentCache="false" HeaderCssClass="" HeaderStyle="" OnClientTabAdd=""
		OnClientTabDisabled="" OnClientTabEnabled="" OnClientTabLoad="" OnClientTabRemove=""
		OnClientTabSelected="" OnClientTabShow="" SelectedIndex="0" Sortable="false" Spinner="">
		<Animations>
		</Animations>
		<Views>
	<DotNetAge:View runat="server" ID="View1" Text='<%#GetText("ADMIN_USER_DETAILS")%>' NavigateUrl="" HeaderCssClass=""
				HeaderStyle="" Target="_blank">
				<uc1:QuickEdit ID="QuickEditControl" runat="server" />
			</DotNetAge:View>
			<DotNetAge:View runat="server" ID="View2" Text='<%#GetText("ADMIN_USER_ROLES")%>' NavigateUrl="" HeaderCssClass=""
				HeaderStyle="" Target="_blank">
				<uc1:GroupsEdit ID="GroupEditControl" runat="server" />
			</DotNetAge:View>
			<DotNetAge:View runat="server" ID="View3" Text='<%#GetText("ADMIN_USER_PROFILE")%>' NavigateUrl="" HeaderCssClass=""
				HeaderStyle="" Target="_blank">
				<uc1:ProfileEdit ID="ProfileEditControl" runat="server" />
			</DotNetAge:View>
			<DotNetAge:View runat="server" ID="View4" Text='<%#GetText("ADMIN_USER_AVATAR")%>' NavigateUrl="" HeaderCssClass=""
				HeaderStyle="" Target="_blank">
				<uc1:AvatarEdit runat="server" ID="AvatarEditControl" />
			</DotNetAge:View>

But when i clik on button the text dissapears. How can I solve this ajax problem?

look

UserPostedImage

UserPostedImage

izar
  • izar
  • 55.4% (Neutral)
  • YAF Camper Topic Starter
14 years ago
It seems to be working now. I added this to the page_load event, at the end of the page:


 this.EditUserTabs.Views["View1"].Text = GetText("ADMIN_USER_DETAILS");
      this.EditUserTabs.Views["View2"].Text = GetText("ADMIN_USER_ROLES");
      this.EditUserTabs.Views["View3"].Text = GetText("ADMIN_USER_PROFILE");
      this.EditUserTabs.Views["View4"].Text = GetText("ADMIN_USER_AVATAR");
      this.EditUserTabs.Views["View5"].Text = GetText("ADMIN_USER_SIGNATURE");
      this.EditUserTabs.Views["View6"].Text = GetText("ADMIN_USER_PASSWORD");
      this.EditUserTabs.Views["View7"].Text = GetText("ADMIN_USER_POINTS");
      this.EditUserTabs.Views["View8"].Text = GetText("ADMIN_USER_SUSPEND");
      this.EditUserTabs.Views["View9"].Text = GetText("ADMIN_USER_KILL_ACTIVITY");