wiki:XmlRpcGetTranslation

GetTranslation

Intro

get a translation for given program and language


Description

struct GetTranslation(string $token, string $iso639, string $format, string $program )

Returns base64-encoded translation strings for program program and language $iso639 in format $format.

This function is used to provide multi-language support for client applications in a single environment.

The language translation strings are stored on the server which provides user interface to edit/update them.

Updated strings can then be downloaded to client application using this method.


Parameters

token (required)
token string identifying user's session, taken from LogIn output structure.
iso639 (required)
language ISO639-1 2-letter code
format
available formats:
  • gnugettext compatible: mo, po
  • additional: txt, xml
program (required)
  • name of the program/client application you want translations for.
  • currently supported values: subdownloader, oscar

Return Values

Output is returned in this structure:

struct(
  (string) [status],
  (string) [data],
  (double) [seconds]
)

and contains these elements:

status
function result code, see list of status codes
data
base64-encoded language file contents
seconds
time taken to execute this command on server

Implementations

There are currently no available sample implementations.


Changelog

Version 1: created this function


Examples

Input

<methodCall>
 <methodName>GetTranslation</methodName>
  <params>
   <param>
    <value><string>d5pnounn3ea5aja0nn4inqamf2</string></value>
   </param>
   <param>
    <value><string>pb</string></value>
   </param>
   <param>
    <value><string>mo</string></value>
   </param>
   <param>
    <value><string>oscar</string></value>
   </param>
   </params>
</methodCall>

Output

<methodResponse>
<params>
 <param>
  <value>
   <struct>
    <member>
     <name>status</name>
     <value><string>200 OK</string></value>
    </member>
    <member>
     <name>data</name>
     <value><string>3hIEl ... gzipped and base64-encoded language file contents ... yZwA=</string></value>
    </member>
    <member>
     <name>seconds</name>
     <value><double>3.824</double></value>
    </member>
   </struct>
  </value>
 </param>
</params>
</methodResponse>

Notes

  • you must base-64 decode data to get the translation strings and then save the contents/file to the desired directory.

See also


Comments

add your comments, hints and suggestions here if you like ...


Prev (GetAvailableTranslations) Home [Next]

Last modified 16 years ago Last modified on Sep 28, 2008, 12:17:21 PM