NTNUJAVA Virtual Physics Laboratory
Enjoy the fun of physics with simulations!
November 28, 2014, 03:32:47 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Music is a higher revelation than all wisdom and philosophy. Complete the mission of life. ..."Beethoven (1770-1827, German composer)"
Google Bookmarks Yahoo My Web MSN Live Netscape Del.icio.us FURL Stumble Upon Delirious Ask FaceBook

Pages: [1]   Go Down
  Print  
Author Topic: Translate Strings into local language format  (Read 41124 times)
0 Members and 1 Guest are viewing this topic. Click to toggle author information(expand message area).
Fu-Kwun Hwang
Administrator
Hero Member
*****
Offline Offline

Posts: 3058



WWW
«
Embed this message
on: March 10, 2004, 06:23:57 am »

I received lots of email asking for translating "String"s or "Label"s in the java applets.
After several days of work, I modified all the java applets to make it easier to change the strings.
Examples:The following is java applet with default parameters

<applet code="translate.class" width=200 height=100>
<param name="Reset" value="Reset">
<param name="Clear" value="Clear">
<param name="choices" value="choice a,choice b,choice c">
</applet>


The following is java applet with new parameters

<applet code="translate.class" width=300 height=100>
<param name="Reset" value="New Label">
<param name="Clear" value="You can use local characters">
<param name="choices" value="test 1, select 2, item 3 ">
</applet>


For choice(selected items), items are separated by "," .And please DO NOT use more items than the number of original parameters.
Modify value field of the parameters, not the name field.


What you should do is copy my original web page to a different filename and modidy java applet parameters.
Enjoy it! Please send me any comments you might have!
Logged
rmokhtar
Newbie
*
Offline Offline

Posts: 3

«
Embed this message
Reply #1 on: March 13, 2009, 12:25:54 am »

Hi sir,

thanks for putting in that modification some 5 years ago. However, it produces blocks when I enter the names in Arabic.

For example:

Code:
 
<applet code="thickLens.class" width=500 height=340>
<param name="Reset" value="إعادة">
<param name="MSG" value="معامل الانكسار">
<param name="Nchoices" value="3">
<param name="choices" value="ماء,1.333,زجاج,1.500,الماس,2.417">
<param name="user" value="user define">
</applet>

produces the screen shot attached.

Have I forgotten to set something somewhere in my browser or the Java applet runtime settings?

Thanks in advance,
Reem


* print_screen.jpg (61.8 KB, 961x729 - viewed 189 times.)
Logged
Fu-Kwun Hwang
Administrator
Hero Member
*****
Offline Offline

Posts: 3058



WWW
«
Embed this message
Reply #2 on: March 13, 2009, 04:14:06 pm » posted from:Taipei,T'ai-pei,Taiwan

Registed user can get files related to this applet for offline access.
Problem viewing java?Add http://www.phy.ntnu.edu.tw/ to exception site list
If java program did not show up, please download and install latest Java RUN TIME


Let me check it! I just copied you parameters and posted it here. It seems look fine with my browser.
The applet shows values you have provided (Even I do not understand it. But I think it is the same).
I set the character cording for the browser to utf-8. If you change it to other values, it would not work.



Registed user can get files related to this applet for offline access.
Problem viewing java?Add http://www.phy.ntnu.edu.tw/ to exception site list
If java program did not show up, please download and install latest Java RUN TIME
Logged
rmokhtar
Newbie
*
Offline Offline

Posts: 3

«
Embed this message
Reply #3 on: March 13, 2009, 09:20:05 pm »

Took me a while but I figured it out. Just in case someone else has this problem:

It's not the browser encoding settings, it's the Java applet runtime settings. My browser was already set for utf-8 encoding when I had this problem.

http://mindprod.com/jgloss/encoding.html#SUPPORT

The applet here shows you what your default Java runtime encoding scheme is. For me it was Cp1252. By adding "-Dfile.encoding=UTF-8" to the runtime parameters, and restarting your browser (making sure the Java process restarts as well), you can make your Java runtime display it in utf-8. (I rechecked that this was the reason by changing it back to Cp1252 and restarting my browser again).

In Windows (haven't tried it in *nix), when you run Java there's a little icon that you can right click to get to the Java Control Panel. Once you open that, go to the Java tab, then click on the "View" button under Java Applet Runtime Settings, from there you should see a window similar to the attached image.

At the row with the version of Java that is currently enabled ('Enable' checkbox checked), add the following under the "Java Runtime Parameters" field, add "-Dfile.encoding=UTF-8".

Take care,
Reem


* javaruntime.jpg (64.75 KB, 961x672 - viewed 189 times.)
Logged
Fu-Kwun Hwang
Administrator
Hero Member
*****
Offline Offline

Posts: 3058



WWW
«
Embed this message
Reply #4 on: March 13, 2009, 10:13:37 pm » posted from:Taipei,T\'ai-pei,Taiwan

Thank you very much for your valuable information. Cheesy
Logged
georgerobinson
Newbie
*
Offline Offline

Posts: 4

«
Embed this message
Reply #5 on: December 21, 2010, 02:29:02 pm » posted from:Kannur,Kerala,India

Hey, its quite informative to me like people, one can get great benefits from your good efforts to finalize this.

Thanks for good sharing. Smiley
Logged
Pages: [1]   Go Up
  Print  
Music is a higher revelation than all wisdom and philosophy. Complete the mission of life. ..."Beethoven (1770-1827, German composer)"
 
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.13 | SMF © 2006-2011, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.09 seconds with 22 queries.since 2011/06/15