我添加了类型语言的HMENU和一些翻译,我可以点击菜单按钮查看翻译。然而,有一些事情被打破了,我希望得到一个更基本的理解。
第一件奇怪的事情是:在语言菜单中,未翻译页面的HREF看起来像是/en/my-page
,而翻译页面的HREF看起来像/my-page?L=1
。 Wbat正在这里?我已经放入了https://github.com/dmitryd/typo3-realurl/wiki/Notes-for-Integrators#configuring-languages中描述的 preVars 部分。如果用户永远不必看到?L = x查询字符串参数,我会更喜欢它。
编辑:我已修复了第一个问题,将我的域记录从https://www.my.domain.com
更改为www.my.domain.com
,然后清除了realurl数据库表。
我的第二个问题是我的其他普通HMENU。这些文本正在被正确翻译,但链接不是 - 您每次导航时都会返回默认语言。
任何帮助都非常感激。
我尝试了以下所有方法:
我的TypoScript:
config.doctype = html5
config.absRefPrefix = /
config.tx_realurl_enable = 1
## config.sys_language_overlay = 1 # I don't actually know what this does!
config.linkVars = L(0-9) # Make the language link variables work.
## Defaults
config.language = en
config.locale_all = en_GB.utf8
config.htmlTag_langKey = en-GB.utf8
config.sys_language_uid = 0
[globalVar = GP:L = 1]
config.language = da
config.locale_all = da_DA.utf8
config.htmlTag_langKey = da-DA.utf8
config.sys_language_uid = 1
[globalVar = GP:L = 2]
config.language = de
config.locale_all = de_DE.utf8
config.htmlTag_langKey = de-DE.utf8
config.sys_language_uid = 2
## There's no 3
[globalVar = GP:L = 4]
config.language = es
config.locale_all = es_ES.utf8
config.htmlTag_langKey = es-ES.utf8
config.sys_language_uid = 4
## There's no 5
[globalVar = GP:L = 6]
config.language = lv
config.locale_all = lv_LV.utf8
config.htmlTag_langKey = lv-LV.utf8
config.sys_language_uid = 6
[globalVar = GP:L = 7]
config.language = ro
config.locale_all = ro_RO.utf8
config.htmlTag_langKey = ro-RO.utf8
config.sys_language_uid = 7
[globalVar = GP:L = 8]
config.language = pl
config.locale_all = pl_PL.utf8
config.htmlTag_langKey = pl-PL.utf8
config.sys_language_uid = 8
[globalVar = GP:L = 9]
config.language = pt
config.locale_all = pt_PT.utf8
config.htmlTag_langKey = pt-PT.utf8
config.sys_language_uid = 9
[END]
## Language Menu
lib.language_menu = HMENU
lib.language_menu {
special = language
special.value = 0,1,2,4,6,7,8,9
1 = TMENU
1 {
wrap = <ul class="language-menu">|</ul>
noBlur = 1
NO = 1
NO {
linkWrap = <li>|</li>
stdWrap.override = En || Da || De || Es || Lv || Ro || Pl || Pt
}
ACT < .NO
ACT {
linkWrap = <li class="active">|</li>
}
# NO + Translation doesn't exist
USERDEF1 < .NO
# USERDEF1.doNotLinkIt = 1
# ACT + Translation doesn't exist
USERDEF2 < .ACT
# USERDEF2.doNotLinkIt = 1
}
}
答案 0 :(得分:1)
您需要设置 <html>
<head>
<link href="select2.min.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="select2.min.js"></script>
</head>
<body>
<select multiple id="getCountry">
<option value="India">India</option>
<option value="Afghanistan">Afghanistan</option>
<option value="japan">japan</option>
</select>
<input type="button" id="submit" value="Submit">click
<script>
$(document).ready(function() {
$("#getCountry").select2();
});
</script>
</body>
</html>
以在所有链接中保留语言GET参数:https://docs.typo3.org/typo3cms/TyposcriptReference/Setup/Config/Index.html#linkvars
示例(如果您只有两种语言):
config.linkVars
答案 1 :(得分:1)
如果realUrl不渲染类似的链接
/<lng>/mypage.html
仅mypage.html?L=<2>
如果你从头开始使用realurl,删除自动生成的realurl配置文件,禁用扩展并再次启用有时有助于修复错误。