[Tutor] Why difference between printing string & typing its object reference at the prompt?

Dwight Hutto dwightdhutto at gmail.com
Thu Oct 11 03:58:39 CEST 2012

If your app has  a standard usage of phrases, you can place a file in
that translates a tag into a particular language phrase.

if submit_tag_selection == 'english':
     submit = 'Submit'
if submit_tag_selection == 'english':
     submit = 'Soumettre'

Of course this could be done without the if, you would just translate
the normal selections within a file with the commonly used phrases in
the app, and substitute it within a parse for:

x = open('translate_file_french', 'r')
for line in x:
     if line.split('=')[0] == 'Submit':
           print '%s'   %   (line.split('=')[1])


*Untested, but should work

Best Regards,
David Hutto
CEO: http://www.hitwebdevelopment.com

More information about the Tutor mailing list