Internationalization + Customizing Labels and Descriptions
10 posts
• Page 1 of 1
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
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" in the fr.ini file: tables.%tablename%.fields.%fieldname%.widget.label = "My French Label" 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
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.
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?
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
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
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
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.
10 posts
• Page 1 of 1
Who is onlineUsers browsing this forum: No registered users and 18 guests |