Localization 删除liferay主题中的本地化

Localization 删除liferay主题中的本地化,localization,liferay-6,liferay-theme,Localization,Liferay 6,Liferay Theme,我正在使用Liferay 6.1,并在同一版本中开发了主题。我的问题是,当我加载主题时,标题部分包含巨大的链接,如下所示: <link rel="alternate" hreflang="ar-SA" href="http://localhost/ar"> <link rel="alternate" hreflang="eu-ES" href="http://localhost/eu"> <link rel="alternate" hreflang="bg-BG"

我正在使用Liferay 6.1,并在同一版本中开发了主题。我的问题是,当我加载主题时,标题部分包含巨大的链接,如下所示:

<link rel="alternate" hreflang="ar-SA" href="http://localhost/ar">
<link rel="alternate" hreflang="eu-ES" href="http://localhost/eu">
<link rel="alternate" hreflang="bg-BG" href="http://localhost/bg">
<link rel="alternate" hreflang="ca-AD" href="http://localhost/ca">
<link rel="alternate" hreflang="ca-ES" href="http://localhost/ca_ES">
<link rel="alternate" hreflang="zh-CN" href="http://localhost/zh">
<link rel="alternate" hreflang="zh-TW" href="http://localhost/zh_TW">
<link rel="alternate" hreflang="hr-HR" href="http://localhost/hr">
<link rel="alternate" hreflang="cs-CZ" href="http://localhost/cs">
<link rel="alternate" hreflang="da-DK" href="http://localhost/da">
<link rel="alternate" hreflang="nl-NL" href="http://localhost/nl">
<link rel="alternate" hreflang="nl-BE" href="http://localhost/nl_BE">
<link rel="alternate" hreflang="en-GB" href="http://localhost/en_GB">
<link rel="alternate" hreflang="et-EE" href="http://localhost/et">
<link rel="alternate" hreflang="fi-FI" href="http://localhost/fi">
<link rel="alternate" hreflang="fr-FR" href="http://localhost/fr">
<link rel="alternate" hreflang="gl-ES" href="http://localhost/gl">
<link rel="alternate" hreflang="de-DE" href="http://localhost/de">
<link rel="alternate" hreflang="el-GR" href="http://localhost/el">
<link rel="alternate" hreflang="iw-IL" href="http://localhost/iw">
<link rel="alternate" hreflang="hi-IN" href="http://localhost/hi">
<link rel="alternate" hreflang="hu-HU" href="http://localhost/hu">
<link rel="alternate" hreflang="in-ID" href="http://localhost/in">
<link rel="alternate" hreflang="it-IT" href="http://localhost/it">
<link rel="alternate" hreflang="ja-JP" href="http://localhost/ja">
<link rel="alternate" hreflang="ko-KR" href="http://localhost/ko">
<link rel="alternate" hreflang="lo-LA" href="http://localhost/lo">
<link rel="alternate" hreflang="nb-NO" href="http://localhost/nb">
<link rel="alternate" hreflang="fa-IR" href="http://localhost/fa">
<link rel="alternate" hreflang="pl-PL" href="http://localhost/pl">
<link rel="alternate" hreflang="pt-BR" href="http://localhost/pt">
<link rel="alternate" hreflang="pt-PT" href="http://localhost/pt_PT">
<link rel="alternate" hreflang="ro-RO" href="http://localhost/ro">
<link rel="alternate" hreflang="ru-RU" href="http://localhost/ru">
<link rel="alternate" hreflang="sr-RS" href="http://localhost/sr">
<link rel="alternate" hreflang="sr-RS-latin" href="http://localhost/sr_RS_latin">
<link rel="alternate" hreflang="sl-SI" href="http://localhost/sl">
<link rel="alternate" hreflang="sk-SK" href="http://localhost/sk">
<link rel="alternate" hreflang="es-ES" href="http://localhost/es">
<link rel="alternate" hreflang="sv-SE" href="http://localhost/sv">
<link rel="alternate" hreflang="tr-TR" href="http://localhost/tr">
<link rel="alternate" hreflang="uk-UA" href="http://localhost/uk">
<link rel="alternate" hreflang="vi-VN" href="http://localhost/vi">

我想删除不需要的语言。我希望这些链接被删除,因为这不是搜索引擎优化的好做法。我想要一个主题的默认语言。我尝试在门户ext文件中添加
translations.disabled=true
,但没有成功


非常感谢您的建议。

您必须限制使用您想要使用的区域设置,将“locales”属性添加到portal-ext.porperties。例如,要将其限制为英语和德语,您可以这样做

locales=en_US,de_de

另见

我在此引述:

删除不需要的语言

默认情况下,Liferay支持以下所有语言(摘自Liferay 4.3.3的portal.properties):

语言环境=ar_SA,ca_AD,ca_ES,zh_CN,zh_TW,cs_CZ,nl_nl,en_US,fi_fi,fr_fr,de_de,el_GR,hu_hu,it_it,ja_JP,ko KR,fa IR,pt_BR,ru_ru,ES_ES,sv_SE,tr_tr,vi_VN

如果我们只想支持英语、德语和西班牙语,我们只需删除不需要的区域设置,以便我们的区域设置值如下所示:

locales=en_US,de_DE,es_ES

可以在
控制面板>设置>显示设置>可用语言中覆盖portal-ext.properties设置。我认为把它们放在那里是安全的


此外,SEO部分中还有一个每页选项,用于禁用那里的规范链接。

在启动服务器后,转到web.xml并删除语言映射url


url--tomcat-7.0.42\webapps\ROOT\WEB-INF

我已经添加了locales=en_US,但所有其他链接仍然显示在head标签中。还有一件事可以帮助您指导我。无论何时我登录到管理员,链接都不会显示。但是当我部署主题时,它确实显示了如上所示的链接。谢谢:)关于区域设置,它应该可以工作。您可以在Liferay的新实例上尝试它。我认为您的配置中还存在一些其他错误。虽然此链接可以回答问题,但最好在此处包含答案的基本部分,并提供链接以供参考。如果链接页面发生更改,仅链接的答案可能无效。感谢@skyline75489提供您的建议。:)