german-english russian-english-russian dictionary translateit! german-english russian-english-russian dictionary translateit! german-english russian-english-russian dictionary translateit! german-english russian-english-russian dictionary translateit! german-english russian-english-russian dictionary translateit!
 ru  ·  en  ·  fr  ·  de 
 
 


Testimonials






 

Help: Profiles

Profiles define rules for Online Services that are used for sending requests to a server of your choice, and receiving and processing the results.
HTTP requests support the GET and POST methods and various text encodings.
Profiles are actually plain text files in UTF-8 encoding divided into sections, and using a quite simple syntax. Each section starts from a new line with its name in lowercase in square brackets. Some section types can have several instances, others can have only one.

To define a profile, the following sections are used:

[profile] - Default profile name that is displayed along with results from a server
[url] - Query string that usually contains the %s parameter that serves as a placeholder for a user-requested word. (This string is what you will see in your browser's URL field.) It is quite easy to create such a query string: On a web-site of your choice, search for any word, then copy the URL, and replace the word you've just searched for with %s to let TranslateIt! know where it should put words you request in the future
[post] - If a server only supports POST and/or GET + POST methods, your query string can be put here in the request header, again with the %s parameter as a placeholder
[encoding] - This is a very important parameter that is set as a number followed by the name of the corresponding encoding in brackets. The number defines a certain encoding within the system, and the optional name in brackets is just a human-readable comment. To set the required encoding for your web-site, use the Online Services setup dialog
[begin+] - An unchanged HTML snippet within a results page used as a start marker for extracting query results. This HTML snippet itself is also contained in the extracted source code. A profile may contain several begin+ sections. In such cases sections are processed in order from top to bottom until the first relevant section is reached, which is then used to display the results. If none of the sections work, the results page is displayed in whole. Tip: Use your browser to view the results page as HTML code
[begin] - This section is similar to the one described above with the only difference that its HTML snippet is not displayed in the results. When processing multiple begin+/begin sections, "plus-sections" have priority over simple "begin-sections". If sections of one type are mixed with other types of sections, they are first aggregated into a single list
[end+] - Sections of this type are similar to begin+ sections: They contain HTML snippets that are used as end markers for extracting results from a web-page on the server of your choice (HTML snippets themselves are also included in extracted source code)
[end] - Same as end+ sections, but without inclusion of HTML snippets into extracted source code
[not-found] - Another important section that is processed before any begin(+) sections: If the requested word wasn't found, there is no use in displaying irrelevant "garbage" instead of results. Therefore, it is recommended to find in the source code of such a "no-results-page" a unique HTML snippet to be used as a signal that further processing is not necessary
[not-found+] - Same as not-found sections, but with the different condition: The HTML snippet defined in this section should be necessarily contained on a results page, otherwise it is considered that no results have been acquired
[fix] - A regular expression (for customizing the view of displayed results) in the FROM#to#REPL, or FROM#caseless-to#REPL format conforming to the ICU syntax (line breaks allowed), e.g. (\d+)#to##$1)
[header] - An HTML snippet added to the source code of displayed results to be displayed as a header (to customize displayed results)
[footer] - An HTML snippet added to the source code of displayed results to be displayed as a footer (to customize displayed results)
[agent] - A requesting client identification string that can be used to make a server handle TranslateIt! as IE, Firefox, Safari, Opera, or any other browser
[ref] - Some services may check referring pages. This section is used to define a fake referrer URL.
[synchronize] - An alphanumeric (latin only) string used as an internal profile name for automatic updates from our server
[version] - Profile version number
[group] - Language group(s) (defined as lang1-lang2 or just lang1 (in English); several alternative groups are allowed with one group per line.)

Rule processing algorithm. Maximum number of sections

After receiving an answer from the server of your choice, raw HTML page is "normalized": Non-standard line breaks (\r\n, \n\r, \r) are replaced with \n, and the rule text is normalized for processing. Then the analyzer splits sections and processes them in the following order:
not-found+/not-found - several sections allowed; if at least one of sections of this type "works", processing is stopped with an empty string as a result
Style definitions are copied from the page source (the "style" section and links to external CSS files.)
begin+/begin - several sections allowed; if it is not possible to cut off the beginning of the page, it is passed unmodified for further processing
end+/end - several sections allowed; if it is not possible to cut off the end of the page, it is passed unmodified for further processing.
Collected styles are written back to the page header. (Usually, begin(+) sections extract code in such a way that there are no duplicate styles left (they are dropped off during the extraction process), if however there are some duplicate styles left, it should not cause any problems.)
internal-fix - A utility function for cleaning results page source by replacing href-links with absolute paths to resources
fix - several sections allowed; a function that performs "fine tuning" of your page's body
header and footer - only one instance of each section allowed
profile, url, post, encoding, agent, ref, synchronize, version, group - only one instance of each section allowed
See the list of predefined profiles for examples of service rules.
your custom profiles, and we will add them to our list of predefined profiles.


May 10, 2011

TranslateIt! Teacher
for Mac

a perfect tool for learning foreign languages
Learn more

 


April 6, 2010

TAO for iPhone & iPod Touch, iPad
Learn more

 

Statistics

 

Version for MS Windows




Learn more

Copyright (c) 2003-2012
TranslateIt!
All rights reserved.