views:

92

answers:

2

Hello,

I've been searching on stackoverflow and google for a solution for my 'problem' and still didn't find anything that worked.

I'm developing a solution using Sharepoint 2010 translated to Portuguese, but in some points of the systems, the translation isn't accurate, or, it's a different word that has many other meanings.

I really need (if possible) to change the text of the default 'Browse' tab on this project. I'm messing around trying to find it but still don't have success.

Does anyone know if it's possible to change the default text of the Browse tab, and if yes, where i can do it?

Thank you.

A: 

A bit dirty, but search through the resource files in your Web Application's 'App_GlobalResources' directory.

Alternatively you should be able to search through all '.resx' files in your '14 hive'. Once changed run stsadm -o copyappbincontent to apply these changes.

Note that if you apply patches or service packs in the future then you'll most likely need to make these changes again.

Muhimbi
A: 

Navigate to "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\Resources\" in your windows explorer, and open core.pt-br.resx with Notepad.

Find words: "ReadTab".

Change value of this resource to whatever you want. For example:

<data name="TabRead">
  <value>Browse test</value>
</data>

Make iisreset (press Start, type "iisreset", and press Enter).

Refresh your site. You will see:

alt text

It is most fast way to achieve what you want. But, most likely, you should need to redo this operation every time you install fresh service pack, so it is not the best way. Microsoft do not recommend change internal SharePoint files.


Another way here, the right one, is to create simple SharePoint solution with one little feature. It is the right way, but it takes a little more time.

But if you have Visual Studio and base programming skills, you can do this easily.

What we will do:

  1. We will add our own resource file, so later we can add translations for other languages and add resources for other places, where you want to change the translation.
  2. We will add feature, which will modify browse tab, changing it title, so it will point now to our own language resource value

Let's start!

First of all, please, open Visual Studio 2010 and create empty SharePoint project:

alt text

Choose farm solution in creation wizard, and press Finish. Ok, solution is ready now.

Next step is to add mapped folder for resource files. Right-click on project, and select Add -> SharePoint mapped folder.

alt text

Select Resources folder, and press OK. Now, you should add your own resources file. Right-click on Resources folder, and select Add -> New item.

Select "General" group under C#, and scroll down to Resource file. Click Add.

alt text

Now you should add your resource. For example, name it "MyBrowseTabTitle":

alt text

Next, you should add a new feature. Right-click on Features folder in your project tree, and select Add feature.

alt text

You can name your feature as you wish. Next step is creating module with some elements. Right-click on project title and select Add -> New item. Select SharePoint -> 2010 element group, and find Module element. Click Add to confirm.

alt text

File with elements manifest should open up (it is inside your new Module). Replace elements.xml file contents with following code:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/"&gt;
  <CustomAction
  Id="ChangeBrowseTabTitle"
  Location="CommandUI.Ribbon">
    <CommandUIExtension>
      <CommandUIDefinitions>
        <CommandUIDefinition
          Location="Ribbon.Read">
          <Tab
            Id="Ribbon.Read"
            Title="$Resources:Resource1,MyBrowseTabTitle;"
            Sequence="100"
            Command="ReadTab"
            Description=""
            CssClass="ms-browseTab"
            >
            <Scaling Id="Ribbon.Read.Scaling" />
            <Groups Id="Ribbon.Read.Groups" />
          </Tab>
        </CommandUIDefinition>
      </CommandUIDefinitions>
    </CommandUIExtension>
  </CustomAction>
</Elements>

For details on customising ribbon, you can follow this link:

http://msdn.microsoft.com/en-us/library/ff458373.aspx

Ok, now you're ready to deploy. First, right-click on project name and select "Package". Now make sure, that your Package.package file inside project folder, contains following files:

alt text

If all is right, now you should point your SharePoint Project to your own site. Modify your project properties (right-click on project title, select "Properties", and find "Site URL" setting). Here I expect, what SharePoint is installed on the same machine, where the Visual Studio is running.

Finally, you should right-click on project, and select Deploy.

You should see some output in your Visual Studio output window, ending with this line:

========== Deploy: 1 succeeded, 0 failed, 0 skipped ==========

Great! All is ready now. Now open Internet Explorer and navigate to your sharepoint site. You will see something like this:

alt text

Later, if you need, you can change feature scope, to use this feature on site collections, or to deploy it globally on your farm.

alt text

Feel free to ask for any details.

Hope it helps!

omlin