GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
SERVICES.XML(5) services.xml Manual SERVICES.XML(5)

services.xml - libtranslate generic service definitions

The services.xml file contains translation service definitions for the libtranslate generic module.

The generic module provides an abstract framework for supporting web-based translation services.

When the generic module is initialized, it reads service definitions from the services.xml files located in /usr/local/share/libtranslate and ~/.libtranslate, creates the services defined in these files, and makes them available to libtranslate.

The services.xml file must be encoded in UTF-8, and conform to the services.xml Document Type Definition, located in /usr/local/share/libtranslate/services.dtd.

The services element is the root of the document, and may contains service definitions and language mappings.

These elements may occur zero or more times in services: custom-language, service.

The custom-language element maps a RFC 3066 language tag to a language name.


Note

Some RFC 3066 tag to name mappings are built into libtranslate and do not need to be added (see the Built-In RFC 3066 Tag to Name Mappings appendix in the libtranslate Reference Manual).

The RFC 3066 language tag.

The language human-readable name.

This element contains custom-language: services.

The service element defines a translation service.

The service symbolic name, encoded in ASCII.

The service human-readable name.

The maximum length of an input chunk, in characters (0 means unlimited).

This element contains service: services.

This element may occur zero or more times in service: group.

The group element defines a translation group (a group represents a set of languages and translation methods).

This element contains group: service.

These elements may occur zero or more times in group: language, http-header.

These elements may occur zero or one time in group: text-translation, web-page-translation.

The language element adds a language to the list of languages supported by a group.

The RFC 3066 language tag.

service-tag (implied, default: tag)
The language service-specific tag. This tag is not exposed to libtranslate, but is available as from and to variables (see Variable Substitution).

A comma-separated list of RFC 3066 language tags this language can be translated into. The special list element * means "every language of this group but this one".

This element contains language: group.

The http-header element adds a HTTP header to the list of headers that are set when a HTTP request is issued.

If the http-header element occurs inside a group element, the header is added for text and web page translations.

If it occurs inside a text-translation or web-page-translation element, the header is only added for a text or web page translation, respectively.

The HTTP header name.

The HTTP header value.

These elements contain http-header: group, text-translation, web-page-translation.

The presence of the text-translation element specifies that the group can translate text.

The URL to use for translating text. Variable substitution is performed on the URL (see Variable Substitution).

If this attribute is present, a HTTP POST request is issued (using the attribute value as post data). Otherwise, a HTTP GET request is issued. Variable substitution is performed on the post data (see Variable Substitution).

This element contains text-translation: group.

These element may occur zero or more times in text-translation: http-header, pre-marker, error-marker.

This element may occur zero or one time in text-translation: post-marker.

The pre-marker element is used to extract the translated text from the response to a text translation request.

For each pre-marker element, the parser locates text in the server response. If text is found, the parser moves to the character following text. If it is not found, the translation fails. The translated text starts at the character following the last pre-marker match. If no pre-marker element is specified, the translated text starts at the first character of the server response.

The text to match.

This element contains pre-marker: text-translation.

The post-marker element is used to extract the translated text from the response to a text translation request.

If text can be located in the server response, the translated text ends at the character preceding text. Otherwise, the translation fails. If no post-marker element is specified, the translated text ends at the last character of the server response.

The text to match.

This element contains post-marker: text-translation.

The error-marker element is used to check if a text translation error has occurred.

If one or more error-marker elements are specified and the text of any of them can be located anywhere in the server response, the translation fails.

The text to match.

This element contains error-marker: text-translation.

The presence of the web-page-translation element specifies that the group can translate a web page.

If no http-header element is specified and if post is not specified, the generic module does not need to connect to the server. In this case, url is returned as the URL of the translated web page. Otherwise, the generic module connects to the server, issues a HTTP GET or POST request, saves the response to a local file, and returns a file:// URL pointing to that file.

The URL to use for translating a web page. Variable substitution is performed on the URL (see Variable Substitution).

If this attribute is present, a HTTP POST request is issued (using the attribute value as post data). Otherwise, a HTTP GET request is issued (or no request at all, see above). Variable substitution is performed on the post data (see Variable Substitution).

This element contains web-page-translation: group.

This element may occur zero or more times in web-page-translation: http-header.

Variable substitution is performed at translation time on the url and post attributes of the text-translation and web-page-translation elements.

A variable has the syntax ${varname[:modifiers]}.

varname may be any of the following variables:

The text to translate.

The URL of the web page to translate.

The source language service tag.

The destination language service tag.

The number of seconds since 0 hours, 0 minutes, 0 seconds, January 1, 1970, Coordinated Universal Time.

modifiers is a comma-separated list of modifiers. Each modifier is applied (in the specified order) on the contents of the variable. A modifier has the syntax name[=value].

name may be any of the following modifiers:

Escapes the unsafe characters in the variable using URI percent notation.

Converts the variable from UTF-8 (the libtranslate character set) to the character set value.

/usr/local/share/libtranslate/services.xml

The system-wide service definitions.

~/.libtranslate/services.xml

The user service definitions.

/usr/local/share/libtranslate/services.dtd

The services.xml Document Type Definition.

The libtranslate Reference Manual

Jean-Yves Lefort.

January 15, 2005 libtranslate 0.99

Search for    or go to Top of page |  Section 5 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.