I have 2 tables with this configuration:
table language('id', 'language_name', 'iso_code')
table translation('id', 'language_id', 'translated_text')
In the first table I have records:
---------------------------------
| id | language_name | iso_code |
---------------------------------
| 1 | English | en |
| 2 | Espanõl | es |
| 3 | Français | fr |
---------------------------------
The second table:
--------------------------------------
| id | language_id | translated_text |
--------------------------------------
| 1 | 1 | Good Morning |
| 2 | 1 | How are you? |
| 1 | 2 | Buenos dias |
| 2 | 3 | Comment ça va? |
--------------------------------------
All English text strings exist, but some of the other languages dont.
I would like to show a table with ALL English text strings and corresponding translations, like:
----------------------------------------
| text_id | en | es |
----------------------------------------
| 1 | Good Morning | Buenos dias |
| 2 | How are you? | |
----------------------------------------
or
-------------------------------------------
| text_id | en | fr |
-------------------------------------------
| 1 | Good Morning | Comment ça va? |
| 2 | How are you? | |
-------------------------------------------
Any ideas?
Just keep doing left joins to same table on the ID, but extra columns representing their language…
Edited to show English if no value in corresponding columns per comment inquiry.