Database Localization - Lookup lists - smarter way

后端 未结 3 1272
感动是毒
感动是毒 2021-01-01 06:24

I\'m looking to add some lookup lists in the database, but I want them to be easy localizable (SQL 2005, ADO.NET)

This would include:

  • Easy Management
3条回答
  •  被撕碎了的回忆
    2021-01-01 06:49

    If you structure your data like this:

    MessageToken    DisplayText       LangCode
    firewood        Fire wood         en
    firewood        Bois de chauffage fr
    

    When you make your query, just supply the default languageId (if blank) or the supplied languageId. Use a standard list of tokens for the messages.

    Select DisplayText from (some table) where MessageToken = 'firewood' and LangId = 'en'
    

提交回复
热议问题