Last post Jan 11, 2011 09:39 PM by humanitycompany
Jan 11, 2011 06:49 PM|humanitycompany|LINK
I have mulitlanguage platform in place - need to have the HEADER LOGO.PNG on my site to change with my language-button function.
My startingpoint is this from my Masterpage :
<a href="default.aspx"> <br />
<img alt="Logo" src="Images/Logo_white.png" width="780" height="148" border="none" class="logo" /></a>
And i want to avoid using 2 Masterpages because of 2 image files - the other Logo_white_en.png....Any ideas? How would it work with recource files? Everyting I read about Image-files, resources and localization seems to fail - anyone with a working solution?
Jan 11, 2011 07:43 PM|Bhaarat|LINK
you can create separate theme for it..
as you are appliying localization same way assign theme for it... in your theme, you will have Separate CSS for each localization
so it will change your logo even you want to change other images, fonts, etc can help you better
All the best
Jan 11, 2011 09:39 PM|humanitycompany|LINK
Thanks for paying interest....Image Localization is in place. I used App_GlobalResources - With String Name:
LogoMainHead and Value: ~/images/Language1.png in Resource files called SiteMapLocalizations.resx & SiteMapLocalizations.en.resx
<asp:ImageButton ID="Image1" runat="server" PostBackUrl="~/default.aspx" meta:resourcekey="Image1Resource1"_
ImageUrl="<%$Resources: SiteMapLocalizations, LogoMainHead%>" ImageAlign="Middle" />
<asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/Images/Language1.png" AlternateText="Language1" />
<asp:ImageButton ID="ImageButton2" runat="server" ImageUrl="~/Images/Language1.png" AlternateText="Language2" />
But problem now is that my function in MastePage.Maser.vb will not kick:
Protected Sub ImageButton1_Click(ByVal sender As Object, ByVal e As ImageClickEventArgs)
Dim cookie As New HttpCookie("SelLang")
cookie.Value = CultureInfo.CurrentCulture.CultureTypes
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("nb-NO")
Thread.CurrentThread.CurrentUICulture = New CultureInfo("nb-NO")
Dim geturl As String
geturl = Request.Url.ToString()
I had a DROPDOWN rutine before - that worked perfect. But now I want to 2 buttons with the above ImageButton1_Click - but something is wrong - the language will not change.
I have a BasePage.vb with the following that is inherited by all pages:
Public Class BasePage
Protected Overrides Sub InitializeCulture()
Dim lang As String = String.Empty
'default to the invariant culture
Dim cookie As HttpCookie = Request.Cookies("SelLang")
If cookie IsNot Nothing AndAlso cookie.Value IsNot Nothing Then
lang = cookie.Value
Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo(lang)
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(lang)
Anyone see what i am missing - or doing wrong?