Adding External Web Search Providers

MultiTerm Widget allows you to start a search in a web browser, specifying a search provider. This is any web page that can perform a search by passing parameters in a URL.

The product comes with a set of predefined providers, such as Google and Microsoft Bing. Since many users will have their own favorite resources, there is an XML file that allows you to add new providers.

Location of the XML

The file is stored alongside the other MultiTerm settings in your application settings:

C:\Documents and Settings\<User>\Application Data\SDL\SDL MultiTerm\WidgetSearchProviders.xml

Or for Windows 7/Vista:

C:\Users\User\AppData\Roaming\SDL\SDL MultiTerm\WidgetSearchProviders.xml

 

Format of the XML

The file consists of a list of search providers in the following format:

<WidgetSearchProviders>

<SearchProvider Name="Google Dictionary">

<Url>http://www.google.com/dictionary?langpair={0}|{1}&amp;q={2} </Url>

<Icon>google.png</Icon>

<LanguageMapping Type="Iso" /><UrlEncoding>UTF8</UrlEncoding>

</SearchProvider>

... more providers ...

</WidgetSearchProviders>

 

Tags explained

Tags Attributes

<SearchProvider>

Name : Will be displayed on the search button and the context menu for the web search.

<URL>

This is sent to the web browser. It allows you to specify three parameters that will be replaced before sending the URL. None of them are mandatory.

  • {0} is the source language as selected in the configuration dialog. See language mapping type below.
  • {1} is the target language.
  • {2} is the search term.

Warning: Make sure that you use XML entities in the URL string (since the WidgetSearchProviders file is an XML file). So for an ampersand that adds another parameter like in the above sample, make sure that you use the full entity &amp; and not just plain &.

<Icon>

 

An image in one of the following formats: ico, png, bmp, gif, jpg. It either needs to be in the same folder as the WidgetSearchProviders.xml file, or you can use a relative path.

<LanguageMapping>

 

Type : different websites use different ways of representing languages. This parameter allows you to choose between three types:

  • Iso: the language is represented as a two letter code, according to the ISO standard. For example en for English. This will always be the ‘neutral language’, without a country specification. For example: if you choose English (United States) in the Configuration dialog, it will be mapped to en, not to en-us.

  • English_Name: the English name for the language is used. It will be the neutral language, so English (United States) will translate to English.
  • Table: can be used to handle web pages that use different language representations. The user provides a table mapping between ISO codes (used internally in MultiTerm) and the web search name for languages, like this:

<SearchProvider Name="Google Dictionary">

<Url>http://www.german.provider.com/languages={0}|(1) search={2}</Url>

<Icon>searchprovider.png</Icon>

<LanguageMapping Type="Table">

<Language iso="de" web="Deutsch"/>

<Language iso="en" web="Englisch"/>

<Language iso="fr" web="Franzoesisch"/>

</LanguageMapping>

</SearchProvider>

 

<UrlEncoding>

Special characters, for example, accented letters such as those in "Grüße" or "crème fraîche", need to be encoded before they are sent to a web page. There are different encodings; most search providers support UTF8 but some, like linguee.com, use Windows-1252 encoding. The encodings that are currently supported are:

  • UTF8: this is the default if you don't use this tag at all
  • Windows1252: encoding used by older browsers