Retrieving i18n data with fallback language

前端 未结 1 1103
一向
一向 2020-12-28 09:34

I have to grab i18n text from a database. The default language is English, it has text for everything. But the non-English languages doesn\'t necessarily have all t

相关标签:
1条回答
  • 2020-12-28 09:58

    try something like this:

    SELECT
        e.key,COALESCE(o.value,e.value)
        FROM Translation                e
            LEFT OUTER JOIN Translation o ON e.key=o.key and o.language_code='nl'
        WHERE e.language_code='en'
    
    0 讨论(0)
提交回复
热议问题