Hy,
I would like anonymous users to be able to select their preffered language using just the language combo which would be available on the home page.I have tried to update the anonymous profile when the new language was selected, but nothing happened.I think that this is due to the fact that anonymous users either do not have profiles, or they have read only access to it.
Any thoughts?
Thanks,Vali
I think this is due to the fact that anonymous users do not have profiles, and hence cannot set their language preference.
Also, here is a tool for localization. The downloads are also in the CS download section...
haathi featuring a blog..
I have already been using that tool to localize CommunityServer.
The problem I am facing is the following: I want users to be able to select a language when viewing the web site without the need of loging in.
Example:
A.Profile.Language = AnonymousLanguage.SelectedItem.Value;
ok = CommunityServer.
That doesn't make logical sense.
I mean, there is only 1 "physical" anonymous user, so if 10 visitors come to your site and each 1 keeps flipping the language, how is it going work ?
I think the first line could be replaced with:
But I am not sure that it will return the anonymous user, or an anonymous visitor. Either the cases, I would even be happy if I could change the language for the anonymous user.
I am trying to do exactly the same thing, but running into some issues.
Here is what I have done so far:
I have implemented the language chooser on our forum site, where non-logged in (anonymous) or logged in user can select the language from the drop down list.
Most of the functionality is working fine J , but I have few issues and some key questions.
You can see the code in action at http://forums.pinnaclesys.com/
Try selecting French from the list on this page http://forums.pinnaclesys.com/forums/default.aspx and you will notice the Search button text remains in English.
You can try this scenario on the same site. Just select language different than your preferred language in profile, close the browser and visit again.
void Page_Load(object sender, System.EventArgs e) {
User editableUser = CommunityServer.Users.GetUserWithWriteableProfile(CSContext.Current.User.UserID, null, true); if (!Page.IsPostBack) { Bind(editableUser.Profile.Language); } this.LanguageSelectorDropDownList.SelectedIndexChanged += new System.EventHandler (this.LanguageSelectorDropDownList_SelectedIndexChanged);
}
void Bind(string UserLanguage) { LanguageSelectorDropDownList.SelectedValue = UserLanguage; } void LanguageSelectorDropDownList_SelectedIndexChanged(object sender, System.EventArgs e) { string language = LanguageSelectorDropDownList.SelectedValue; //Response.Write(language);
CSContext csContext = CSContext.Current; bool bUpdated;
//CSCache.Clear(); //Not sure, if we should clear the cache. If we clear cache, the "Most Active Users" shows nothing for few minutes. User editableUser = CommunityServer.Users.GetUserWithWriteableProfile(CSContext.Current.User.UserID, null, true);
editableUser.Profile.Language = language; LanguageSelectorDropDownList.SelectedValue = language;
bUpdated = CommunityServer.Users.UpdateUser(editableUser);
I think the main problem is, CS is changing the language for ALL anonymous users when "any" user changes the language from dropdown. Also when logged in user selects different language from drop down, then CS saves that language as preferred language for same user.
Please help me here
Thanks,
Sameer
Off the top of my head: I wonder if the provider model would allow a derived "CSUser" class to override some "get_language" method. For anonymous, it could check the session/cookie. If not anonymous or the session/cookie doesn't have it, then it calls the base/inherited implementation.
I'd like this for my multi-lingual community also, as I have many non-English speakers who need a few pages (minimal) so they can atleast sign up and then edit their profile to set their language. Now, it's hard for them to sign-up since they can't read the sign-up screens!
skhasnis2:I think the main problem is, CS is changing the language for ALL anonymous users when "any" user changes the language from dropdown. Also when logged in user selects different language from drop down, then CS saves that language as preferred language for same user. Please help me here Thanks, Sameer
This is what I have been trying to tell you guys all this time. It is not a "problem" with CS.
There can be only 1 anonymous user profile at any time, for ALL users who are not logged on. This the reason why you provide the membership feature in your application for users who want to move from an anonymous profile to an identifyable customizable profile.
In other words, there is such concept of "ALL" Anonymous users.
haathi: skhasnis2: I think the main problem is, CS is changing the language for ALL anonymous users There can be only 1 anonymous user profile at any time ... This the reason why you provide the membership feature in your application ...
skhasnis2: I think the main problem is, CS is changing the language for ALL anonymous users
I think the main problem is, CS is changing the language for ALL anonymous users
There can be only 1 anonymous user profile at any time ... This the reason why you provide the membership feature in your application ...
The problem still remains for anonymous users who want to become members, but can't read the web pages required to join and become members.
--Troy
I say this being a novice at CS matters, but have you considered using the ASP.NET 2.0 anonymous profile feature for this?
skhasnis2:
Your site seems to work fine with selected language. How did you overcome changing languages for Anonymous? This problem really got me. I appreciate if you can share your experiences. Thanks!
Copyright© 2008 Telligent Systems Inc. All rights reserved CommunityServer.com • Telligent.com