Hot answers tagged localization
8
Alexanders answer is probably the way to go, but if you're being lazy and you're using 2010 (it doesn't work on 2007) you can use the numeric values.
0 = Approved
1 = Rejected
2 = Pending
So Approved is
<Query>
<Where>
<Eq>
<FieldRef Name="_ModerationStatus" />
<Value Type="ModStat">0</Value>
...
6
You can add fields programmatically using list.Fields.AddFieldAsXml, providing CAML field definition with resource tokens in it.
Or you can wrap SetValueForUICulture in a nice helper method, and gain a capability to use it for any SPUserResource object. We're using this approach at work, and I would not say, that it is unclear or smth like this :) It's ok, ...
5
To get the field always use the GUID it's the safest. And always put it into a local variable to work with:
var field = customersList.Fields[SPBuiltInFieldId.Title];
To change the display name on the main language (and depending on your settings force that down on all the other languages) set the Title attribute and call Update on the field:
field.Title ...
4
The resource file you are looking for are inside the ApplicationTemplateCore.wsp file, in the Config\Resources\ and Resources\ folders.
Here's a detailed example for the Absence and Vacation Schedule template:
Extract the files from both WSP files (technically they are CAB files)
Translate the resources
AbsenceVacationSchedule:
Create a 1045 folder.
...
4
Although it's not quite what you're looking for, I created the 'SharePoint Language Store' (perhaps not the best name!) on Codeplex as a result of a project I worked on which had 100 SharePoint sites in around 30 languages. We also liked the idea of using a SharePoint list for such values, as the client could add translations over time and it sat well with ...
4
If you open fieldswss.xml you find the declaration of this field
<Field ID="{fdc3b2ed-5bf2-4835-a4bc-b885f3396a61}"
Name="_ModerationStatus"
SourceID="http://schemas.microsoft.com/sharepoint/v3"
StaticName="_ModerationStatus"
Group="_Hidden"
ColName="tp_ModerationStatus"
RowOrdinal="0"
...
4
You can't use AppGlobalResource or <%$Resources:RESXFILE,RESOURCEKEY%> in Sandboxed solutions.
See Localization in SharePoint 2010 Sandbox Solutions for how to use resources in Sandboxed solutions.
3
You can find details about <Mappings> in [MS-WSSCAML]: Collaborative Application Markup Language (CAML) Structure Specification V0.1
"MAPPINGS: A set of MAPPING string elements that represents a canonical, languageagnostic identifier for a corresponding CHOICE with the value specified by the
MAPPING element. The reader MUST ignore MAPPINGS if the ...
3
Formulas and functions depend on the language of your site. It's not just about commas vs. semi-colons, the function names will change too.
You can play with this example:
http://sp2010.pathtosharepoint.com/SharePoint-User-Toolkit/Pages/Color-Coding-Calendar-List.aspx
Change the language, and you'll see how it affects the formula. For example, "IF" will ...
3
I don't think you can reference it statically like that. Try this instead:
<h2><asp:Literal runat="server" ID="Literal1" Text="<%$Resources:MyProject,Test_String_Heading%>"></asp:Literal></h2>
EDIT: it's $Resources versus &Resources. Thanks for picking that up Bojan!
UPDATE: As noted below the $Resources method of ...
3
And adding on Alexander and Ryan's answers, if you rely on the numeric value, watch out for the "4" value, that's the "scheduled" one when the contributor publishes something but SharePoint keep it in temporary draft mode until it enters its publication time frame.
0 = Approved
1 = Rejected
2 = Pending
3 = Draft
4 = Scheduled
A published and approved item ...
2
All Sharepoint element.xml modules are localized the same way.
First of all, you need to deploy your resx files into SharePoint Resources mapped folder.
After this, you can use following syntax to reference your localized resources:
$Resources: ResourceFileNameWithoutExtension, ResourceName
Code sample:
<CustomAction
Id="MyTestCustomAction"
...
2
First of all, a very good MSDN article about localizing SharePoint Sandboxed solutions:
http://msdn.microsoft.com/en-us/library/gg615460.aspx
If you will unable to perform localization through XML, take a look at a code approach: we've done this in a real project, works fine and it is easy to maintain.
You will need to know:
SPWeb.Lists.Add - create ...
2
How interesting! Test this running the latest service pack and cumulative updates. If it still occurs it is obviously a bug that you should report to Microsoft.
In the meantime your best option is to correct the output from stsadm using a simple string replace before attempting to parse it as XML.
2
I'm building this one based on Steve answer and other links, with the major steps needed. It might be helpful for the next ones coming. Please do correct if wrong.
Get the web part gallery as an SPList with GetCatalog(SPListTemplateType.WebPartCatalog)
Find the item in the list corresponding to your web part, e.g. by matching on SPListItem.Name
Create an ...
2
I assume you cannot install a Farm Solution which includes resource files as part of a Hybrid approach? If you can then this does get around the problem.
If not: (sorry if you know this already) as you are probably aware, resources referenced in a .webpart (or.dwp) file look something like this: "$Resources:core,WebPartTitle;" where "core" refers to the ...
2
Actually groups is one of the few kinds of content in SP2010 that are not translatable in MUI in SP2010, so AFAIK you are stuck with the language chosen when site collectionw was created.
Content that cannot be translated:
List Item Data
Permission Levels (Name, Description)
Groups (Name, About Me)
Views (Name)
OOB Web Parts
OOB Properties (Appearance, ...
2
When adding resources to mapped Resource folder you are placing resx files to <hive>\xx\Resources\ folder and your web part cannot access them.
Proper place for this kind of resource is IIS application App_GlobalResources folder (x:\Inetpub\wwwroot\wss\VirtualDirectories\<port>\App_GlobalResources\).
Fore more info you can read SharePoint ...
2
Are you trying to change the display name property of the field? Note that InternalName, display name and StaticName are all different properties of the field. And the display name property is actually called Title.
customersList.Fields["Title"].Title = "Firma";
customersList.Fields["Title"].Update();
2
The .webpart file resources can only exist in the 14 Hive, and there's a reason for this and it's to do with what thread is actually running to the file system to get the resource.
Whenever you use anything in the CAML Provisioning Framework (not official name), whether it's a Site Defintion, a Feature activation, a module pushing files out (like web parts) ...
1
There may be some options that you can try out.
May be you can install an additional language pack of Japanese or Spanish to IE and check out these dialog boxes again. The installation is pretty straight forward - http://www.ehow.com/how_2033270_translate-internet-explorer.html. This option should allow displaying sites in different languages with changes ...
1
If I understand your example correctly I think it's impossible to create a library with MUI-enabled name. The url fragment you're trying to localize is a folder in the file system in SP content database. It can be viewed in Windows Explorer via Web-DAV, for example. How do you think this localization can be handled on the file system level?
1
I fear that you will not like the answer - expecially if you hoped to change that text.
The resource you are searching for is embedded inside the Microsoft.SharePoint.intl dll.
As far as I know, many of the classes in the Microsoft.Sharepoint dll uses resource set programmatically at code level and so do the web controls in the ...
1
What you'll get is two different pages where the system provided text will be automatically localised to each of the locales/languages and the user provided content will need to be manually translated.
Variations will ONLY work for publishing sites and then only for items in the Pages library.
I really like the overview that Gary Lapointe provides in this ...
1
In the end I have followed the direction proposed by Stuart and marked this still another SharePoint blackhole, so I have left any hope of using this CAML tag as last for now.
During my research I had a look at many classes in the framework but I cannot find anything related to using the mapping "attribute", so I can only assume that it was an uncompleted ...
1
What you want to do is set the "WebBrowsable" attribute to false on that web part property and implement your own EditorPart (which is just a specialized control for editing web parts). You will have complete control over it. There are a few methods you'll need to implement (both in your webpart and editorpart classes), but it is pretty straightforward. ...
1
Make sure your format to pick the name from the Resource file is:
Name="$Resources:MyResources,ListInstance_News"
MyResources - name of the resources file (as described below)
ListInstance_News - the resource entry
And the name of Resources file (for the entry above) for English should be:
MyResources.en-US.resx
And deployed to:
...
1
According to MSDN, the SPResource methods retrieve the localized strings from the microsoft.sharepoint.intl.dll assembly, not .resx files.
[I don't have access to SharePoint assemblies at the moment to decompile them and confirm this information - if you do it, post a comment or edit this answer and write what you found.]
1
So I solved it by using Reflector to see how Microsoft loaded their own assembly and did the following:
Assembly.GetExecutingAssembly();
AssemblyName name = null;
name = Assembly.Load("Microsoft.Office.Server.Search, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c").GetName();
name.Name = "Microsoft.Office.Server.Search";
AssemblyName ...
1
Take a look at the following thread:
http://social.msdn.microsoft.com/Forums/en-US/sharepoint2010general/thread/6c7e713d-70e8-49f5-8ff5-7337b56e2bfe?prof=required&lc=1033
My suggestion is to install the SMTP4DEV tool mentioned in the thread (or something similar) to intercept the emails from SharePoint. This will help you in debugging. If the emails are ...
Only top voted, non community-wiki answers of a minimum length are eligible

