Question
How to delete a source string and the translations of this string in Drupal 8 ?
As you haven't a Delete button on interface translation page, you can't do that from the translation interface. But you can do in a small custom module.
Example : Delete string ID 346, 'Home'
$lid = 346;
$con = \Drupal\Core\Database\Database::getConnection();
$con->delete('locales_source')
->condition('lid', $lid)
->execute();
$con->delete('locales_target')
->condition('lid', $lid)
->execute();
Note:
To get the lid,
- Goto User interface translation (/admin/config/regional/translate)
- Search your string
- Right click on the string to delete and click on 'Inspect Element' (On FireFox)
- You have an ID like
id="edit-strings-346-original"
- The string ID is 346
- You have an ID like
Add new comment