Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old May 24th, 2008, 5:12 PM   #1
Logical1
Programmer
 
Logical1's Avatar
 
Join Date: Apr 2008
Posts: 47
Rep Power: 0 Logical1 is on a distinguished road
Question Working in a second or third language

I am working on a project of my own and would like to add other labgauges to it after I finished with English (Chinese, German, Spanish,....).
What is the most logical way to go about it in yur opinion?
Natrually I can copy the entire set of files and replace all the words from inEglish with the words with the other langaues, but there has to be a more professional way to do this.
Any ideas?
Thansk in advance
Logical 1
__________________
^c^
Logical1 is offline   Reply With Quote
Old May 24th, 2008, 8:55 PM   #2
Apophis
Newbie
 
Join Date: Apr 2008
Posts: 16
Rep Power: 0 Apophis is on a distinguished road
Re: Working in a second or third language

you could use something like babel fish (http://babelfish.yahoo.com/) on your website. but i dont know how you would be able to doit any other way than that
Apophis is offline   Reply With Quote
Old May 24th, 2008, 9:20 PM   #3
Jimbo
Battle Programmer
 
Jimbo's Avatar
 
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 763
Rep Power: 3 Jimbo is on a distinguished road
Re: Working in a second or third language

I'd google around for PHP localization or PHP internationalization. There's probably some sort of framework for this. Alternatively, you could try to create your own, but that'd be a chunk of work.
__________________
<insert disclaimer here>
<insert shameless plug for Visual Studio here>
Jimbo is offline   Reply With Quote
Old May 24th, 2008, 9:59 PM   #4
Logical1
Programmer
 
Logical1's Avatar
 
Join Date: Apr 2008
Posts: 47
Rep Power: 0 Logical1 is on a distinguished road
Maybe I did not explain well

May be I did not explain the problem well.
I have text in english in different pages. Forms for example such as:

Name:
Date:
Company:
Blabla:


In the corresponding french site they have to be:

Nom:
Date:
Compagne:
Blablainfrench:

I don't want to copy the file and go line by line replace with the translation. This way every time I have to make an update I have to work it twice.
I am trying to find another better more professional solution.
Any suggestions?
__________________
^c^
Logical1 is offline   Reply With Quote
Old May 24th, 2008, 11:52 PM   #5
Jabo
Not a user?
 
Join Date: Sep 2007
Posts: 272
Rep Power: 2 Jabo is on a distinguished road
Re: Working in a second or third language

A more professional solution? Collaborate with a foreign programmer.
Jabo is offline   Reply With Quote
Old May 25th, 2008, 12:00 AM   #6
Jimbo
Battle Programmer
 
Jimbo's Avatar
 
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 763
Rep Power: 3 Jimbo is on a distinguished road
Re: Working in a second or third language

Logical1, I know what you're aiming for. I don't know what PHP has to offer, and frankly I'm not interested in finding out, but there's probably a framework that allows you to internationalize or localize your app (terminology varies). For instance, in ASP.NET allows you to define resource strings, which are automatically loaded when the user's locale is set to a specific language. Such a framework might look something like this (though really, I'm just doing a mockup; and forgive me if my PHP isn't quite right, I don't use it anymore):

Your web code might look like:
php Syntax (Toggle Plain Text)
  1. <table>
  2. <tr>
  3. <td><?php echo LoadResource("NameString"); ?></td>
  4. <td><input type="text" ... ></td>
  5. </tr>
  6. <tr>
  7. <td><?php echo LoadResource("DateString"); ?></td>
  8. </tr>
  9. ...
And then you might have one or more resource files:
xml Syntax (Toggle Plain Text)
  1. <xml ...>
  2. <Resources>
  3. <resourceSet locale="en-US">
  4. <resource>
  5. <key>NameString</key>
  6. <value>Name</value>
  7. </resource>
  8. <resource>
  9. <key>DateString</key>
  10. <value>Date</key>
  11. </resource>
  12. </resourceSet>
  13. <resourceSet locale="fr-FR">
  14. <resource>
  15. <key>NameString</key>
  16. <value>Nom</value>
  17. </resource>
  18. <resource>
  19. <key>DateString</key>
  20. <value>Date</value>
  21. </resource>
  22. </resourceSet>
  23. </Resources>

Like I said, it's just a mockup of what such a framework might look like. You'll have to look around and see what's available.
__________________
<insert disclaimer here>
<insert shameless plug for Visual Studio here>
Jimbo is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
If you had it to do all over again, which language? peace_of_mind Coder's Corner Lounge 24 Jan 13th, 2008 5:06 PM
Assembly Language DaWei Coder's Corner Lounge 0 Apr 26th, 2007 10:15 PM
Which Programming Language You Use The Most? Soulstorm Coder's Corner Lounge 19 Apr 6th, 2007 10:29 PM
Language creation/extending gryfang Project Ideas 43 Jul 20th, 2006 1:42 PM
Language display in program Prm753 C++ 3 May 30th, 2006 5:45 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 1:16 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC