1

How would I go about defining a table with a language specific (qualified) attribute?

For example:

ID| object |description (english)|description (french)| size | color (english) | color (french)

in the above example we have 3 'normal' fields and 2 language qualified fields : description and color.

What is best practice for defining these type of fields within one table?

1 Answer 1

1

There are different ways of doing this. But a method for your specific data is to have another table with one row per language. Such as table would have:

  • objectLanguageId (serial column to identify the row)
  • objectId (reference to a table with one row per object)
  • language
  • description
  • color

Then the "object" table would have

  • objectId
  • objectName
  • size

Note: This is definitely not the only approach. If you need everything in your system translated, then you want a more sophisticated and generic mechanism. You may also need to take into account things like French sizes are different from sizes in other countries -- even countries that speak the same language.

Sign up to request clarification or add additional context in comments.

1 Comment

This makes perfect sense. Thank you

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.