How to create Multilingual search site with variation
I see this question many times in MSDN forum of SharePoint “ How to create Multilingual search site with variation” so to fix this issue I have a site collection with two variation labels (Arabic and English) so we need to redirect the user to Arabic Result page or site when he in Arabic site and vice versa.
Steps:
- Create a site collection with two labels variation (Arabic | English) for this example.
- Create a sub site for Search result under each language or label for ex ar/search and en/search.
Note: No need for site you can go with result page even which contains the core result web part and other search web parts.
3. Create two scopes , one to show only Arabic results and one for English results [ and scope name to core result web part properties].
4. Create three resources file named as following (myresource.resx , myresource.en-US.resx ,myresource.ar-SA.resx)
5. add these keys in the resources file ( SearchText , SearchUrl,.. any things need to localize)
6. save these resources to App_GlobalResources under your web application port in this path C:\inetpub\wwwroot\wss\VirtualDirectories
7. edit master page of your site using SharePoint Designer 2010 and then add the following tags
add this at the top of master page if not exists
<%@ Register tagprefix="SPSWC" namespace="Microsoft.SharePoint.Portal.WebControls" assembly="Microsoft.Office.Server.Search, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
add this for search control [ You can replace it with delegate control of search or web part]
<SPSWC:SearchBoxEx id="SearchBox"
RegisterStyles="false"
TextBeforeTextBox=""
TextBoxWidth="250"
QueryPromptString="<%$Resources:myresource,SearchText%>"
SearchResultPageURL="<%$Resources:myresource,SearchUrl%>"
DropDownMode="HideScopeDD"
SuppressWebPartChrome="true"
runat="server"
WebPart="true"
Direction="LeftToRight"
__WebPartId="{36A5C462-55C7-4E43-8BEA-DDF5C240309D}"/>
Done,
Comments
Anonymous
June 02, 2012
Hi Fadi, but I have question , if we use two master pages one for english and other for arabic, Do we need this method?Anonymous
June 02, 2012
No, because you can specify each URL for each master page for a specific language but you can also store these URLs in resources. but in my case I have only one master page for all languagesAnonymous
June 02, 2012
Thank you very much Fadi for your helpful posts ... Waiting moreAnonymous
June 03, 2012
Thanks for your helpful post