Main

 

Development > Untranslated Text

When a file to be translated is uploaded, each piece of text is copied to `lang_new_text` and the id for this piece of text is copied to `lang_project_texts` with the project id and the id of the file the piece of text is in. Now, when the file is changed, any pieces of text that have been removed from the file will also be removed from `lang_project_texts`, but not removed from `lang_new_text`. We leave it in `lang_new_text` in case it had been translated, in which case it might be useful later on with the AutoFill tool or translation suggestion feature.

The issue here is that nothing is getting deleted from `lang_new_text` even if it's completely useless. I'd like to delete entries if they haven't been translated using a query similar to the following. Thoughts?

$query = 'SELECT DISTINCT `text_id` FROM '; //replace SELECT with DELETE
$query .= ' `'.$wbTablePrefix.'lang_new_text` ';
$query .= ' LEFT JOIN ';
$query .= ' `'.$wbTablePrefix.'lang_project_texts` USING(`text_id`) ';
$query .= ' LEFT JOIN ';
$query .= ' `'.$wbTablePrefix.'lang_translated_text` USING(`text_id`) ';
$query .= ' WHERE ';
$query .= ' `'.$wbTablePrefix.'lang_project_texts`.`text_id` IS NULL';
$query .= ' AND `'.$wbTablePrefix.'lang_translated_text`.`text_id` IS NULL ';

Last modified 16:16 Mon, 1 Nov 2010 by Main. Accessed 2,330 times Children What Links Here share Share