Describe the approach to handling multi-language support in Django applications.
Instruction: Explain how to implement internationalization and localization in Django, including dynamic content translation.
Context: Candidates should demonstrate understanding of Django's internationalization framework and methods for creating applications that can adapt to multiple languages and regions.
Updated
Official answer available
Read the opening below, then unlock the full answer and practical guidance.
Separate translation of interface strings from translation of stored content. Django's message framework handles marked source/template strings; it does not automatically translate arbitrary database rows or user submissions.
Enable internationalization and configure supported languages. Use gettext for runtime messages and lazy translation where strings are defined before a request language is known, such as model/form labels. Use plural-aware and contextual translation APIs where required...