How to introduce internationalization of dictionaries in DB
I have DB with many dictionaries. Till this moment it was written in english, but customer want to introduce internationalization on DB level (to support spanish and UK english). So users that will login to our system should see all text depending on his internationalization settings.
Most of dictionay tables are in form:
CREATE TABLE UserPermissionTypes (
Id [INT],
Title NVARCHAR(100),
Description NVARCHAR (500) )
At this moment I'm thinking about creating duplicated tables for each dictionary in form similiar to this one:
CREATE TABLE UserPermissionTypesTranslations (
UserPermissionTypesId [INT],
LanguageCodeId [INT]
Title NVARCHAR(100),
Description NVARCHAR (500), )
I know that it is not perfect solution, so I want to know 开发者_高级运维what is the best method to implement internationalization in tables? Is there some standard way to do that inernationalization?
How about making extra table for translations and use it's ID instead of texts (modified after comments) :
CREATE TABLE UserPermissions (
Id [INT],
TitleTR [INT],
DescriptionTR [INT] )
CREATE TABLE Translations(
Id [INT],
LanguageID [INT],
Text NVARCHAR(500)
)
select tr.Text as title, tr2.Text as description from UserPermissions
join Translations tr on tr.id=UserPermissions.titleTR and languageid=:LANG
join Translations tr2 on tr2.id=UserPermissions.descriptionTR and languageid=:LANG
精彩评论