2012年4月27日 星期五

【OpenCart】Add new language

Go to open cart  homepage,select 【Extension】

image

1.Select catalog lanaguage 2.Input what your language 3.Select your OpenCart version and License

finally choose favorite pack

image

Download it(mine is 1.5.2.1)

image

Unzip the file,you will see two folders as below

 

image

Copy the these folder to your OpenCart folder,you can overwrite them directly

image

Please check  language folder in admin folder or catalog folder,please remember the folder name and the file name

,we will use the data later(e.g. zh-HK and zh-HK.php)

image image

Go to admin link and select menu to 【System】=>【Location】=>【Language】and 【Insert】 an option

image

Fill each column(* is required Directory fill above directory name ,Filename fill above filename don’t need extension)

and should select status to enabled,and save

 

image

Then select menu 【System】=>【Setting】and edit the only one option

image

 

Then select【Local】and choose your language on Language and Admin Language,finally save.

image

So your site chage to your language

image

image

2012年4月20日 星期五

【Java】 Convert a Hex String to an Integer and Back Again

Hex String to an Integer 

   1: String hex = "2A"; //The answer is 42  



   2: int intValue = Integer.parseInt(hex, 16);  






Integer to Hex String





   1: String hex = Integer.toHexString(42);  





2012年4月16日 星期一

【Unity 3D】enable log for android platform

For now, this is what I am doing to get at least some information:

  • Enable "logcat" profiler in the player settings, under Other Settings (Android tab) of Player Settings.
  • Make sure USB debugging is enabled on the Android device (check under Settings | Development).
  • Run adb through the command prompt (with command line argument logcat) that comes with the Android SDK while running the game on the Android, still connected via USB to the computer.

This gives a tiny amount of profiling information (frametime, number of tris, time spend in in different areas, etc.), and updates as the program is run. (It also displays Debug.Log messages, which is even more useful than the actual profiling information).

You can click on the adb window to pause output, and press enter to resume. I run adb through PowerShell - I don't know pausing / resuming will work otherwise.

2012年4月1日 星期日

【Android】add a layout file into current activity

If layout flie(e.g. layout.xml) need to add to acticity using hardcard,below code is ths example

  1: controlInflater = LayoutInflater.from(getBaseContext());
  2:         View viewControl = controlInflater.inflate(R.layout.control, null);
  3:         LayoutParams layoutParamsControl 
  4:             = new LayoutParams(LayoutParams.FILL_PARENT, 
  5:             LayoutParams.FILL_PARENT);
  6:         this.addContentView(viewControl, layoutParamsControl);