Hot answers tagged

13

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> ...


9

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 ...


8

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, ...


7

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 ...


6

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" ...


5

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

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" ...


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

Have a look at SPUtility.GetLocalizedString()


3

ok, it seems that the solution is to return number as string and replace comma with dot - apparently with ProcessBatchData regional settings of the site are not used, so I had to provide the number with standard english-version format


3

You can create a single global resources file and deploy it to: {WebApplicationRoot}\App_GlobalResources\ This post shows you more on how to do it: http://blogbaris.blogspot.co.uk/2012/07/localization-with-sharepoint-2010-and.html The post is based on SP2010 but works just as well for SP2013


3

In the SharePoint projects I have worked on I have used a few different ways to localize page content. I think the simplest way for you will be with an EncodedLiteral: <SharePoint:EncodedLiteral runat='server' text='<%$Resources:wss,language_value%>' EncodeMethod='HtmlEncode' /> For the RESX files, in the SharePoint project I create a ...


3

take a look at this article in MSDN. It'll outline to you the procedures and limitations about localizing Sandboxed solutoins (same applies to SP 2013): Localization of Sandboxed Solutions in SharePoint 2010


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

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

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

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

The problem is that when you create a column, the name you enter is just a constant string. SharePoint does not do translation based on known words. Internationalization is based on resource files. And while I have used resource strings with custom list definitions, I wasn't sure if they would work on lists and columns created in the browser. So tried a ...


2

Here's how to do it programatically: // Assuming list contains a SPList object string fieldID = "FieldUniqueID"; list.Fields.Add(fieldID, SPFieldType.Text, false); list.Fields[fieldID].Title = "$Resources:Example,FieldUniqueID"; list.Fields[fieldID].Update(); Note that you cannot stick "$Resources:Example,FieldNameI18N" right into Fields.Add() because ...


2

Could you not limit it to the following columns? Name (English) Name (Local) Local Language


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

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: ...


2

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 ...


2

You could use the regular way of using string resources from SharePoint. Try the following : SPUtility.GetLocalizedString("TheResourceKey", "TheResourceFile", (uint)culture.LCID); That way, you will be able to get any resource key from any resource file!


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 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

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

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

An interesting question! I assume you want to load the locale in javascript (in order to use it with Globalize.js). Regardless the solution I see some problems: What data source to trust: navigator.language, user prefered language in browser (Accept-Language) or SPRegionalSettings of an SPUser? What if the user locale differs from the web locale and you ...



Only top voted, non community-wiki answers of a minimum length are eligible