Can anyone explain the Use of
$taglibLiferay.language("fm", null, "languageId",3)
in liferay Theme portal_normal.vm file.
I have used it in Theme for changing the language.
This is usage of language portlet allowing to displays all available languages.
$taglibLiferay.language(String formName, String formAction, String name, String[] languageIds, int displayStyle)
Related
I'm using the flutter plugin Intl for localize my app, everything work great, I can use variable in my strings like
//Somewere in code
String displayname = 'toto';
S.of(context).whyDeserveSecondChance(displayName),
Which prints the correct String in the correct language with the correct displayname.
My problem here, is that I want my displayname to appear on screen with a different color, I know that I can split my string in 3 but in some language it will just not work, so I have to keep it one string with the ${displayname}
I've search all day with no luck, does someone have a clue for me?
I have a requirement where I need to change the text of Actions like Add Document, Refresh, New Folder when in arabic. Can anyone point me towards any sample code that can help me accomplish this. Thanks in advance.
This is a quick and dirty way.
An optional and probably a more maintainable way is to place all your translations in a property file, then load the text based on your locale.
public String changeMyText(Locale locale, String text) {
if ("ar".equalsIgnoreCase(locale.getLanguage())) {
if ("Actions".equalsIgnoreCase(text)) {
return "arabic translation of actions";
}
}
return "no_valid_translation";
}
Im localizing my GWT app, and I want to localize the context menu in my listgrid (SmartGWT). According to the doc, I can set the title of group/ungroup by:
http://www.smartclient.com/smartgwt/javadoc/com/smartgwt/client/widgets/grid/ListGrid.html#setGroupByText(java.lang.String)
public void setGroupByText(String groupByText)
This is a dynamic string - text within \${...} will be evaluated as JS code when the message is displayed, with title available as a variable containing the field title. Default value returns "Group by " + the field's summary title.
I want to put "Group by XXX" (in different languages), where XXX is the column title, and I should be able to do that with a dynamic string, which evaluates the JS title variable. But how? I need a concrete example, such as:
list.setGroupByText("GROUP BY \\${title}"); // DOES NOT WORK!!!
list.setGroupByText("GRUPPÉR MED \\${title}"); // DOES NOT WORK!!!
Any suggestions?
Ok, I might be very stupid. Here's the answer:
list.setGroupByText("Group by ${title}");
So, in danish that would be:
list.setGroupByText("Gruppér efter ${title}");
I have created a custom field in Opportunities, but I also have to translate its label into Russian and there is no option for it in the "Edit labels" menu.
I prefer to create translated labels without Studio.
Main idea is that module string label is a value of *$mod_strings* array key which is defined in language file(s) located in modules//language/ , custom/modules//language/ and/or custom/modules/Accounts/Ext/Language/*.lang.ext.php
Thus to have an existing string in English translated into your native language manually you should do the following:
Copy your English string to be translated in browser (e.g. "Description")
Use your IDE or OS find/search function to find needed $mod_strings key that has value of the string above (e.g. *$mod_strings['LBL_DESCRIPTION']*)
Copy that key name
Change to custom/Extension/modules//Ext/Language (so called Master Directory) and create new (or append to existing) file named (in your case) ru_ru.custom.lang.php
Add a line like
$mod_strings['LBL_DESCRIPTION'] = 'Описание';
Make Quick Repair and Rebuild
Go to
Studio » Contacts » Labels,
then you can see that label and then select
'US English' or 'Russian'
from the language drop down.
I am using DynamicJasper to generate reports from some tables at run time. I have some fields that the data has been styled using basic html tags as the data was created. Very basic tags like bold and italic, and jasper reports can handle them by setting the markup attribute of the textElement to html. The problem is a can not find a way to change it using DynamicJasper.
I have tried using addFieldProperty("markup", "html") found in ColumnBuilder, but that adds markup as a property to the field markup (probably obvious that it should do that based on the name) instead of the text elemennt.
How to you change the markup value for a text element using DynamicJasper?
The DynamicJasper API does not contain methods to set markup.
But you can use JasperReports API for this needs.
For example, the JRBasePrintText class and JRCommonText interface have method for setting markup:
public void setMarkup(java.lang.String markup)
The JRCommonText interface has constant fields:
public static final String MARKUP_NONE = "none";
public static final String MARKUP_STYLED_TEXT = "styled";
public static final String MARKUP_HTML = "html";
public static final String MARKUP_RTF = "rtf";
You can modify DynamicJasper classes for your needs like in this post, for example.