Posts

Showing posts with the label lingua

Sharepoint 2010 - Change UI Language with javascript

If you want to use html/javascript to change UI language, you can use the script below: (Note: in the page, there is the function OnSelectionChange, so you have to change name if you want to use other feature in) function OnSelectionChange(value) {     var today = new Date();     var oneYear = new Date(today.getTime() + 365 * 24 * 60 * 60 * 1000);     var url = window.location.href;     document.cookie = "lcid=" + value + ";path=/;expires=" + oneYear.toGMTString();     window.location.href = url; } And in page, set the flags for change language: <a href="javascript:OnSelectionChange(1040)">     <img width="32" height="20" src="/SiteAssets/flag_ita.png" border="0" alt="Italiano"/> </a> <a href="javascript:OnSelectionChange(1033)">     <img width="32" height="20" src="/SiteAssets/flag_eng.png" border="0" alt=...

Sharepoint 2010 - Filter Web Part with Current User Language

Image
I have to filter a List/Library on current User Language. I add column Language Code, with values of platform language codes (1033 for english, 1040 for italian). With Sharepoint Designer 2010, I modified Web Part and I set a new parameter as below, using COOKIE source parameter with "lcid" name: and the filter : So, web part shows me documents/items filtered with language = italian/english choosen by user! For italian: For english:

Sharepoint 2010 - Cambiare Lingua al Titolo delle Web Part

Sharepoint 2010 dà la possibilità di implementare la localizzazione dei siti (e dei suoi elementi), grazie alla Multilanguage User Interface. Purtroppo, come ben documentato da MS stessa ( http://technet.microsoft.com/it-it/library/ff805062.aspx#Section7 ), non tutti gli elementi di un sito possono avere al seguito le traduzioni. Una possibilità è quella di utilizzare un controllo client che ci permetta di cambiare lingua al titolo delle web part. Analizzando il codice della pagina prodotta da Sharepoint, ho individuato i tag necessari ad identificare il titolo della web part. Titolo della Web Part La class ms-WPTitle dell'elemento h3 definisce il titolo della web part. Al suo interno, dobbiamo cercare il tag "span" che contiene il titolo. Generalmente è il primo dei due, senza id e, ovviaemente, non vuoto. Bene, sappiamo dove prendere il titolo. Definiamo ora un modo con cui l'utente possa essere autonomo nella gest...