Internationalization - I18N in Servoy 6.x

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

Internationalization - I18N in Servoy 6.x

Postby ayadav1 » Mon Apr 17, 2017 2:15 pm

Hi,

I want to integrate Internationalization - I18N to enable multi language feature in my current application.
Can anyone tell me that how many hours will take to implement for one screen (standard)?

I have no idea about implementation of Internationalization - I18N in Servoy application.

Thanks,
Abhishek
ayadav1
 
Posts: 21
Joined: Thu Oct 20, 2016 2:40 pm

Re: Internationalization - I18N in Servoy 6.x

Postby mboegem » Mon Apr 17, 2017 11:29 pm

Hi Abhishek,

I've been using i18n for many years.
The best approach is to integrate i18n right from the start, but I believe this is not your case.

You're request is an estimation of time to change just 1 form, which is still hard to give as there are multiple areas to take into account.
1) number of languages you want to add?
2) how many labels per form?
3) do you use valuelists (and have a proper return value)?
4) do you display values from tables which should also be translated?

Basic implementation is not that hard though.
Just create the i18n table and start creating entries.
Then replace your current label text property values with the i18n key.

There are ways to automate retrieving all the text properties from labels, convert these into records in your i18n table, replace the current text property value and write the DB content back into your workspace.
This is just 1 part of the implementation (point 2 from my list), but nice to have this done fairly fast.

Hope this will help you a bit.
Marc Boegem
Solutiative / JBS Group, Partner
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance Developer

Image

Partner of Tower - The most powerful Git client for Mac and Windows
User avatar
mboegem
 
Posts: 1743
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam

Re: Internationalization - I18N in Servoy 6.x

Postby Bernd.N » Mon Apr 17, 2017 11:38 pm

It is actually very simple, it will not take much time.
The main idea is that you write something like "i18n:xxx.com_name" instead of "Company Name" into the text property of a label that stands in front of a field that holds a company name.
xxx is a shortcut for your project, so that you have an own name space with that prefix.

I would choose only one character as a prefix, so that you can type those i18n codes as fast as possible.
I also found it very comfortable to have unique names for all fields (with a prefix like com_ for all fields in a table 'companies') and then write the label exactly like the field name, as in the example above.

Did you already have a look at the Servoy wiki?
https://wiki.servoy.com/display/public/DOCS/Internationalization+-+I18N

In the Servoy menu "Actions/Show i18n dialog" you can create the i18n keys.
We do it totally different, however, by creating the i18n file ourselves from our own dictionary which holds all fields of all tables (keeping that in sync to the tables is a bit of a challenge...).
After doing so, we start Servoy new so that it will read our freshly created i18n keys.

The i18n files can be found in the ressources\messages folder of your workspace, like this.
The main i18n file holds the default translation which is usually English
res.png
res.png (28.01 KiB) Viewed 2485 times


The format of those files is simple, Example (our prefix is 'bob'):
Code: Select all
bob.bp_is_freelancer=Freelancer
bob.bp_is_imported_record=Imported Record
bob.bp_is_reference_customer=Reference Customer
bob.bp_key_account_id=Key Account
bob.bp_key_account_manager_id=Key Account Manager
bob.bp_last_customer_invoice=Last Customer Invoice
bob.bp_last_customer_order=Last Order
bob.bp_last_purchase_order=Last Purchase Order
Bernd Korthaus
LinkedIn
Servoy 7.4.9 SC postgreSQL 9.4.11 Windows 10 Pro
User avatar
Bernd.N
 
Posts: 544
Joined: Mon Oct 21, 2013 5:57 pm
Location: Langenhorn, North Friesland, Germany


Return to Programming with Servoy

Who is online

Users browsing this forum: No registered users and 8 guests