Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Can't override language keys
Hello,
I tried overriding lithuanian language using this tutorial: https://dev.liferay.com/es/develop/tutorials/-/knowledge_base/7-1/overriding-global-language-keys#create-a-resource-bundle-service-component but for some reason doesn't work with all keys. For example, it overrides 'home' key but not 'sign-in', 'submit', etc.
Also I tried overriding english language but it works as expected...
Maybe someone knows what I'm doing wrong. Thank you in advance.
I tried overriding lithuanian language using this tutorial: https://dev.liferay.com/es/develop/tutorials/-/knowledge_base/7-1/overriding-global-language-keys#create-a-resource-bundle-service-component but for some reason doesn't work with all keys. For example, it overrides 'home' key but not 'sign-in', 'submit', etc.
Also I tried overriding english language but it works as expected...
Maybe someone knows what I'm doing wrong. Thank you in advance.
Hi Pam,
Can you try doing it such that you refrence Language_lt ... so basically drop all references to the _LT?
Can you try doing it such that you refrence Language_lt ... so basically drop all references to the _LT?
Thanks for reply, Andrew.
Sadly, it's still not working.
Sadly, it's still not working.
Could you try the following lines of code (it didn't work for me either and I made the following change a couple of months ago):
And I have added this method:
private final ResourceBundle _resourceBundle = ResourceBundle.getBundle(
"content.Language", getLocale(), getClass().getClassLoader(), UTF8Control.INSTANCE);
And I have added this method:
@Override
public Locale getLocale() {
return Locale.JAPAN;
}(of course with your own locale, not Japan). I am not sure, if one or both of these changes are necessary, I fiddled with it for a while till it worked.
Strange that it didn't work. I checked the portal.properties and lt_LT is listed, but it is part of the beta locales. Normally though I thought that just meant that it was still a work in progress so not all of the language keys are necessarily translated (or correctly translated). I just thought dropping the country code might help because I can see in the portal source the that the file is listed as Langauage_lt.properties (no country code).
*shrug*
*shrug*
Christoph,
I tried your solution but it still doesn't work.
I tried your solution but it still doesn't work.
Finally got it working and it was a fail from me. After deploying resource bundle tomcat restart is needed.
I thought it wasn't necessary because some language keys changed as I said before.
I thought it wasn't necessary because some language keys changed as I said before.
Really? That is odd because I was always under the impression the the changes were immediate. In fact I am sure I have created language bundle overrides and not had to restart to see the changes.
I would consider maybe opening a ticket at issues.liferay.com to let them know jay in case it's not the expected behaviour.
Either way, glad you got it resolved and thanks for sharing your steps
I would consider maybe opening a ticket at issues.liferay.com to let them know jay in case it's not the expected behaviour.
Either way, glad you got it resolved and thanks for sharing your steps