Sharepoint - Weird language behavior after translation - c#

I'm currently encountering a weird behavior of sharepoint in my current project.
The task is simple in its core:
We have a site collection, where we can create projects (projects are then subsites of the root site again). In v1 our product was only available in one language. In v2 we implement multilanguage.
When the new solutions are deployed, new project site are in the correct state.
The rootsite and older project sites are not.
I'm currently developing the update mechanism for the root and subsites.
And here somethin unexplainable (at least for me) happens:
Navigation:
The navigation nodes have to be updated the following way
foreach (CultureInfo culture in web.SupportedUICultures)
{
node.TitleResource.SetValueForUICulture(culture, SPUtility.GetLocalizedString("$Resources:" + key, resource, (uint)culture.LCID));
}
node.Update();
When I initiate the update while having german as my active display language, exactly 2 nodes are shown as $Resources:.... in german, but in english they are correct.
If i initiate the update while having english as my display language, all nodes are correct in both languages.
Listviewwebpart
On one page we introduced a few listviewwebparts. I create them and customize the view of the webpart. When I start the update with english as language, everything works fine.
The listview is completely translated both in german and english.
However, the moment i let the update run with german as active language, some fields are not translated. And here is the thing: Only in this exact listview! When i switch to the list, and check the fields, everything is ok!
I don't get it.
So in short:
- Update with german: 2 Navigation don't get the resource value (just german, english works fine)
- Update with english: Fields in listview not translated, but the fields are translated in its core.
Did someone ever encountered a behavior like this?
I tried changing the order in which the update works, but nothing changes.

Related

ReportViewer datepicker week start

We have an web application in C# in where we have multiple pages with reportviewer controls, and almost all of them have date parameters.
That date parameters are rendering a datepicker (everything it's fine till this point, no exceptions, no problems) but all the datepickers starts on Sunday ("domingo" in spanish, "do" abbreviated) and our client complains about it; he wants it to start on monday ("lunes" in spanish, "lu" abbreviated).
Accessing the same reports from reportserver works fine, all the datepickers starts on monday("lu") and it works fine:
I've checked that user's Culture and CultureUI it's correct (es-ES for spanish culture); and i think that's working fine cause today's text and day names are properly translated...
I've Googled it and i have only found that if you change DATEFIRST in SQL it must be solved; but it doesn't.
Can anyone give me a clue or any solution?
I know that i can use my own parameter selectors and call the reportViewer only to load the report with the parameters, but this solution will take a long time and we prefer to avoid that solution.
I've also read that with Reflection i can access the Datepicker class inside Microsoft.Reporting and change it to start on monday; but it's not a "nice" solution and it's really complex.
I've had similar trouble with date-format on the client. The doco says that it should determined by the Language of the report, so set that to the language of the client (see below). You could even be more specific and set the language to es-ES
But I've found this approach does not always work. (for me at least). Once the report is set up like this, changing the client locale, should change the date format (and start day of week).
At one point changing the locale of the SSRS server had the desired effect (but this is a pretty sweeping change)

Sitecore Multiple nodes for rendering datasource

I am using Sitecore 7.2(rev. 140228), I have multiple sites & all of them have their own content store or meta-data. Now I wants to give them choice to select datasource either from own meta-data of other site. Although I know another option to make meta-data global outside of all site but in my case it's not an option.
I have wrote an simple Xpath query:
./ancestor::*[##templatename="Main section"]/*[##templatename="SiteFolder"]//*[##templatename="ContentStore"]
Which return me valid result in Sitecore rocks that I wants as below
But when i updated this in my rendering's data source field it returns just first instead of both.
Is there any way to show multiple datasource here.
Thanks ,
There is a bug in early verions of Sitecore 7.x - mutliple roots are not supported for datasource selection.
The issue was fixed in Sitecore 7.2 rev 140526. Check reference number 389483 in Sitecore 7.2 rev 140526 release notes.
If you cannot upgrade to the next version, you may want to contact Sitecore Support - I had the same issue and they sent me a patch which worked for me.

Multilingual Data Display/Edit/Delete UI?

I'm developing a Multilingual website, and I used the following database design approach to build my data structure.
Products
===========
ID
NameResID
DescResID
Price
Resources
===========
ID
ResID
Text
LanguageID
Languages
==========
ID
LanguageName
UserLanguages
===============
ID
UserID
LanguageID
IsDefault
As far as writing the cruds, I wrote all of them, with support of languages.
Now the main issue is backend related, how to Display/Edit/Delete in a nice UI given the following scenario:
User logs on > Adds English and French... as his user languages while having English as his default language, since English is now default when the user goes to add a new product, the product is created and the resources are saved in English, perfect, now the user can change the language to french to add translations for that same product added and also the user can Add a new product in french and when I switch back to English, I can edit its translation in English as well.
What I'm doing right now (picture below) is basing everything on English, and I want to be able somehow NOT to base on English nor the default language cause even the default language can change, I thought of adding a reference name, but I didn't like that approach.
On first brush with this issue, it seems to me like you should just make the language a selectable option at the time of data entry. You can default it to whatever the user's current default language is of course, but it seems like a pain to have to go change your global language preference to enter another language.

Serialization of XML in Silverlight 5

I have a bit of a quandry on my hands which hopefully you can help with.
I've been developing a Silverlight application for a client in Silverlight 4. However it became apparent that I needed to have a button to allow for full screen mode. This was fine and dandy, but when in full screen mode Silverlight 4 disables most of your keyboard inputs for security reasons....... so the reason of going full screen to make entering data into the ChildWindowForms easier then became pointless.
I should point out I can't make this application out of browser due to it having to sit inside Dynamics CRM 2011 to get the context and record id it is sitting on.
Thus began my forray into silverlight 5. This version allows for applications to run in-browser in Elevated trust mode. Previously only available as an out of browser mode.
All was going great, i had figured out that I needed to get a certificate to sign my code, add some registry keys and the user to add a certificate to trusted publishers and got it working. Awesome.
My problem arose when i tried to run my application and i got an exception like this:
There is an error in XML document (1, 41). ---> System.TypeAccessException:
Attempt by security transparent method to access security critical type failed.
At this point, all that had changed code wise was I had signed my projects with a certificate.
It seems that in Silverlight 5 It doesn't "trust" the XmlSerializer object I'm using to read in some XML configuration and deserialize into a .Net Object
After some digging it seems theres a new Serializer in town to do this for Silverlight 5, the DataContractSerializer So i thought, great I can just ammend some of the serialization code and all will be fine. Sadly not the case.
It seems that this version of the Serializer is 33% quicker in this version. The reason it is quicker, is all nodes in the XML must be in alphabetical order. If they are not in this order they are read in as null. (If they happen to be in the correct position they will be read in correctly though. )
So my question is this. Do I have no choice but to reorganize all my XML configuration files into alphabetical order to adapt to this new Serialzer, or is there a way to use the old XML serializer and make Silverlight 5 trust it?
First of all the DataContractSeriailiser isn't new to Silverlight 5 it was there before.
The nodes being in alphabetical order is, I believe, a default. The DataMemberAttribute which you can attach to each property being serialised has a Order property which you can use to dictate the order they appear in.

XMLParseException when searching with tmdb c# api

I am trying to access movie info using themoviedb API as imdb seems like a lost cause.
They use a key which I replaced with *'s but from what I can see this should be all I need to do a simple search
so my code is very simple
TmdbAPI api = new TmdbAPI("***************************");
TmdbMovie[] movies = api.MovieSearch(batman);
But whenever I search I get the XMLParseException unless I outcomment the second line
There is a sample application, but I cant get it to run with VS2010 and I cant see how its doing the things any differently except that app reads the name of the movie from a textbox as mine will further down the road.
Looking at the issue tracker, there appears to be a problem with the returned XML since December 1st 2010 (if not earlier).

Categories