I use the following SQL to get a some keys I want to translate:
SELECT * FROM translate_keys
LEFT JOIN translations
ON translate_keys.id = translations.translate_key_id
LEFT JOIN languages
ON languages.id = translations.language_id
WHERE languages.is_default = 1;
If translations for a key is empty I get no results back (languages has content)! I understand that this is because languages get no relation with translations. What can I do? I thought that left join was enough!
The problem is the
WHEREconditionlanguages.is_default = 1. This eliminates all the dummy records added by the left join, becauselanguages.is_defaultisNULLif a translation does not exist.