lang attribute in html element is not correct in edge scenarios

Description

When the user has set the language (e.g. using the language portlet) and then is sent to a page which uses the friendly url language filter the attribute 'lang' of the 'html' starting tag (<html lang="xx-XX">...) is not correct.

To reproduce (as guest):

  • go to a page which has a language portlet and choose a language (e.g. en-US)

  • go to the same page using domain:port/yy-YY where yy-YY is a language different from the previous one (e.g. localhost:8080/it/)

  • inspect the page (or the source) and you'll see that the page starts with (eg):
    <html ...... lang="en-US">
    while the content of the page is in the other language (it-IT in the example)

Activity

Show:

ginson.ren June 13, 2012 at 12:54 AM

PASSED Manual Testing following the steps in the description.

Reproduced on:
Tomcat 7.0 + MySQL 5. Portal 6.1.x EE GA1.

The source of page starts with (eg): <html ...... lang="en-US">.

Fixed on:
Tomcat 7.0 + MySQL 5. Portal 6.1.x CE GIT ID: 96dcbd7533474a152418ef049185d92ebcc4b9f6.
Tomcat 7.0 + MySQL 5. Portal 6.1.x EE GIT ID: c358b64023cd384127859058ef298e8c6da2c701.
Tomcat 7.0 + MySQL 5. Portal 6.2.x GIT ID: c8a5bfb3fe50c462bba76156999447b49b56e337.

The source of page starts with (eg): <html ...... lang="it-IT">.

Michael Saechang June 11, 2012 at 10:34 AM

Committed on:
Portal 6.1.x EE GIT ID: 8db5d5d11bacb0bb1244e53a7bfc1145962feb32.

Michael Saechang June 11, 2012 at 10:34 AM

Committed on:
Portal 6.1.x CE GIT ID: e308061ce0099b09f13b0c29a78c83d88aada0f1.
Portal 6.2.x GIT ID: 6ff2939ee9158671ed12bcc06ca9ce931a1121b8.

Pier Paolo Ramon September 26, 2011 at 4:24 AM

in /portal-web/docroot/html/themes/_unstyled/templates/init.vm

replace at line 73
#set ($w3c_language_id = $localeUtil.toW3cLanguageId($language_id))
with
#set ($w3c_language_id = $localeUtil.toW3cLanguageId($theme_display.getLanguageId()))

Fixed

Details

Assignee

Reporter

Labels

Branch Version/s

6.1.x

Backported to Branch

Committed

Fix Priority

3

Liferay Contributor's Agreement

Accept

Git Pull Request

Components

Priority

Zendesk Support

Created September 26, 2011 at 4:21 AM
Updated June 24, 2023 at 3:38 PM
Resolved May 31, 2012 at 9:43 AM
Loading...