Translation (FQL)
From Facebook Developer Wiki
Contents |
Description
The FQL translation table. 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.
To structure your query, use the table name (translation in this case) in the FROM clause. The items in the Name column correspond to columns in the table that can be referenced in the SELECT and WHERE clauses.
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
| Indexable | 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 the description followed by a colon. 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:
To select the native string and “best” displayable string we have for the user in that locale, for those hashes:
To select a native string, a translation, and the approval status of the translation, for strings which don’t necessarily have translations:
