Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted on May 07, 2009 02:08
open dhtmlx forum
DHTMLGRID-Locale based text on UI.

DHTMLXGrid displays below messages on UI.

Can you explain how Japanese text is shown based on locale?

{
please_select: "Please select a row.",
error:"Error",
destination_not_specified: "Destination not specified.",
Start: "Start",
Stop: "Stop",
Loading: "Loading...",
results:"Results1",
records:"Records from " ,
to:" to ",
page:"Page ",
perpage:"rows per page",
first:"To first Page",
previous:"Previous Page",
found:"Found records",
next:"Next Page",
last:"To last Page",
of:" of ",
notfound:"No Records Found"

}
Answer posted by dhxSupport on May 07, 2009 05:28
The component are encoding agnostic, they has not any hard-coded text (except of error messages and paging in grid, which has separate logic for localization http://dhtmlx.com/docs/products/dhtmlxGrid/doc/articles/Custom_paging.html#grid_art_custpaging )

To use Japanese characteres just be sure that both - page and XML data has correct encoding , it must be enough to show text in any encoding supported by browser. 

Answer posted by sanjay on May 07, 2009 06:44

I didnot understand below description for I18N, Can you explain the structure in detail?

All text labels used in the "Toolbar" and "Bricks" skins are stored in a separate structure. So it might not cause any problems to support different languages.

Answer posted by sanjay on May 07, 2009 06:52
I need to localize error messages and paging in grid,Please explain me the changes I need to do that text that is in japanese language or any language is shown based on locale.
Answer posted on May 08, 2009 01:17

To localize paging toolbar you should change following stucture:

<script>

grid.i18n.paging={

  results:"Results",
  records:"Records from ",
  to:" to ",
  page:"Page ",
  perpage:"rows per page",
  first:"To first Page",
  previous:"Previous Page",
  found:"Found records",
  next:"Next Page",
  last:"To last Page",
  of:" of ",
  notfound:"No Records Found" }

</script>

Instead of "Results", "Records from", " to " you should place japanese text.

>>I need to localize error messages
Please describe what error messages do you mean?


Answer posted by sanjay on May 10, 2009 22:44
say I have two files in above format one for english and another for japanese.Can you tell me how japanese text will be loaded based on locale.Do I need to create two files with names some thing like this messages_en_US and message_ja_JP.
Answer posted by Support on May 11, 2009 02:42
>>say I have two files in above format one for english and another for japanese.
Yes, this is most common approach. 

>>how japanese text will be loaded based on locale
It depends on used implementation, you are using some other content on page , so some kind of locale detection|setting must be already present, right? So you can use same logic to load necessary js code, or output js code directly on page

<%
            if (user_lang == "en")
                 print("<script scr='setting_en.js' ></script>");
            else
                 print("<script scr='setting_jp.js' ></script>");
%>