Hot answers tagged

8

Yes, take a look into the file C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\Resources\core.resx The format is : $Resources:name_of_resource_file, key_of_ressource A warning thought, this will concerns the resources you will find in all xml files, or in code. In aspx markup, the resources will be read from ...


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


5

RegisterSod doesn't fetch the script file. You must load it. Use LoadSodByKey, or use the plain tag to load it synchronously. I wrote a blog post about how to use javascript localizaton in SharePoint and scriptresx.ashx . Waldek Mastykarz shows how to use it with RegisterSod. But you have to know, that the script won't be downloaded before you explicitly ...


3

Have a look at SPUtility.GetLocalizedString()


3

You mean like this? using (SPSite site = new SPSite("http://localhost")) { using (SPWeb web = site.RootWeb) { if (web.IsMultilingual) { IEnumerable<CultureInfo> cultures = web.SupportedUICultures; foreach (CultureInfo culture in cultures) ...


3

SPUtility.GetLocalizedString("$Resources:YourKeyValue", "Comp.Dept.Proj.Farm\\GloablResources", 1033); plz refer this link http://geekswithblogs.net/venkatx5/archive/2010/12/14/how-to-create-multilingual-webpart-in-sharepoint-2010.aspx


3

For shared resource files in SharePoint (i.e. RESX files that must be shared amongst Features/Projects/Solutions), the best thing to do is to deploy them to the SharePoint Root's "Resources" folder (14/Resources). Then you'd reference them in one of two ways. In the RESX reference, you can specify the file name in the RESX reference like so (leaving off ...


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

The default language for a whole SharePoint system is based on the installation language of original SharePoint installation media and cannot be changed (without a re-install). With additional language packs, site collections can be created in a selection of languages, but once again, once the site collection has been created, the default language cannot be ...


2

Perhaps the extra semicolon after resource key name "Devider" is causing the problem. It is not required.


2

Maybe you could make a copy of the ProjectResources.resx, then rename it as ProjectResources.en-US.resx.


2

If you are asking how to add them to your project, you can map the Layouts folder by right clicking on your project and selecting Add, SharePoint "Layouts" Mapped Folder. That should create a folder with the same name as your project. Anything that you add will be available globally in the /_layouts// folder. It is also possible to map to the SharePoint ...


2

You can't have resources files in webtemp*.xml files... Those are already localized with the folder that contains them. For example, check the file webtempsps.xml in the path C:\Program Files\Common Files\microsoft shared\Web Server Extensions\12\TEMPLATE\1033\XML. You will see that every string literals are in fact real string, and not in the format ...


2

SpContext.CurrentWeb.Language always returns languages that is used for site creation, if you would like to change languages on your site dynamically you should use `Thread.CurrentCulture.LCID'. If you would like to get this values in .aspx file, you should create module that deploys resources files to the GlobalResources folder. See this post how to do it. ...


2

You can add the layouts mapped folder to your project and keep javascript and css files there.You can then use ScriptLink class to register the js and CssRegistration class to register the css in the Page_Load method of the webpart. Following is the example: private const string script = "/_layouts/JQuery/JS/jquery.min.js"; ScriptLink.Register(Page, script ...


2

In SharePoint 2013 many (most?) of those strings are available either directly in JavaScript files (localized in folders such as Layouts\1033), or in culture-specific resource DLLs. Many of these DLLs are then loaded through the ScriptResx.ashx handler. For example, see these objects in JavaScript: SP.Res.* -> Loaded through ScriptResx.ashx Srch.Res.* -> ...


2

How do you mean? Most of the resources files can be found under C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\Resources, and hence can be altered without deploying a solution. But it is probably wise to update your resources also in your solution, to prevent it from overwriting your changes on the next deploy


2

There are two ways to use resource file. In .ascx file: <asp:Label ID="lbl1" runat="server" Text="<%$Resources:ResourcesFileName, ResourceFileItemKey %>" And in .cs file use SPUtility.GetLocalizedString() method For the second option your resource file should be present in sharepoint mapped resources folder. For more details visit this link ...


2

Localization of feature.xml differs from localizing something else. As by Microsoft's reference, you have to create a special Feature resource file (which will be stored along with the feature) in order to do that: How to: Localize a feature (MSDN) Based on my experience, if you deploy your resources into "Resources" mapped folder (in 14 hive), they will ...


2

I have the same issue in our SharePoint projects, but gave up on it because it appeared that SharePoint wasn't applying the resource fallback mechanism like I expected it to. Then I saw this post and decided to research this a little. I came across this article http://msdn.microsoft.com/en-us/library/ee696750.aspx and it says that a Default resource is: ...


2

SharePoint fallback is not like the ASP.NET fallback to the invariant culture; is first use the thread CurrentUICulture, then fallback to the SPWeb.Language: http://blogs.msdn.com/b/sharepointdev/archive/2011/07/01/localizing-the-sharepoint-user-interface-by-using-resource-files-sanjay-arora.aspx


2

Don't know if the OP still need this, but I hope it may be usefull to anyone experiencing the same issue. Turn out that Wictor Wilén has built a visual studio extension that manages the aforementioned setting automatically. You can find it on the Visual Studio Gallery under the name "SPResX Visual Studio 2012 Extension". It also offer the ability to ...


1

I found the problem, and that was that I was trying to use the wrong approch. For adding tranlations to the ASPX app pages, one needs to use the javascript resource file approch as described in http://msdn.microsoft.com/en-us/library/fp179919.aspx#LocalizingAppWeb under "How to create javascript resource files for custom pages." Works like a charm. :)


1

Here's a guide on how to make your resource files both localized as well as globalized


1

So, from the link mentioned in my comment above: <%= SPUtility.GetLocalizedString("$Resources:MyTitle", "MeResourceFile", Thread.CurrentThread.CurrentUICulture.LCID); %> http://social.msdn.microsoft.com/Forums/sharepoint/en-US/6d036f6a-d1e5-41ce-b5dc-f8a0060d0f5d/access-resource-file-from-page-layout


1

try by adding the Threading namespace to the top of the page: <%@ Import NameSpace="System.Threading" %>


1

Create new "Import SharePoint Solution Package" from Installed templates project and select your web template that you import from sharepoint than add resource file to your solution: add Resource File project items to your project. If you do not have to localize code in addition to the markup, you can instead add Global Resources Files. Provide a name for ...


1

Add the mapped folder called RESOURCES to you solution and then add you resx files there. If you want to add your resx files in the App_GlobalResource folder in the IIS, then add an Empty Element to you solution, add your resx files to that and modify the SharePointSolutionItem.spdata to target the App_GlobalResource folder like so: <?xml version="1.0" ...


1

You can create new feaure and in it's "FeatureReceiver.FeatureActivated" you can get web part on the page and change it with your resource file. Look these two relative questions: How to localize webpart title, description, group, quickadd group in Sandbox solution CQWP - dynamically setting the list


1

Unfortunately just specifying resource string for WebUrl property of ContentByQueryWebPart web part is not enough since resource string could not be resolved dynamically (basically not supported) using SharePoint web parts infrastructure like in case of Url tokens (e.g. ~sitecollection). But, you could consider the following approach. Solution The ...



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