Forums de discussion
Language portlet with [Beta] suffix!
Adel Bayoudh, modifié il y a 9 années.
Language portlet with [Beta] suffix!
Junior Member Publications: 47 Date d'inscription: 05/08/14 Publications récentes
hello,
My problem is that the language portlet display a list of languages with [Beta] suffix . how I can display the languages without seeing the word [Beta].
A picture of my portlet is attached for better understanding)
Best regards
My problem is that the language portlet display a list of languages with [Beta] suffix . how I can display the languages without seeing the word [Beta].
A picture of my portlet is attached for better understanding)
Best regards
Pièces jointes:
Pankaj Kathiriya, modifié il y a 9 années.
RE: Language portlet with [Beta] word !
Liferay Master Publications: 722 Date d'inscription: 05/08/10 Publications récentes
In portal.properties, you will find list of locales which are listed as beta by property locales.beta.
For each of this listed locale it will show Beta label as suffix to language name, refer code of portal-web\docroot\html\taglib\ui\language\page.jsp.
You can remove your locale from property locale.beta in portal-ext.properties file to remove beta label.
For each of this listed locale it will show Beta label as suffix to language name, refer code of portal-web\docroot\html\taglib\ui\language\page.jsp.
You can remove your locale from property locale.beta in portal-ext.properties file to remove beta label.
Adel Bayoudh, modifié il y a 9 années.
RE: Language portlet with [Beta] word !
Junior Member Publications: 47 Date d'inscription: 05/08/14 Publications récentes
hello,
where I can find my portal.properties?
when I search in my tomcat folder I find multiple files with this name!
I am using the 6.2 liferay version.
thank you
where I can find my portal.properties?
when I search in my tomcat folder I find multiple files with this name!
I am using the 6.2 liferay version.
thank you
Pankaj Kathiriya, modifié il y a 9 années.
RE: Language portlet with [Beta] suffix!
Liferay Master Publications: 722 Date d'inscription: 05/08/10 Publications récentes
In Liferay source you will find at location "\portal-impl\src\portal.properties".
You have to override locales.beta property in portal-ext.properties. You can place portal-ext.properties file parallel to tomcat folder or under tomcat/webapps/ROOT/classes/
You have to override locales.beta property in portal-ext.properties. You can place portal-ext.properties file parallel to tomcat folder or under tomcat/webapps/ROOT/classes/
Adel Bayoudh, modifié il y a 9 années.
RE: Language portlet with [Beta] suffix!
Junior Member Publications: 47 Date d'inscription: 05/08/14 Publications récentes
Thank you, it works!
Ahmed bouchriha, modifié il y a 9 années.
RE: Language portlet with [Beta] suffix!
Junior Member Publications: 55 Date d'inscription: 04/05/12 Publications récentes
Hi,
For the people that don't want to override Liferay language properties you can remove the [beta] suffix with
javascript or jquery using the following code :
JavaScript Code :
For the people that don't want to override Liferay language properties you can remove the [beta] suffix with
javascript or jquery using the following code :
JavaScript Code :
window.onload=function(){
var langList = document.getElementsByClassName('taglib-language-list-text');
if(langList){
for(var i=0; i<langlist.length; i++) { var langtxt="langList.item(i).innerText.replace("[Beta]","");" langlist.item(i).text="langTxt" ; } };< code></langlist.length;>
<br><br>jQuery Code :<br><br><pre><code>jQuery(document).ready(function() {
if($('.taglib-language-list-text')){
$('.taglib-language-list-text').each(function( index ) {
var langTxt = $(this).text().replace("[Beta]","");
$(this).text(langTxt);
});
}
});</code></pre><br><br>The above snippets can be placed on the theme or on the custom javascript field on the site manage pages.<br>Solution tested on LR 6.1, LR 6.2.<br><br><a href="https://www.themeray.com">Themeray</a><br><br>Best Regards
Adel Bayoudh, modifié il y a 9 années.
RE: Language portlet with [Beta] suffix!
Junior Member Publications: 47 Date d'inscription: 05/08/14 Publications récentes
I tested with JQuery and it works for me
Ahmed bouchriha, modifié il y a 9 années.
RE: Language portlet with [Beta] suffix!
Junior Member Publications: 55 Date d'inscription: 04/05/12 Publications récentes
Glad to hear that
fouad fouad, modifié il y a 9 années.
RE: Language portlet with [Beta] suffix!
Junior Member Publications: 28 Date d'inscription: 08/08/14 Publications récentes
sorry man, but i didnt know how to place the code.
thank you
thank you
Adel Bayoudh, modifié il y a 9 années.
RE: Language portlet with [Beta] suffix!
Junior Member Publications: 47 Date d'inscription: 05/08/14 Publications récentes
hello,
you need to insert it into the file portal_normal.vm in your theme.
you need to insert it into the file portal_normal.vm in your theme.
fouad fouad, modifié il y a 9 années.
RE: Language portlet with [Beta] suffix!
Junior Member Publications: 28 Date d'inscription: 08/08/14 Publications récentes
yes man, i did, but nothing chganged.
i have an embeded language portlet in my theme
#set ($VOID = $velocityPortletPreferences.setValue('displayStyle', '2'))
#set ($VOID = $velocityPortletPreferences.setValue('languageIds', 'en_US,ar_SA,fr_FR'))
#set ($VOID = $velocityPortletPreferences.setValue('portletSetupShowBorders', 'false'))
#set ($portlet_id = '82')
#set ($my_portlet_id = "${portlet_id}_INSTANCE_5874")
$theme.runtime($my_portlet_id, "", $velocityPortletPreferences.toString())
$velocityPortletPreferences.reset()
then i added your code
<script>
window.onload=function(){
var langList = document.getElementsByClassName('taglib-language-list-text');
if(langList){
for(var i=0; i<langList.length; i++)
{
var langTxt = langList.item(i).innerText.replace("[Beta]","");
langList.item(i).text = langTxt ;
}
}
</script>
but nothing changed
i have an embeded language portlet in my theme
#set ($VOID = $velocityPortletPreferences.setValue('displayStyle', '2'))
#set ($VOID = $velocityPortletPreferences.setValue('languageIds', 'en_US,ar_SA,fr_FR'))
#set ($VOID = $velocityPortletPreferences.setValue('portletSetupShowBorders', 'false'))
#set ($portlet_id = '82')
#set ($my_portlet_id = "${portlet_id}_INSTANCE_5874")
$theme.runtime($my_portlet_id, "", $velocityPortletPreferences.toString())
$velocityPortletPreferences.reset()
then i added your code
<script>
window.onload=function(){
var langList = document.getElementsByClassName('taglib-language-list-text');
if(langList){
for(var i=0; i<langList.length; i++)
{
var langTxt = langList.item(i).innerText.replace("[Beta]","");
langList.item(i).text = langTxt ;
}
}
</script>
but nothing changed
Adel Bayoudh, modifié il y a 9 années.
RE: Language portlet with [Beta] suffix!
Junior Member Publications: 47 Date d'inscription: 05/08/14 Publications récentes
trying it with
<script type="text/javascript">
jQuery(document).ready(function() {
if($('.taglib-language-list-text')){
$('.taglib-language-list-text').each(function( index ) {
var langTxt = $(this).text().replace("[Beta]","");
$(this).text(langTxt);
});
}
});
</script>
<script type="text/javascript">
jQuery(document).ready(function() {
if($('.taglib-language-list-text')){
$('.taglib-language-list-text').each(function( index ) {
var langTxt = $(this).text().replace("[Beta]","");
$(this).text(langTxt);
});
}
});
</script>
fouad fouad, modifié il y a 9 années.
RE: Language portlet with [Beta] suffix!
Junior Member Publications: 28 Date d'inscription: 08/08/14 Publications récentes
hello Adel Bayoudh
i tried it too, but no success .
should i add any jquery file too? or should i add something else?
thank you in advance
i tried it too, but no success .
should i add any jquery file too? or should i add something else?
thank you in advance
Adel Bayoudh, modifié il y a 9 années.
RE: Language portlet with [Beta] suffix!
Junior Member Publications: 47 Date d'inscription: 05/08/14 Publications récentes
yes you need a jquery file
<script src="$themeDisplay.getPathThemeRoot()/js/jquery.min.js"></script>
if you use firefox install a firebug plugin and you can see later a javascript error !
<script src="$themeDisplay.getPathThemeRoot()/js/jquery.min.js"></script>
if you use firefox install a firebug plugin and you can see later a javascript error !
fouad fouad, modifié il y a 9 années.
RE: Language portlet with [Beta] suffix!
Junior Member Publications: 28 Date d'inscription: 08/08/14 Publications récentes
i added the jquery file inside _diffs/js folder
and i included it as u mentioned in portal_normal.vm
nothing changed, i have firbug, i went to scripts tab and i saw that the jquery file is being read successfully.
so what the problem do u thinnk?
and i included it as u mentioned in portal_normal.vm
nothing changed, i have firbug, i went to scripts tab and i saw that the jquery file is being read successfully.
so what the problem do u thinnk?
fouad fouad, modifié il y a 9 années.
RE: Language portlet with [Beta] suffix!
Junior Member Publications: 28 Date d'inscription: 08/08/14 Publications récentes
its working fine now thank you man
Tomas Augustaitis, modifié il y a 9 années.
RE: Language portlet with [Beta] suffix!
New Member Publications: 6 Date d'inscription: 15/10/13 Publications récentes
@Ahmed bouchriha
Nice js approach.
I did the same thing by creating hook and overriding ROOT\html\taglib\ui\language\page.jsp line 128 from
to
Nice js approach.
I did the same thing by creating hook and overriding ROOT\html\taglib\ui\language\page.jsp line 128 from
localeDisplayName = LocaleUtil.getShortDisplayName(locales[i], duplicateLanguages);
to
localeDisplayName = LocaleUtil.getShortDisplayName(locales[i], duplicateLanguages).replace(" [Beta]", "");
Ahmed bouchriha, modifié il y a 9 années.
RE: Language portlet with [Beta] suffix!
Junior Member Publications: 55 Date d'inscription: 04/05/12 Publications récentes
Hi Tomas
Glad to hear that my solution helped you .
Good job for the hook it will rmove the beta prefix independently of the theme.
Best Regards
Glad to hear that my solution helped you .
Good job for the hook it will rmove the beta prefix independently of the theme.
Best Regards