fixes #3111 Problem on Languages Portlet

Fixed the issue and pushed the code for review, please check it.