As an anonymous user, you can only add new data. If you would like to also modify existing data, please create an account and indicate your languages on your user page.

Help:Translated Content table

From OmegaWiki
Jump to: navigation, search
Help:Index Database layout Translated Content table



The Translated Content table is typically used to store definitions or other texts that are translated in several languages.

+-----------------------+---------+------+-----+---------+-------+
| Field                 | Type    | Null | Key | Default | Extra |
+-----------------------+---------+------+-----+---------+-------+
| translated_content_id | int(11) | NO   |     | 0       |       | 
| language_id           | int(10) | NO   |     | 0       |       | 
| text_id               | int(10) | NO   |     | 0       |       | 
| add_transaction_id    | int(11) | NO   | MUL | NULL    |       | 
| remove_transaction_id | int(11) | YES  | MUL | NULL    |       | 
+-----------------------+---------+------+-----+---------+-------+

Fields[edit]

translated_content_id 
An id. It is not unique: all translations of the same definition share the same translated_content_id, but a different value of language_id and text_id. translated_content_id is referred to for example from the Defined Meaning table (meaning_text_tcid).
language_id 
The language of the text. See Help:Language table.
text_id 
Links to a text in the Text table.
add_transaction_id 
When and by who the translation was added. See Help:Transactions table.
remove_transaction_id 
When and by who the translation was removed. See Help:Transactions table. NULL if it is still valid.

Sample MySQL queries[edit]

Retrieving all the definitions of a Defined Meaning[edit]

Let's consider the example where you want to retrieve all the definitions of DefinedMeaning:dictionary_(915)

select uw_text.text_text, language_id
from uw_text, uw_translated_content, uw_defined_meaning
where uw_defined_meaning.defined_meaning_id = 915
and uw_defined_meaning.meaning_text_tcid = uw_translated_content.translated_content_id
and uw_translated_content.remove_transaction_id is NULL
and uw_text.text_id = uw_translated_content.text_id ;

Retrieving all the definitions and words of a language[edit]

For example for Turkish ( language_id = 137 )

select uw_expression.spelling, uw_text.text_text,uw_syntrans.defined_meaning_id
from uw_text, uw_translated_content, uw_defined_meaning, uw_syntrans, uw_expression
where uw_translated_content.language_id = 137
and uw_expression.language_id = 137
and uw_defined_meaning.meaning_text_tcid = uw_translated_content.translated_content_id
and uw_text.text_id = uw_translated_content.text_id
and uw_defined_meaning.defined_meaning_id = uw_syntrans.defined_meaning_id
and uw_expression.expression_id = uw_syntrans.expression_id
and uw_translated_content.remove_transaction_id is NULL
and uw_syntrans.remove_transaction_id is NULL ;