Django 多语言支持

发布于 2024-09-04 15:15:42 字数 397 浏览 0 评论 0原文

如果文本以法语或印地语存储,则使用 django。如何在文本框字段

Models.py

    class Details(models.Model):
         title = models.CharField(max_length = 255)

html 页面中存储和检索该文本:

  <form action="/pjt/details">
  <input type="text" name="nee_n"id="neen_n" />
   </form>

如何将其存储在数据库中并检索回相同的内容。是否有任何设置需要更改在settings.py中

谢谢..

Using django if a text is stored in French or Hindi.How will this be stored and retrieved in a text box field

Models.py

    class Details(models.Model):
         title = models.CharField(max_length = 255)

html page:

  <form action="/pjt/details">
  <input type="text" name="nee_n"id="neen_n" />
   </form>

How to store this in the db and retieve back the same .Is there any setting to be changed in settings.py

Thanks..

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不离久伴 2024-09-11 15:15:42

Django 基于 Unicode,因此语言字符将被正确存储。

存储语言,即用户的文化是一个不同的问题。这最初可以从格式为“en_US”或“fr_FR”的 HTTP 请求中收集。

该标准是 ISO 639-1 和 ISO 3166-1 的串联。

然而,浏览器文化并不总是可靠的,因此界面应该为用户提供改变其文化的机会。

Django is based on Unicode and so the language characters will be stored correctly.

Storing the language, i.e. the user's culture is a different issue. This can be initially gleaned from the HTTP request in the format 'en_US' or 'fr_FR'.

This standard is a concatenation of ISO 639-1 and ISO 3166-1.

However the browser culture cannot always be relied upon and so the interface should give the user the opportuinity to change their culture.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文