Monday, June 13, 2011

Internationalization in PHP


Our current game plan with First EMT is to build a Javascript and PHP web application so I've been looking at ways to do internationalization in PHP. If you're writing code that needs to be accessible in many different languages, internationalization is a must. Instead of hard coding text you create a variable for every body of text in your interface. Then you store translation files for every language your UI must support. By changing your locale variable you can quickly and easily switch the language your UI displays. If you make the translation files human readable it is also very easy to add new languages by simply hiring a professional translator for a few hours of work.

My first searches seemed fruitful... I found this documentation describing Resource Bundles. It seemed great until I noticed it was under the header "Future Directions". I'm a fairly proficient programmer but I'm certainly not ready to write a patch to PHP... time to look at other options...

The best option I've found so far is called Zend_Translate. Zend's translate framework is really flexible. You can provide something as basic as arrays of words to translate or as complex as importing a Translation Memory file and dynamically translating everything. For my purposes I think I'm going to use the TMX adapter. TMX is an extension of XML and it's an industry standard for this sort of application. It can be modified in any XML editor which makes it very easy to add new translations. An example TMX file would be something like:


  1. <?xml version="1.0" ?>
  2. <!DOCTYPE tmx SYSTEM "tmx14.dtd">
  3. <tmx version="1.4">
  4. <header creationtoolversion="1.0.0" datatype="winres"segtype="sentence"
  5.         adminlang="en-us" srclang="de-at" o-tmf="abc"
  6.         creationtool="XYZTool" >
  7. </header>
  8. <body>
  9. <tu tuid='message1'>
  10. <tuv xml:lang="de"><seg>Nachricht1</seg></tuv>
  11. <tuv xml:lang="en"><seg>message1</seg></tuv>
  12. </tu>
  13. <tu tuid='message2'>
  14. <tuv xml:lang="de"><seg>Nachricht2</seg></tuv>
  15. <tuv xml:lang="en"><seg>message2</seg></tuv>
  16. </tu>
  17. </body>
  18. </tmx>


This example is straight from the Zend Framework website.

Wednesday, June 8, 2011

Research

Starting to find some good articles to use for our project and the paper later on in the summer. I'm going to aggregate them here for my own use :-P

These articles will be good for pointing out the existence of language barriers and the problems they cause in the medical profession:

Lost in translation? pediatric preventive care and language barriers
http://www.sciencedirect.com/science/article/pii/S0022347605011194


Language barriers and the use of interpreters in the public health services. A questionnaire-based survey
http://www.sciencedirect.com/science/article/pii/S0738399110002697

One of the ideas we've been throwing around was a what-if scenario where ambulances could have a 3G connection and send information from the tablet to the hospital before the patient arrives. It turns out this has already been an idea.

http://v-scheiner.brunel.ac.uk/bitstream/2438/2430/1/Ambulance%203G.pdf

We'll have to see if the Rochester area ambulances have 3G connections.

I am also interested in the translation aspect of the project. I want to make sure whatever translation we're using will be correct. Often times machine translation will have errors. This is obviously unacceptable for medical practice. We may need to look at simply providing hard-coded translation for the forms and leave MT for the open ended, less-important questions.

open source translation: http://www.apertium.org/

Tuesday, June 7, 2011

First EMT

So I'm doing research again this summer. This time around I'm working on First EMT. First Encounter Medical Translator will be an EMT assistant providing several multilingual or language independent tools for first responders. I'm going to be working with my buddy JT throughout the summer. You can follow his blog here: http://www.jtmengel.com.

Medical professionals today run into problems with patients who do not speak English. Obviously they must help these people but communication can be very difficult. We're going to design a tablet-based system that will allow first responders to gather data in a number of different languages. It will also have a diagram of a person where a patient can zoom in and let an EMT know where they're injured. We may also add a page where an EMT can pull up common questions in several different languages so they can verbally ask things like "who is your primary doctor?" or "do you have any allergies?".

This first week we will be writing up the design documents and figuring out exactly what our user experience is going to be. I'm also going to be researching options for translation since Google is dropping their translation API (link). Moses looks like a good alternative. I'll be posting more information on it as I learn more.

I'm very excited about this project and can't wait to get cracking hacking.

Tuesday, February 1, 2011

Rochester GREAT Student Achievement Award

So Justin, Fran, and I received a Rochester GREAT Student Achievement Award tonight for our work with Open Video Chat. Thanks to Remy DeCausemaker and Steven Jacobs for making this possible. Special thanks to our project advisors Luke Macken and Mel Chua :D


p.s. Sorry about the squinty face, I can't deal with camera flash :(

Friday, January 28, 2011

PHP: SUCCESS!

I've got an upload form working on the Rock Climbing Club staging server. As soon as I get the time I'll create and populate a database on the production server and push this live! Now officers will be able to upload photos with the click of a button. Next I want to look at possibly moving to a Flickr API or, if that fails, write a graphical interface with delete functionality. If you haven't yet, check out the club's website! http://www.rit.edu/rocks/ Now with 100% faster picture uploads!

Monday, January 24, 2011

PHP mini-project Update

I hit a small roadblock this weekend trying to get file uploading to work. That plus my AI homework really slowed down the project. I'm still banging away at it. Today I managed to get uploads to the web server. Next steps: Get the uploads to the right place. Password protect it! (O_O) Then I'm going to get the app pushing information to a database. From there I'll get the front page of the website reading information from that database.

Thursday, January 20, 2011

PHP: Photo Hero Project

So I'm the webmaster of the RIT Rock Climbing Club. What this basically means as far as the club is concerned is that I'm the only one that knows what a terminal window is. I figure since I know a thing or two more than that I should write some code to help future members of the club. So here's my idea:

Right now the club's front page has a slideshow of club members doing club-y stuff.(link) The members of the club wish to be able to change the images in the slideshow from time to time. Right now the current system is for them to send me an image. I crop the image to the right resolution and send it server side using sftp. Then I have to modify the index.php file to include the new image + alt text. The final step is using RIT's web manager to push everything to the production server. This is all really basic and easy since I program. However in the future the club might not have a programmer available to do this.

My goal this weekend is to create a web interface for uploading and deleting images from the slide show. This should allow club admins to easily modify the front page of the website.

Goals:

  • Simple web interface to upload and delete images from the server
  • RIT LDAP authentication using a database of admin user names
  • Database storing image location on server + image information (photographer, alt text, etc)
  • modified index.php with generic data structure filled with info from the database
I only have passing knowledge of both PHP and SQL so this whole project should be rather interesting. I don't think it's going to be incredibly hard. Most of the work should be researching how to do the things I want in PHP.

Useful links: