Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Localized UTF8 labels in Charts
djatnieks
I am having trouble getting Chinese language translations to display in chart lables, e.g. x-axis or y-axis or chart title labels. I am using externalized text in a properties file but get square blocks instead of chinese characters.
I am able to get chinese characters (from the same properties file) to display correctly in other parts of my report, e.g. report table, title, etc. It's ONLY the chart where it doesn't work.
When I first externalized the text into properties files and provided a Chinese version (myReport_zh.properties) I found that I needed to first use the "native2ascii" program , e.g.
native2ascii -encoding UTF-8 t.properties myReport.properties
Once I did this, chinese characters appear in my reports ok, but in the charts I just get square blocks.
Is there some other representation of UTF8 characters I need to use to enable both the report body and charts to display properly?
Thanks for any help or advice.
dan
Find more posts tagged with
Comments
djatnieks
Entries in my properties file look like this for the Chinese locale:
MyReport_zh.properties:
LabelError=u9519u8bef
As I said - this works great for the main report and I get the Chinese characters I expect.
But it does not work for Charts -all I get are square box shapes.
Any ideas?
dstoian
I found a related article here:<br />
<a class='bbc_url' href='
http://www.birt-exchange.org/blog/2008-04-04/using-properties-files-to-localize-birt-reports/'>Using
Properties Files to Localize BIRT Reports » Blog - BIRT Exchange</a><br />
<br />
In chart script, the process is slightly different. Here is an example of an onRender script which sets a localized chart title:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
/**
* Called before generation of chart model to GeneratedChartState.
*
*
@param
chart
* Chart
*
@param
icsc
* IChartScriptContext
*/
function beforeGeneration( chart, icsc )
{
var rc = icsc.getExternalContext().getScriptable();
var title = rc.getMessage("mystringid", getLocale());
chart.getTitle().getLabel().getCaption().setValue(title);
}
</pre>
<br />
Hope this helps.
bourdgu
<blockquote class='ipsBlockquote' data-author="'djatnieks'" data-cid="51171" data-time="1248303345" data-date="22 July 2009 - 03:55 PM"><p>
I am having trouble getting Chinese language translations to display in chart lables, e.g. x-axis or y-axis or chart title labels. I am using externalized text in a properties file but get square blocks instead of chinese characters.<br />
<br />
<br />
I am able to get chinese characters (from the same properties file) to display correctly in other parts of my report, e.g. report table, title, etc. It's ONLY the chart where it doesn't work.<br />
<br />
<br />
When I first externalized the text into properties files and provided a Chinese version (myReport_zh.properties) I found that I needed to first use the "native2ascii" program , e.g.<br />
<br />
<br />
native2ascii -encoding UTF-8 t.properties myReport.properties<br />
<br />
<br />
Once I did this, chinese characters appear in my reports ok, but in the charts I just get square blocks. <br />
<br />
<br />
Is there some other representation of UTF8 characters I need to use to enable both the report body and charts to display properly?<br />
<br />
<br />
Thanks for any help or advice.<br />
<br />
dan<br /></p></blockquote>
<br />
Did you ever get a solution? I'm having the exact same problem.<br />
<br />
Thanks,<br />
<br />
-Guillaume