Wednesday, April 6, 2011

Localizing WSO2 Carbon based products

WSO2 Middleware Products and Services
WSO2 Carbon, is by design, an internationalized (i18n) platform, hence making all the products and services that are built on top of Carbon ready to be localized to any language of your choice. Users have shown interest and have also localized WSO2 products in Chinese, Sinhala, and some other languages to a considerable extent.

Componentized Architecture
WSO2 Carbon with its modular architecture, is made of components. You can either build the Carbon core and pick whatever the components you need and integrate them into your Carbon build, making a customized product of your choice, or you can simply pick on of the products, let it be Appserver, ESB, Mashup Server, from the list of products and build it from the profiles, as we have products well packed for the need of a software architect.

Getting the Product/Service
Now you have two choices, based on your requirements. If you are going to just use the WSO2 products, you can simply download and use the  binaries or download the released sources for the respective product and build the product using Maven, if you are a fan of building from the code.  But you may prefer to build WSO2 Products from the source repositories (svn) as well, if you want to build customized products, learn the complex code base of WSO2 Carbon, extend WSO2 Carbon or Stratos (WSO2 Carbon Platform Middleware as a Service), have the desire to use the technology in its bleeding edge, or OEM WSO2 products where you can get the commercial support from the WSO2 experts for your organization.

Localization ~ From the source
Now let's come to the localization. Say you want to use a WSO2 Product with the user interface in your language. For that, you have to localize the Resources.properties and JSResources.properties files in locations like carbon/components/stratos/tenant-mgt/org.wso2.carbon.tenant.mgt.ui/src/main/resources/org/wso2/carbon/tenant/mgt/ui/i18n, when coming to localize the source, even before building.

Localization ~Not a mere dream
But obviously what users choose is to localize the product binaries. Internationalization in WSO2 Carbon is done in such way so that by putting a single bundle, all text every where can be replaced. There is no manual work involved. If someone wants to introduce a new locale, just create a bundle containing all converted text, deploy & that's it.

eg: If you want to localize Component manager & User Manager to Spanish, here is what you need to do.

Create a OSGi bundle with following properties files in given folder hierarchy.

src/main/resources/org/wso2/carbon/component/mgt/core/Resources_es.properties
src/main/resources/org/wso2/carbon/userstore/ui/i18n/Resources_es.properties

Build the bundle & deploy feature. Now by changing the user interface language from the browser or system (based on your operating system), you should be able to see Carbon running in the chosen language.

And, if you need to localize every text, you just put all the resource files from every component into the above bundle. By design, we have followed the correct packaging. Hence, resource file from one component will not get replaced with another.

After localizing the relevant .properties files (basically changing the value string from English to Spanish, in the key=string pair in the relevant files), start (or restart if it is already started) WSO2 Stratos Manager. You can see the WSO2 Stratos Manager running in the Spanish (or whatever the localized language) interface.

Image 1: Stratos Manager - Interface in Spanish
submit.tenant=Enviar Inquilino
domain=Dominio
domain.information=Inf. de dominio
contact.details=Datos de contacto
admin.username=Admin Usuario
current.admin.password=actual contraseña del administrador
new.admin.password=Nueva contraseña del administrador
new.admin.password.repeat=Nueva contraseña del administrador (Repetición)
admin.password=Contraseña del administrador
admin.password.repeat=Contraseña del administrador (Repetición)
govern.add_tenants.menu=Añadir un nuevo inquilino
govern.view_tenants.menu=Ver los inquilinos
overview=Información general
tenants.list=Lista de Inquilinos
company.organization=Empresa/Organización
admin.contact=Contacto Administrativo
edit=Editar
multitenancy=Multiusuario
added.successfully=Ha agregado un nuevo inquilino con el dominio:
updated.successfully=Ha actualizado correctamente el inquilino con el dominio:
update.added.tenant=Actualizar la acaba de agregar/inquilino actualizada
update.tenant=Actualizar Inquilino
add.new.tenant=Añadir un nuevo inquilino
register.new.organization=Crear una nueva organización
view.all.tenants=Ver todos los inquilinos
tenant.admin=Inquilino Admin
tenant.description=Descripción Inquilino
admin.fullname=Nombre completo
admin.firstname=Nombre
admin.lastname=Apellido
admin.address=Dirección
admin.email=Correo electrónico
admin.telephone=Teléfono
admin.im=IM
admin.url=URL
self.registration=Registro de Inquilinos
gaas=GaaS
gaas.register.a.new.tenant=Crear un nuevo inquilino
active=Activo
theme.management=Tema de Gestión
word.verification=Verificación de la palabra
captcha.message=Escriba los caracteres que ves en la imagen de abajo.

created.date=Fecha de creación

4 comments:

  1. Hi Kathiravelu.
    An excellent post.

    I want to know if this way to made WSO2 platform localized is still valid?

    If yes, can you send me the bundle you use to change WSO2 Stratos Manager to Spanish?

    Thanks a lot.

    ReplyDelete
  2. Hi Jorge,
    Yes, this is still valid.

    Since I moved to Lisbon for my higher studies last month, I don't have the files right now with me. But, if you ask over the dev list, or a personal mail to Sumedha - sumedha@wso2.com (he helped me in getting this done - so he should surely have the resources on this), you may be able to get the relevant resources.

    Have a great day there.
    Regards,
    Pradeeban.

    ReplyDelete
  3. You can localize apps and websites quite easily with the translation platform https://poeditor.com
    This is an online tool, designed to manage collaborative software localization projects.

    Commercial? Yes, but not for Open Source projects. :)

    ReplyDelete

You are welcome to provide your opinions in the comments. Spam comments and comments with random links will be deleted.