如何将替代网站语言设置为默认网站语言?
我有一个 TYPO3 网站,默认网站语言是德语。不久前,我添加了一种替代网站语言,即英语。
我现在需要做的是在后端交换这两种语言:
从:
- 默认:德语
- 替代:英语
到:
- 默认:英语
- 替代:德语
因此,在后端,当我创建新的内容元素时,默认语言将是英语。
I've got a TYPO3 website where the default site language is German. A while ago I added an alternative site language which is English.
What I need to do now is to swap those two languages in the backend:
From:
- Default: German
- Alternative: English
To:
- Default: English
- Alternative: German
So in the backend when I create a new content element the default language would be English.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
在 TYPO3 的本地化概念中,默认语言被视为原始语言,并驻留在数据库表
pages
中。其他语言是原始语言的翻译,并驻留在表pages_language_overlay
中。因此,您不能简单地将默认设置切换为其中一种翻译语言。更改新内容的默认语言本身并不困难,但您将留下所有标记为“英语”的现有德语内容,因此您需要使用一些 mySQL 技巧重新分配内容元素。如果您不关心现有内容,只需省略第 3 步和第 3 步即可。 4.
第 1 步:
在对数据库进行更改之前,请确保备份相关数据,至少备份表
pages
、pages_language_overlay
和tt_content
第 2 步:
假设 id 为 english 的语言为 1 (
sys_language_uid = 1
):在后端为德语创建一个新的语言条目。如果您过去没有定义任何其他语言,它将被视为“sys_language_uid = 2”
第 3 步:
将默认语言元素更改为新语言“德语”(在 mySQL / phpMyAdmin 中):
UPDATE tt_content SET sys_language_uid = 2 WHERE sys_language_uid = 0
第 4 步:
将以前的英语语言元素更改为新的默认语言:
UPDATE tt_content SET sys_language_uid = 0 WHERE sys_language_uid = 1
第 5 步:
然后,如果您愿意,可以通过输入以下内容来更改后端的语言标签:根页面的页面属性:
第 6 步:
请记住还要更改前端的所有 language_uid(例如语言菜单):
config.sys_language_uid = 2
(如果之前是德语)。如果处理不当,可能会导致一些死链接。步骤 7:
删除英语的替代语言记录
结论:
根据涉及的其他扩展名数量(例如 realURL),此任务可能不值得您花费时间。 。我希望核心开发人员将来能够提出更简单的解决方案。
In TYPO3s localisation concept the default language is considered to be the original language and resides in the database table
pages
. Other languages are translations of the original language and reside in the tablepages_language_overlay
. Hence you can't simply toggle the default to one of the translated languages.Changing the default language for new content is not difficult per se, but you will be left with all the existing german content labelled "english", therefore you will need reassign your content elements with some mySQL trickery. If you don't care about your existing content, just leave out step 3 & 4.
Step 1:
Before making changes to your database make sure you backup relevant data, at least the tables
pages
,pages_language_overlay
andtt_content
Step 2:
Assuming english is the language with id 1 (
sys_language_uid = 1
):Create a new language entry for german in the backend. If you didn't define any other languages in the past it will be considered 'sys_language_uid = 2'
Step 3:
Change default language elements to new language "german" (in mySQL / phpMyAdmin):
UPDATE tt_content SET sys_language_uid = 2 WHERE sys_language_uid = 0
Step 4:
Change former english language elements to new default language:
UPDATE tt_content SET sys_language_uid = 0 WHERE sys_language_uid = 1
Step 5:
Then, if you want so, change the language label in the backend by entering the following to the page properties of your root page:
Step 6:
Remember to also change all language_uids for the frontend (e.g. language menus):
config.sys_language_uid = 2
(if it was german before). This might result in some dead links if not done right.Step 7:
Delete the alternative language record for english
Conclusion:
Depending on how many other extensions are involved (e.g. realURL) this task might not be worth the time you spend on it. I hope core developers come up with a simpler solution in the future.
人们可能还想切换页面标题。做类似的事情:
One may also want to switch the page titles. Do something like:
我在这里找到了一个很好的解决方案,不会丢失任何“t3_origuid”。
当前设置:默认语言为德语,英语为1
第一:清理所有删除条目:
德语内容的 sys_language_uid 更改(从 0 到 10):
英语的 sys_language_uid 更改(从 1 到 0):
德语的 sys_language_uid 更改回 1(从 10 到 1):
为德语设置新的 l18n_parent条目:
更改德国条目的 uid(> 超过最新内容 ID!):
设置 uid英语的 ID 为德语所在的 ID:
再次更改德语 uid
清理
传输某些已传输的字段:
页数:
从表格页面复制一份,例如pages_new:
然后第1步:
第2步:
在此处找到在此处输入链接描述
I found a good solution here without losing any 't3_origuid'.
Current setup: German is the default language, English language 1
FIRST: Clean up all deletet Entries:
sys_language_uid of German content change (from 0 to 10):
sys_language_uid of Englisch change (from 1 to 0):
sys_language_uid of German change back to 1 (from 10 to 1):
Set new l18n_parent for German Entries:
Change uid for German Entries (> More Than most current Content ID!):
Set uid of englisch to the ID where German are :
Change again the German uid
Clean up
Transfer certain fields transferred:
PAGES:
Make a Copy from the table Pages for example pages_new:
Then step 1:
Step 2:
Found here enter link description here
是的,您还需要更改 tx_news 插件中的所有新闻,
首先将所有新闻复制到 tmp 表
,然后更改内容。固定“tmp”中的翻译文本并设置为新的原始语言。
准备
好-出发。将 tmp 表更改为原点:
这就是全部。谢谢
Yep and also you need change all news in tx_news plugin
First coppy all to tmp table
Then change content. Tacke translation text from "tmp" and set into new origin language.
and back
Ready - go. Change tmp table to origin:
This all. Thx