I’m working on something similiar to GlotPress.
I have two tables
strings
- hash (primary key)
- original (text)
- project (foreign key)
translations
- hash
- string (foreign key)
- translation (text)
- language (ex.: en, fr, es)
What I want:
print every string including its translation in case it exists for a single project and language.
Example: I want every french translations + non-translated strings of a project.
This is what I have / I tried with:
SELECT * FROM strings
LEFT JOIN translations ON strings.hash = translations.string
WHERE strings.project = 'kg6k34j6'
AND language = 'fr'
OR language = NULL
Here’s the problem: I cannot use the OR here, because all strings from every project will be shown.
1 Answer