Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 08-01-2010, 08:33 AM T_ (what is this?)
Lashtal's Avatar
wherenomanhasgonebefore

Posts: 680
Name: Lashtal
Trades: 0
saw it used in a script, searched for it on php.net and found nothing.

Maybe someone here knows?
__________________
Currently Reading:
Please login or register to view this content. Registration is FREE
Lashtal is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-01-2010, 08:53 AM Re: T_ (what is this?)
Knight13's Avatar
Defies a Status

Posts: 10,289
Name: Knight13
Location: Cleveland, Ohio
Trades: 0
Looks like the letter T with an underscore.
Knight13 is offline
Reply With Quote
View Public Profile
 
Old 08-01-2010, 09:31 AM Re: T_ (what is this?)
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
What do you mean by "used in a script"? It is a valid function name, but it isn't a built in function.

A lot of syntax errors begin with T_ such as unexpected T_IF or unexpected T_VARIABLE.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Last edited by NullPointer; 08-01-2010 at 09:32 AM..
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 08-01-2010, 09:37 PM Re: T_ (what is this?)
Lashtal's Avatar
wherenomanhasgonebefore

Posts: 680
Name: Lashtal
Trades: 0
Quote:
Originally Posted by NullPointer View Post
What do you mean by "used in a script"?
alright, that is pretty ambiguous lol

Quote:
Originally Posted by NullPointer View Post
A lot of syntax errors begin with T_ such as unexpected T_IF or unexpected T_VARIABLE.
Yeah, exactly. But it's not being output in the form of an error message; it's being used throughout the script (like you noted) As A Function, yet, I didn't find it anywhere on php.net as a built-in function; so I assumed it must've been defined by the script's author, somewhere else in that script. (that I have yet to find)

Just wanted to make sure I wasn't missing that it was a built in function that I wasn't familiar with.


Looks like i'll keep searching the relevant include files until I figure it out.
__________________
Currently Reading:
Please login or register to view this content. Registration is FREE
Lashtal is offline
Reply With Quote
View Public Profile
 
Old 08-08-2010, 05:33 PM Re: T_ (what is this?)
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
Might want to do a search on the files for "function T_" or find all occurrences of "T_" or "T_=" or "T_ ="
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 08-08-2010, 10:42 PM Re: T_ (what is this?)
Lashtal's Avatar
wherenomanhasgonebefore

Posts: 680
Name: Lashtal
Trades: 0
I'd just figured out a few days ago that the author was using T_ as:

T_('Put any kind of text you want here'), in conjunction with get-text, which serves as a general translator.

---

so, if your default language was English and the code snippet looked thus:

Code:
T_('How is the weather today?')
it would be displayed as:
Code:
 
T_('Wie ist das wetter huete?')
after selecting the german language file (provided, of course, that there is actually a german language file to choose from)

.
.
.

This is my first time encountering get-text.

Myself personally, I favour the way i've seen this same thing done in just about every script i've ever seen...

You have a lang file for each language, and instead of writing something like: T_('How is the weather today?')

you just call a variable like: $weather_greeting

which is referenced in a (selected) lang file.

.
.
.

This is, however, what get-text does. Except, with get-text, there is a bit too much code being written to handle such a simple task. The "saving" point, if we can call it that- is that it stores all of these values in a .MO file- which is great for execution speed.

However, the cache-22 on this is that; for something this simple, it's really not necessary at all to look forward to this .MO file's execution speed when you can just make a simple variable call to a generic lang file.
__________________
Currently Reading:
Please login or register to view this content. Registration is FREE

Last edited by Lashtal; 08-08-2010 at 10:52 PM..
Lashtal is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to T_ (what is this?)
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.33426 seconds with 12 queries