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: Localization of custom field's name
Hello all, if we create a custom field programatically (favourite_color), it is displayed as "Favourite Color" in Liferay, which is OK if we have English selected. But how we could localize the name in other languages? I suppose that I should use the Language_<language>.properties to set the translation that I want to show in each language, but what key should I specify?
Thanks and regards
Thanks and regards
Hi ,You can try using Custom field name as key
Hello Mohammed, thanks for the suggestion! But it didn't work
Maybe it needs some special word before the favourite_color part in the key.
i dont think any special character is required , it only uses LanguageUtil.get(request, name); for getting the localized name , also favourite_color come as Favourite Color this is due to TextFormatter which is used to display that
You are right
With the field's name is enough. The problem I was having actually was that the Language file I was modifying was only loaded by a certain module. The language file containing the field's name should be one loaded by a module that uses the ResourceBundle service.
Thanks!
Thanks!
Yes you need to Resource bundle service for overriding Portal langauge.properties,
may be below link can help you
https://portal.liferay.dev/docs/7-0/tutorials/-/knowledge_base/t/overriding-language-keys
may be below link can help you
https://portal.liferay.dev/docs/7-0/tutorials/-/knowledge_base/t/overriding-language-keys