Current location: Hot Scripts Forums » Programming Languages » PHP » Question on language files


Question on language files

Reply
  #1 (permalink)  
Old 11-07-03, 08:45 AM
rozojc rozojc is offline
Newbie Coder
 
Join Date: Nov 2003
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Question on language files

Hi everyone,

Does anyone know if there is some kind of software (Either in PHP or in any other) that can take PHP files, search for the texts that are not part of any tags of code, replace them with <?=$someVariable;?> and meanwhile automatically create a language file for the script?

That way, if we had an old series of scripts lying around that we never made with language files, we could run this application and have the script modified for use with a language file, and a language file automatically created...

Thanks,

Juan Camilo
rozo@saryon.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 11-07-03, 02:07 PM
NeverMind's Avatar
NeverMind NeverMind is offline
Community VIP
 
Join Date: Aug 2003
Location: K.S.A
Posts: 2,257
Thanks: 0
Thanked 2 Times in 1 Post
I got your idea but what do you mean by : "for the texts that are not part of any tags of code" ?
some php files only contains pure php ..
__________________
PHPSimplicity
We don't need a reason to help people - Zidane [FF9]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 11-07-03, 02:46 PM
rozojc rozojc is offline
Newbie Coder
 
Join Date: Nov 2003
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by NeverMind
I got your idea but what do you mean by : "for the texts that are not part of any tags of code" ?
some php files only contains pure php ..
Well, I mean that if in some part of the php I have something like:

<tr id="myId">
<td>Hi there</td>
</tr>

Then the script would take only the "Hi there" string, as the "myId" is part of the tag called "id". Then, he would replace the code for something like
<tr id="myId">
<td><?=$message[0];?></td>
</tr>

And meanwhile, he would create a language file that would be something like:
<?
$message[0]="Hi there";
?>

So one would just run this script over a complete web site , etc., and it would automatically do the job...

Does that exist?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 11-08-03, 04:09 AM
Stefan's Avatar
Stefan Stefan is offline
Junior Code Guru
 
Join Date: Jun 2003
Location: Utrecht, The Netherlands
Posts: 599
Thanks: 0
Thanked 0 Times in 0 Posts
ok, this is purely theoretic, but here's what I just thought of:

you read the content of an html file into a variable, then use strip_tags() to strip all html from that file. what is left is all the "language" you are using. then you could take that, and use regular expressions to change all the entries of that "language" into variables.

but, as I said, this is purely theoretic, I've never tried this.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 11-08-03, 08:40 AM
rozojc rozojc is offline
Newbie Coder
 
Join Date: Nov 2003
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Re:

Quote:
Originally Posted by Stefan
ok, this is purely theoretic, but here's what I just thought of:

you read the content of an html file into a variable, then use strip_tags() to strip all html from that file. what is left is all the "language" you are using. then you could take that, and use regular expressions to change all the entries of that "language" into variables.

but, as I said, this is purely theoretic, I've never tried this.
Could work, has ane1 here done this?

Does it sound stupid what I'm looking for, or does anybody else think it could be useful?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Automated script to delete certain files shib_s Script Requests 3 08-03-06 06:28 PM
How to <!--include .htm files in .php files cstallins PHP 4 10-27-03 06:35 AM
Admin files of my program darkcarnival Website Reviews 8 09-17-03 02:07 PM
Digitally 'watermark' files Safrane PHP 4 09-08-03 10:02 AM
Creating directories and files cobalto2060 PHP 1 08-17-03 04:20 PM


All times are GMT -5. The time now is 10:23 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.