在 Drupal 上生成相同内容的英文版本?
Generate english versions of same content on Drupal?
我的网站需要能够支持多个国家/地区的多种语言。例如,美国可能有英语和西班牙语,而英国可能只有英语。如果两个国家使用相同的语言,并不意味着内容相同。
出于这个原因,我决定使用国际化模块 (i18n) 并创建如下语言代码:
gb-en - UK English
us-en - US English
us-es - US Spanish
我的设置没有问题,但我的问题在于创建所有默认内容。对于每种内容类型,我想:
- 将内容类型默认语言设置为"English"
- 为每种语言创建每种内容类型的翻译版本
我知道这意味着西班牙语内容仍然是英语,但这是翻译它的第一步。
创建所有这些 "default" 内容页面的最简单方法是什么?
您可以创建一个实现 hook_node_insert(). This module would intercept the creation of a new node (stored with the default language) and create as many copies as needed. Each of these copies should have a different value in the field language. These copies colud be easily stored in the dabase using node_save() 功能的模块。
我的网站需要能够支持多个国家/地区的多种语言。例如,美国可能有英语和西班牙语,而英国可能只有英语。如果两个国家使用相同的语言,并不意味着内容相同。
出于这个原因,我决定使用国际化模块 (i18n) 并创建如下语言代码:
gb-en - UK English
us-en - US English
us-es - US Spanish
我的设置没有问题,但我的问题在于创建所有默认内容。对于每种内容类型,我想:
- 将内容类型默认语言设置为"English"
- 为每种语言创建每种内容类型的翻译版本
我知道这意味着西班牙语内容仍然是英语,但这是翻译它的第一步。
创建所有这些 "default" 内容页面的最简单方法是什么?
您可以创建一个实现 hook_node_insert(). This module would intercept the creation of a new node (stored with the default language) and create as many copies as needed. Each of these copies should have a different value in the field language. These copies colud be easily stored in the dabase using node_save() 功能的模块。