Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: wb_ge unicode

wb_ge unicode 12 years 9 months ago #2377

When I use wb_ge to edit the graph
it crash if I change text from english text to chinese.
the bug_report see the attach file.

Attachment wb_ge_bugreport.txt not found



Post edited by: chenguowang, at: 2011/06/30 06:35
Attachments:
The administrator has disabled public write access.

Re:wb_ge unicode 12 years 9 months ago #2383

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 3177
  • Thank you received: 502
  • Karma: 133
Hi chengouwang,

Editing with unicode characters in the development environment is not supported. What is supported is translation tables with unicode characters. So you have to edit the Ge graphs in English, and then create translations files for English and Chinese for all strings that are used in the graph. Also set Translate in GraphAttributes for the graph.

This brief description is fetched from releasenotes 4.5

Local translationtables
Project local translationtables to translate alarm messages and texts in Ge graphs can be placed on $pwrp_exe. rt_xtt will translate an english text that is found in the en_us table, to the corresponding text in the current language.

Syntax

The first letter on a row can be E or B. If E, only an exact match of the string will be translated. For B the beginning of the string should be equal.
The three numbers separated by points, are the key to identify corresponding texts of different languages. In the first number, 0-99999 is reserved.

Example
English table $pwrp_exe/lng_en_us.dat
[code:1]# Eurotherm TC3001
E 100000.0.1 \"ProcessValue\"
E 100000.0.2 \"LineVoltage\"
E 100000.0.3 \"LoadVoltage\"
B 100000.0.21 \"Engineering unit violation, \"
E 100000.0.31 \"Electrical cabinet\"[/code:1]

Chinese table $pwrp_exe/lng_zh_cn.dat (sorry, don't know any chinese characters)
[code:1]Coding:UTF-8
# Eurotherm TC3001
E 100000.0.1 \"????\"
E 100000.0.2 \"????\"
E 100000.0.3 \"????\"
B 100000.0.21 \"????, \"
E 100000.0.31 \"????\"[/code:1]

/Claes

Post edited by: claes, at: 2011/06/30 14:59
The administrator has disabled public write access.

Re:wb_ge unicode 12 years 6 months ago #2826

  • giants
  • giants's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 50
  • Karma: 0
Hi Claes,

I would like to use the Eastern European encoding. I tried to set it, but I wasn't successful .
I have read the encoding related entries but it is still not clear for me.

What is the absolute path of $pwrp_exe?

I think,for example if the name of the project is \"one\", then the absolute path will be /usr/local/pwrp/one/bld/x86_linux/exe. Is this correct? If it's correct then I have to put/set the code table here?
Another question: If I set a denomination in a graphic object, how I identify it in the code table? Is it enough if the text is in the lng_us_en.dat table? Are the identity numbers chosen arbitrary ?
After the complies the encoded text cames up automatically, or I have to set the language?

thanks

Giants
The administrator has disabled public write access.

Re:wb_ge unicode 12 years 5 months ago #2831

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 3177
  • Thank you received: 502
  • Karma: 133
Hi Giants,

The path is correct.

The translation is made in runtime, you will not see any translation in the editor. This is how the translation works. If Translate it set for the graph (in Graph Attributes), a string that is to be printed on the screen is first searched for in the English table. If there is an exact match, the corresponding identity number will be looked up in the current language table and the found text will be printed instead. Identity numbers less than 100000 in the first number are reserved but otherwise you can select any number you want.

Note that you can also create a translation table for all the other texts in the operator environment, see the Language page on this site http://www.proview.se/index.php?option=com_content&task=view&id=41&Itemid=75

/Claes
The administrator has disabled public write access.

Re:wb_ge unicode 12 years 5 months ago #2843

  • giants
  • giants's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 50
  • Karma: 0
Hi Claes,

thanks for your reply. The translation is still not working.
I set the following:

1. I created the file lng_en_us.dat, and I put it in the directory $pwrp_exe

The contents of lng_en_us.dat are :

E 100000.0.1 \"Backward\"
E 100000.0.2 \"Forward\"

2. I created the file lng_hu_hu.dat, and I put it in the directory $pwrp_exe too.

The contents of lng_hu_hu.dat are:

Coding:UTF-8
E 100000.0.1 \"Vissza\"
E 100000.0.2 \"Előre\"

3. I set Translate for the graph in Graph Attributes
4. I made the build.

That's all. After the restart, on the operator console/webconsle did not appear the translated text. (The text \"Forward\" is part of the button object -> AnalogText.Text1)

Where I went wrong?

G

Post edited by: giants, at: 2011/10/24 22:10
The administrator has disabled public write access.

Re:wb_ge unicode 12 years 5 months ago #2848

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 3177
  • Thank you received: 502
  • Karma: 133
Hi Giants,

If you are adding a new langague, hu_hu, you also have to create a directory for the general translation files in $pwr_exe/hu_hu. If you don't want to make a translation of these files you can just copy the files on $pwr_exe/en_us to this directory.

Then you start rt_xtt with the -l option

rt_xtt -l hu_hu

/Claes
The administrator has disabled public write access.
  • Page:
  • 1
Time to create page: 8.598 seconds