FQL:translation
Query this table to return the native strings (original, untranslated text in your application interface) and the translated strings for your application. The translated strings come from one specified locale.
In order to make your query indexable, the WHERE in your query must contain an = or IN clause for the locale
column and either the native_hash
or pre_hash_string
column.
Columns
Highlighted rows are indexable / searchable and one is usually required in the WHERE portion of the query.
Name | Type | Description |
---|---|---|
locale | string | The locale for the translations for which you are querying. See Facebook Locales for the list of currently supported locales. You must specify a single locale in your query. |
native_hash | string | A hash of the native string and a description generated by the Translations application. It's a unique identifier for the string. The hash is generated by hashing the concatenation of the string followed by 3 colons, followed by the description, followed by a colon, using the tiger128,3 hashing algorithm. Query on this column to quickly return your application's native strings and their descriptions. |
native_string | string | The actual text from your application you previously submitted for translation to the Translations application. |
description | string | The description of the native string needing translation. This text clarifies the context in which the text is used, and the meaning if it is ambiguous. This is shown to translators in the bulk translation user interface, among other places, and should describe the text well enough that someone can translate it without seeing it in the context of your application. In general a piece of text should always have a description unless it is a complete sentence whose meaning would be clear to a user who has never seen your application. If a description for the corresponding string or hash doesn't exist in the Translations database, this column returns null. |
translation | string | The translation of the native string. If a translation for the corresponding string or hash doesn't exist in the Translations database, this column returns null. |
approval_status | string | The approval status of the string. The status is one of:
|
pre_hash_string | string | A concatenation of the native string and its description. This string is used to generate the native hash. The native string is concatenated with 3 colons, the description, then another colon. Query on this column if you want to check whether a random string and description exists. A query containing the pre_hash_string runs more slowly than a query containing the native_hash. |
best_string | string | The translated string that gets displayed to a user translating your application. The user must be browsing Facebook in the locale of the approved translation. Querying on this column returns either a native string or translated string. If no entry for the corresponding native string exists in the Translations database, this column returns null. |
Examples
To simply select for a list of native string hashes their actual native string, their descriptions, and all of their translations with no other information:
SELECT native_string, description, translation FROM translation WHERE locale="pl_PL" AND native_hash IN ('e9d298f6cbf1ad57742aafe733a4ae88', '3281ad9d7ec940be2db37947bf3ae62d ')
<fql_query_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" list="true"> <translation> <native_string>Basic Information</native_string> <description/> <translation>Informacja podstawowa</translation> </translation> <translation> <native_string>Basic Information</native_string> <description/> <translation>Podstawowe informacje</translation> </translation> <translation> <native_string>Status</native_string> <description>State of a process</description> <translation xsi:nil="true"/> </translation> </fql_query_response>
To select the native string and "best" displayable string we have for the user in that locale, for those hashes:
SELECT best_string, native_string FROM translation WHERE locale="pl_PL" AND native_hash IN ('e9d298f6cbf1ad57742aafe733a4ae88', '3281ad9d7ec940be2db37947bf3ae62d ')
<?xml version="1.0" encoding="UTF-8"?> <fql_query_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" list="true"> <translation> <best_string>Informacja podstawowa</best_string> <native_string>Basic Information</native_string> </translation> <translation> <best_string>Informacja podstawowa</best_string> <native_string>Basic Information</native_string> </translation> <translation> <best_string>Status</best_string> <native_string>Status</native_string> </translation> </fql_query_response>
To select a native string, a translation, and the approval status of the translation, for strings which don’t necessarily have translations:
SELECT native_string, description, translation, approval_status FROM translation WHERE locale="es_LA" AND native_hash IN ('e9d298f6cbf1ad57742aafe733a4ae88', '3281ad9d7ec940be2db37947bf3ae62d ')
<?xml version="1.0" encoding="UTF-8"?> <fql_query_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" list="true"> <translation> <native_string>Basic Information</native_string> <description/> <translation>Información Básica</translation> <approval_status>approved</approval_status> </translation> <translation> <native_string>Status</native_string> <description>State of a process</description> <translation xsi:nil="true"/> <approval_status>unapproved</approval_status> </translation> </fql_query_response>