2013-02-12 229 views
4

我使用的是Liferay 6.1,并开发了同样的主题。我的问题是当我加载主题部分包含巨大的链接,如下所示的主题:移除liferay主题中的本地化

<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"> 

我想删除不需要的语言。我希望这些链接被删除,因为这不是SEO的好做法。我想要一个主题的默认语言。我试图在portal-ext文件中添加translations.disabled=true,但这没有奏效。

您的任何建议表示赞赏。

回答

3

您必须限制到您要使用的语言环境,将“语言环境”属性添加到portal-ext.porperties。将其限制于englisch和德国例如,你可以这样做

区域设置= en_US,则de_DE这个

+2

我已经添加了语言环境= EN_US但仍所有其他环节得到头标记显示。 – 2013-02-15 04:06:59

+1

还有一件事可以帮助你指导我。每当我登录到管理员的链接不显示。但是当我部署主题时,它确实显示如上所示的链接。 – 2013-02-15 04:39:43

+0

谢谢:)关于语言环境,它应该工作。你可以尝试一下Liferay的新实例。我认为你的配置还有一些其他的错误。 – Adel 2013-02-18 20:59:53

0

又见official wiki documentation

我在这里引用它:

删除不需要的语言

默认情况下,Lifer AY支持所有后续语言(摘自的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 
+0

尽管这个链接可能回答这个问题,但最好在这里包含答案的基本部分,并提供供参考的链接。如果链接页面更改,则仅链接答案可能会失效。 – skyline75489 2015-05-06 08:46:44

+0

谢谢@ skyline75489您的建议。 :) – MDT 2015-05-06 08:48:56

0

portal-ext.properties设置可以覆盖我的门户设置Control Panel > Settings > Display Settings > Available Languages。我想说把它们放在那里是安全的。

另外,在SEO部分有一个每页选项来禁用那里的规范链接。

0

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

网址 - 的tomcat-7.0.42 \的webapps \ ROOT \ WEB-INF