SharePoint 2007 Force Culture and UI Culture - sharepoint-2007

i'm developing a sharepoint portal, and i want to force a portal culture to 'pt-PT', i already installed the moss and wss language packs and i changed the web.config too with the following statment: but if i set the browser language to other language the controls change their culture (this only occurs in portal frontoffice, in backoffice the culture is always pt). What i have to do to fix this problem?

You can write a HttpModule which will switch the culture of the executing HttpContext early in the page lifecycle.
BTW I'm just wondering what you mean when you say portal frontoffice vs backoffice.

Related

.NET6 Blazor Server Application Localization

I would like to add language resources to my application based on the browser language preferences.
Blazor server application, .net6, c#
I will be using the syntax such as this on a razor page. #localizer["helloworld"]
I expecting the localizer to know the language set in the browser and then use the appropriate resource file.
I am using ISO language codes for the resource files. The app needs to support english and french, so I have resource.resx and resource.fr.resx
I have spent lots of time trying to get this to work. The documentation seems so easy, yet I have had zero success.
The application will compile and run. The default language of English is always coming up, regardless of the browser language setting. My theory is either the browser language is not being detected, or the naming of the resource file is incorrect preventing the localizer from using it.
The first lesson is that where builder.Services.AddLocalization(); is declared in program.cs is important. It will not function at all if in the wrong location (line)
Does anyone have any experience with this issue using .net6 and Blazor server app?
Thanks,
Marc.
For a full example about localization.
https://github.com/iso8859/AspNetCoreAuthMultiLang
#region Localization
builder.Services.AddLocalization(option => option.ResourcesPath = "Resources");
builder.Services.Configure<RequestLocalizationOptions>(options =>
{
var supportedCultures = new List<CultureInfo>()
{
new CultureInfo("en-US"),
new CultureInfo("fr-FR")
};
options.DefaultRequestCulture = new RequestCulture("en-US");
options.SupportedCultures = supportedCultures;
options.SupportedUICultures = supportedCultures;
});
#endregion
#edit
Because server side blazor app are Single Page App you can't change the cookie. The only way to change a cookie it is to do a page refresh. This is done in the AuthController.cs
For WASM Project you can set cookie using Javascript
the value is for en-US
Set-Cookie: .AspNetCore.Culture=c%3Den-US%7Cuic%3Den-US; path=/
Both the above posts provided the information I needed for my implementation. Some of the MS documentation was a bit cryptic in assuming you knew all the correct parameter settings, but after a bit of tweaking I was successfully able to build the solution I required for my application. Thanks to all for their help.

Where are these poll requests from SignalR coming from?

I have a SPA application using Durandal.
My program starts to have a http request periodically:
http://localhost:1551/f9750d8f8aa54265835e72d56d23144a/arterySignalR/poll?transport=longPolling&connectionToken=AQAAANCMnd8BFdERjHoAwE%2FCl%2BsBAAAACM1YyjLngEiQsL54ET%2B%2FqwAAAAACAAAAAAADZgAAwAAAABAAAAAyZZfHz09psv64kIgPPwQNAAAAAASAAACgAAAAEAAAABMZImCidzdmb21ehxuGD4IoAAAAbazfW7CYR7y7HKb8JPt9ZH9b6fUDlZao60kBG662Vy%2Fb0IHwkwidthQAAAA1qSqnsCOheiNyXiINEyBPBAkqVg%3D%3D&messageId=d-79160814-B%2C0%7CC%2C4%7CD%2C0&requestUrl=http%3A%2F%2Flocalhost%3A2690%2F&browserName=Firefox&tid=5&_=1391326350868
I don't know where does it come from? As I remember I haven't added any reference to SignalR or something like.
How can I check what part of my code is generating this request? and then remove it maybe.
The technologies I'm using are:
Durandal
ASP.NET MVC 4.0
Knockout
ASP.NET WebApi
This is coming from the browser link feature in Visual Studio 2013 in the Standard toolbar. It is code that allows Visual Studio to interact with browsers running the code, and should only show up when running it in debug mode.
To disable it (until the fix to the issue is made live in an upcoming update), follow the directions in #4 of the msdn page to disable it:
Uncheck "Enable Browser Link" in the Browser Link menu item
Set appSetting "vs:EnableBrowserLink" to "false" in web.config or debug=false.
Or you can just ignore it. It wont do any harm, will only happen locally, and should be fixed soon.
Also see this question and this question.

ASP.Net MVC 2.0 with IIS 6.1 Windows 7 static contents path issue

I am working on ASP.Net MVC 2.0 application with .Net framework 4.0 and IIS 6.1 (Windows 7).
When I created virtual directory for my application, the URL routing working for all server side actions. But it doesn't consider static content path like images, scripts and style.
Please help me ASAP.....
UPDATE:
Hi David Thanks for your timely reply.........
Please note the following sample:
I have created a MVC application with the Controller named as Home, inside the controller I am having a action named myhome when I accessing the routed path like localhost/Home/myhome, its accessed fine. Suppose I have some images on the view page. Those images not shown. Because of invalid path. But the same working with Windows 2008 R2's IIS7.0 and run directly from Visual Studio 2010. Only it didn't work on Virtual directly....!!
Are you hard coding paths with a leading slash? If so, stop and use Url.Content() instead. That will automagically handle your virtual directories.
Not much information to know your exact problem but something you can check is if "Anonymous authentication" is using your application pool identity.
On IIS7 double click on Authentication feature for your site and then "Edit..." (right click on "Anonymous Authentication) and change to "Application Pool identity" instead of IUSER.

Crm 4.0 Custom Page (isv) how to get the current crm UICulture

I have a custom page (isv) used in a crm 4.0 solution (through IFrames) and I want it to support multiple languages. I have localized it using resx files, but the UICulture defaults to english event though I have changed it to danish (according to System.Threading.Thread.CurrentUICulture).
How do I get the culture of the current user?
If you are using a custom page under the ISV folder, they are loaded by the CRM application and compiled on demand. So every resources are not loaded by CRM and the pages under this directory are not considered applications by IIS (except if an application is created on the directory, in IIS).
So I think there is two solutions. Create an application in IIS, and in this case the application will be handled by IIS like a standard ASP.Net application. Or you can create standard ASP.NET pages, and let CRM handle them.
In both case the culture is provided by the IFrame. When you configure it in CRM, you have the option of passing parameters (Pass record object-type code and unique identifier as parameters). The parameter that you want is the UserLCID.
See http://msdn.microsoft.com/en-us/library/cc150848.aspx for more information.

Do I have to remove VS 2010 beta1 in order to get a web app to work on asp.net 2.0?

I think the title is enough :). I have VS 2010 beta1 installed, and I wish to run an asp.net mvc application on my local IIS. The problem is, the asp.net 4.0 runtime is selected by default for all the web sites, when I try to change it to asp.net 2.0, I get the following error message:
alt text http://img520.imageshack.us/img520/7946/iiserror.jpg
I click yes, then ok, and when I get back to the ASP.NET tab of my site's properties, I see the 4.0 version is selected back again! Do I have to remove VS 2010 in order to get this to work? (hopefully not)
Ps: I'm using windows XP and IIS 5.1
If you change the Default for your IIS it does not mean that it will change the value on all the sites. You will need to go change them individually back to 2.0

Resources