Internationalization + Customizing Labels and Descriptions

A place for users and developers of the Xataface to discuss and receive support.

Postby Scott » Fri Apr 06, 2007 1:58 am

hi people,

I just found out about Dataface and it seems pretty cool!

I read this about setting custom field names to be output: http://framework.weblite.ca/documentation/tutorial/getting_started/customizing

So now I am wondering how I can efficiently set the field names/labels that are going to be generated when I have a multi-language database structure. Does dataface retrieve the custom field caption from a specific fields.ini according to the set language?

any input on this is much appreciated
Scott
 
Posts: 30
Joined: Wed Dec 31, 1969 5:00 pm

Postby shannah » Fri Apr 06, 2007 9:21 am

Hi Raymond,

This will be a feature in the next version of dataface (it's already done, but haven't released it yet).Ê The way it will work is you can set labels and descriptions in your language .ini files (en.ini, fr.ini, etc..) by following naming conventions for the keys.

e.g.

in the en.ini

tables.%tablename%.fields.%fieldname%.widget.label = "My English Label"
tables.%tablename%.fields.%fieldname%.widget.description = "My English description"

in the fr.ini file:

tables.%tablename%.fields.%fieldname%.widget.label = "My French Label"

tables.%tablename%.fields.%fieldname%.widget.description = "My English description"

I was going to wait until some of the translations were finished to release this next version of dataface - but I suppose I could get you a pre-release if you need this feature right now.

-Steve

--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby Scott » Fri Apr 06, 2007 9:56 am

thanks for replying (but i'm not Raymond though :)

cool that this feature will be released eventually!
i posted the above question before even getting hands-on with dataface just because int.features are rather important imho.
i have no problem waiting for the next dataface release, but thanks for offering to pre-release it anyway.

cheers, Scott.
Scott
 
Posts: 30
Joined: Wed Dec 31, 1969 5:00 pm

Postby shannah » Fri Apr 06, 2007 3:40 pm

Sorry, Scott.. I was replying to multiple posts at the same time and got the names mixed up..

-Steve

--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby Scott » Sat Apr 07, 2007 1:33 am

No problem :)

By the way, one more thing about translations inside the ini files.

Some languages have non latin letters (like Cyrillic, Greek, Hebrew, Arabic, Chinese, and so on) but ini files are plain ascii text right?
So will ini files that contain those tricky translations have to be saved as utf8 text and will Dataface be able to handle them?
Scott
 
Posts: 30
Joined: Wed Dec 31, 1969 5:00 pm

Postby shannah » Sat Apr 07, 2007 8:56 am

Hi Scott,

Yes.. In fact when running dataface with multiple languages you should save all of the language ini files in UTF-8 format.Ê I have set up a number of sites with a Chinese translation, and encoding issues were up front and centre for these.

Best regards

Steve
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby Scott » Sat Apr 07, 2007 11:39 am

thanks Steve
Scott
 
Posts: 30
Joined: Wed Dec 31, 1969 5:00 pm

Postby ivbo » Tue Apr 10, 2007 5:23 am

With UTF-8 format I discovered following issue for delegate class files:

When I used delegate class in UTF-8 format I received the following error:

Warning: Cannot modify header information - headers already sent by (output started at C:\foss\fas.sfu.ca\mytables\tables\company\company.php:1) in c:\foss\fas.sfu.ca\dataface-0.6.13r4\actions\edit.php on line 167

When I saved the delegate class in ANSI format it works right.

Best regards

Ivan
ivbo
 
Posts: 6
Joined: Wed Dec 31, 1969 5:00 pm

Postby shannah » Tue Apr 10, 2007 7:07 am

Hi Ivan,

Thanks for clarifying this.Ê PHP has problems with UTF-8.Ê All PHP files should be saved in Latin-1 format (the standard format).ÊÊ Your INI files may be saved in UTF-8 format.Ê In general, any INI file that contains special characters (characters with accents, chinese characters, etc..) should be saved in UTF-8 format.

But all PHP files need to be in Latin-1 format.

PHP is not the friendliest language towards unicode, but with a little massaging, it will still work.


Best regards


Steve

--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby Scott » Tue Apr 10, 2007 1:05 pm

Ivan,
Im very curious what your delegate class looks like because that error message is pretty weird.

The only problem i had was that i had added to conf.ini:

oe=UTF-8
ie=UTF-8

instead of

default_oe=UTF-8
default_ie=UTF-8

@Steve, maybe u wanna check the docs: http://framework.weblite.ca/documentation/manual/conf_ini/global-properties/ie (also oe)

So what i successfully managed to do after my testapps html encoding was indeed utf8 (check source in browser):

1. get chinese utf8 encoded characters from ini file into the dataface html output:
-> ini file needs to be saved as utf8
2. get chinese utf8 encoded characters from php delegate class code into the dataface html output
-> i just saved my delegate class php file (with the special characters in it) as utf8. worked fine for me!
3. get chinese utf8 encoded characters from dataface html input into the database and back out again into the html
-> table collation needs to be utf8_unicode_ci

So dataface is pretty cool, internationalization works practically out of the box!
I just have not tried to setup my testapp with the extra translation tables in the database yet but will do so soon.

Scott.
Scott
 
Posts: 30
Joined: Wed Dec 31, 1969 5:00 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 29 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved