Thoughts of MahipalInnovate to simplify |
|
Thursday Feb 12, 2009
Web Space Server - Localization
We are back after hectic one month or so ... It was one of the interesting and challenging period ... So much of excitement so much to do less time .. pressure ... etc etc ... But but , Finally its out .. On Time ... Leaving behind happy faces :-). Yeah , I'm talking about Sun Glassfish Web Space Server 10.0 release (derived from Liferay 5.2) , first release from Sun after one of the unique development relationship between Sun and Liferay . To get more details .. Refer this blog on Portal Post . Let move to topic of blog i.e Localization (L10n). FAQ 1.0 : How can I get localized version Web Space Server ? To simplify customer experience , there is not extra steps to get localized version. It has been bundled in by default. So when you download install Web Space Server , You by default get localization support. FAQ 2.0 : In which languages Web Space Server is available ? Web Space Server is localized out-of-box in 22 languages , out of which Sun provides localization support for Japanese (ja) and Simplified Chinese (zh_CN). Remaining languages are community driven
FAQ 4.0 : Can I add new Language ? Yes ,Web Space Server is Internationalized. Allow you to add new languages which is not shipped out of box. Refer Localization section of Admin Guide for exact steps of how to do the same. FAQ 5.0 : Where I can get more information about Localization ? Refer Localization section of Admin Guide
FAQ 6.0 : If you have Ask Me :-) ...
Beginning ... Focus ... Success ... Beginning ............ (Life goes on ) Posted at 01:18AM Feb 12, 2009 by Mahipalsinh Rana in Personal | Comments[2]
Monday Dec 22, 2008
How to configure WebSynergy/Liferay on MySQL for UTF-8
Recently I was using WebSynergy with default database (HSQL in memory) and all my localized data were just doing fine. Happily making trip to UI to Database and vice versa. Then when I switch my database to MySQL , everything went haywire , Data turned in to ??? (okie let me be clear , when Data turns to ??? its mostly case of wrong encoding). It was small challenge for me to get it right on MySQL. Challenge is Challenge. I have explored on MySQL side and found that , it very easy to create database which can handle UTF-8 character (by default it comes in ASCII). so create database to handle WebSynergy data with UTF-8 encoding. CREATE DATABASE mydb DEFAULT CHARACTER SET utf8; :-) .. am I done .. I did a check but situation refuse to change .. there was something else also needs to be done. To call it done. Database is in UTF-8 but communication between Portal and Database was not in UTF-8. How to enable that? I have found a simple straight way. Add following two properties to "LiferayPool" and "JIRAPool". useUnicode=true
.. are we done .. Yes , we are done. Enjoy the advantages of MySQL with WebSynergy in language you want to communicate. "No Problem is small problem until you know the solution"
Posted at 03:54PM Dec 22, 2008 by Mahipalsinh Rana in Personal | Comments[0]
Wednesday Aug 13, 2008
One resource bundle per One Application - I18n and L10n will be easy
First what is with this some what mystry title. In simple words , I would like to highlight advantage of keeping only one resource bundle( aka. one property file which contains all the localizable messages) per One Application. Source of insipiration was Liferay. Let me give you more idea of how it will look like. 1) Make sure all your translatable strings are put on one property file ex. Language.properties This
will help to your customer who might want to add new langauge or want
to add new strings to existing language or change strings to existing
langauge. Easy to find where to do localization. 2) Organized it well . Define a rule to write key name. ex. first_name=First Name account_number=Account Number This will help to easily find of what this key represents in localized bundle. 3) Keep it in Alphabetical order This will ensure that duplicate properties does not exists in your bundle. 4) Now you can keep common utility class which will load the bundle based on Locale user wanted This will help all your other class as they do not need to bother about loading bundle. They can focus on solving business logic (that's where money comes from) Last but not the least ... Innovation is mother of all invension ... so innovate whether it is necessasity or not :-) ...Posted at 01:53PM Aug 13, 2008 by Mahipalsinh Rana in Personal | Comments[0]
Thursday Aug 07, 2008
Hibernate - POJO and HBM file creation best practice
Recently I was working on Hibernate and created a number of POJO and their corresponding hbm file. I am using Netbeans (who has support for Hibernate plugin , real helpful , http://netbeans.org ) Certain best practice I would like to make work more interesting.
ex. Create new Java Class i.e Person , Use hibernate plugin to create .hbm file , Give same name as Class file , Select Person as class name on next screen. This will create .hbm file with name as Person , no need to provide table attribute. Hibernate will create table with same name. This aovides unnecessary complexities in distinguice table name and class name
Do no mention Column attribute while declaring <Property> in .hbm file. Hibernate will create column with same name.
Resources : More will follow as I learn more ... enjoy your life ... n keep doing innovation ... only way to survive ...Posted at 01:19PM Aug 07, 2008 by Mahipalsinh Rana in Personal | Comments[0]
Tuesday Jun 10, 2008
I18n of Junit Testcases
I always believe that Maximum I18n testing should be done before build release to QA. To do that I keep finding out various way to do more and more i18n testing during development. In that I stuck with this idea of creating Junit testcase for I18n testing. Then I relize it would be good to make Junit testcase itself I18n. So that input to Junit testcase can be non-english data. It will check the flow of non-english data in application. I have done that for one of module for my product. i.e Portal Server. ObjectiveI18n'ed JUnit test case input which will help in doing I18n testing in JUnit.How to do it?I18n input of Junit Test case
Exampleex. Let me give you example of one of CMS junit testcaseTestcase to create category. source : CategoryTest.java Before : testCategoryCreation{ String categoryName="TestCategoryCreation"; ...(code to test creation) ... } In this testcase category name "TestCategory" is hardcoded in java
program. I have removed this hardcoding and load this value from
Resource Bundle. Now : CategoryTest.java One new class variable needs to be added. ResourceBundle rb;
As shown above, resource bundle will be load once for Test program and it will be used by all the testcases within it. so now when developer run this testcases in english environment and it will work as it was previously. Now How to leverage this testcase for I18n testing. Base Testcase Program has to implement this Interface.
How to provide Localized value for TestcaseThen we need to create New Test program for language in which you want to do I18n testing which will have only one method selectLocale(). ex. "ja".CategoryJaTest extends CategoryTest { Now on whenever Junit framework will be executed. It will execute this test program also and since locale set to "ja" . Resource bundle for japanese will be loaded. which will be used to test all the tests of CategoryTest since it is extended by CategoryI18nTest. You can create Category<locale>Test java program , ResourceBundle(properties) file for all the language in which I18n testing needs to be done. (phir milenge ... (cu later))
Posted at 04:06PM Jun 10, 2008 by Mahipalsinh Rana in Personal | Comments[1]
Monday Jun 09, 2008
I18n Best practices for web application- Part 1
I have created clear and concise best practices list for making your application I18n'ed. General
JSP Prgoram
Resource Bundle
GUI
Logging
Database
JUnit Testcase
AJAXRefer AJAX I18n References
Posted at 02:44PM Jun 09, 2008 by Mahipalsinh Rana in Personal | Comments[0]
Wednesday Jan 30, 2008
I18n 360' testing approach at Step-IN 2008 Conference
Recently I had been to one of the most beautiful hotel aka. palace
in Bangalore. No marks for guessing its Leela Palace. My talk was on Internationalization(I18n) 360' testing approach , the concept which close to my heart and job. Its fresh , unique and quick at results. Implemented in Portal Server 7.2 aka.OpenPortal development. My topic was selected for Pre-conference tutorial , A long 210 minutes( 3 hours and 30 minutes). It was indeed long time to stand , deliver and interact but my passion toward the subject was a big help. Curiosity of delegates in terms of their questions regarding I18n , their day to day use cases , their business case has never made me felt that it was long. In fact I had to rush a bit in last stage of Presentation. Let move to what I shared there. It was started with Introduction of I18n world (I18n , L10n , G11n) which also covered all the basic terminologies like Character , Charset , Unicode , UTF-x , Glyph , Font , Locale. My audience was enjoying every bit of information as most of them were aware about I18n but this details made them realize what the hack it is. This session was resulted in lots of questions and interesting discussion. They allowed to move ahead with the promise that I will spend quality time after talk to share more of my understanding about I18n world. Next
session was regarding I18n 360' testing approach , which in simple
teams means involving I18n in every stage of product development ,
starting as early as product planning. How I18n play role in
Requirement phase , Design phase , Implementation phase and most
importantly QA phase. Even in documentation also I18n has role to play.
Usage of real time example and case study has made this session most
entertain one. If it got you curious enough here is the Presentation for you After
that I had shown them live demo of how to do i18n testing in stand
alone application and web application. This followed by demo of I18n
testing automation using Open Source automation tool Canoo. At last as
a common practice Question and Answers. Posted at 12:22PM Jan 30, 2008 by Mahipalsinh Rana in Personal | Comments[0] |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||