News:

Wondering if this will always be free?  See why free is better.

Main Menu

Converting all hardcoded text to text strings?

Started by OverlordPD, August 15, 2011, 03:03:13 PM

Previous topic - Next topic

OverlordPD

I tried to find guide for this but I didn't find it....can someone give me URL of that tutorial,please?

IchBin™

Are you trying to follow the mod guidelines? Would help if you were a little more specific about what you're trying to do...

Hard coded text is when you put text right in the middle of your HTML. To fix this you simply need to assign that text to a variable in the language file.

For example:
echo '<h1>Hello IchBin</h1>';

The above example has the text inside the HTML. To fix this you put an entry in the Modification.english.php file.

$txt['hello_ichbin'] = 'Hello IchBin';

The variable can be named whatever you would like.

Then change your code to say this:
echo '<h1>' , $txt['hello_ichbin'] , '</h1>';

This way everyone can translate your text strings to be in their own langauage without modifying the code in the sources and templates.
IchBin™        TinyPortal

OverlordPD


Advertisement: