All page names need to be in English.
en da  de  fr  it  ja  km  nl  ru  zh


From TYPO3Wiki
Jump to navigation Jump to search
This page belongs to the Hardcoded project (category Project)

error - This page is a candidate for deletion

Reason: outdated work in progress document

If you disagree with its deletion, please explain why at Category talk:Candidates for speedy deletion or improve the page and remove the {{delete}} tag.

This notice should remain for a minimum of 1 week after it was placed on the page. If a discussion is still ongoing, it should remain until a consensus is reached or a decision has been made about the removal, after which the page will either be deleted or this notice removed.

Remember to check what links here and the the page history before deleting.

Hardcoded labels

notice - Note

You found hardcoded texts in TYPO3?
Then add them here, please!

There are still many hardcoded labels. Have a look at this document to see which we mean.

If you found any hardcoded labels, please add them there!

If you want to help translating labels (which are no longer hardcoded) to your language, go here.

Current Project Members

  • Stefano Kowalke

What we do

TYPO3 uses quite a number of texts:

All texts you see in the backend are coded somewhere. Everything comes from a file in the sourcecode.

There are two possibilities for this to work:

The texts can either be hardcoded in a php-file or they can come from a special language-file:

Hardcoded text

Hardcoded text is written directly in a php-file:


$content = 'Upload Image<br/>';



This text is always displayed as you see it above. There is no chance to change it (except changing it in the source-code - not the ideal way).

Because it cannot be changed that easily, we call this text hardcoded.

The big disadvantage is, that the text cannot be localized, if it is hardcoded.

Translatable text

Text, which can be translated, comes from a special language-file (so-called locallang-file), which contains the texts in the language the user has chosen.

The code above would then look like the following:


$content = $GLOBALS['LANG']->getLL('uploadImage') . '<br/>';



As you can see, the text which was hardcoded before has now been replaced by a call to $GLOBALS['LANG']. The label which is used is the one named uploadImage.

Here TYPO3 takes the text which should be displayed from a special language-file. These files look like the following:

<?xml version="1.0" encoding="utf-8" standalone="yes" ?>


        <meta type="array">

                <description>TYPO3 Element Browser labels.</description>



        <data type="array">

                <languageKey index="default" type="array">

                        <label index="removeLink">Remove link</label>

                        <label index="uploadImage">Upload Image</label>

                        <label index="update">Update</label>




These files each contain a number of labels (e.g. our "uploadImage"). As you see these labels are still in English. But they can be translated easily using the translation-server, a server which is there just to translate TYPO3.

If a TYPO3-user updates his translations afterwards, he will get the newest version of the translated texts.

The big advantage is, that no longer the hardcoded English, but always the language, which the user has chosen, will be used.

This is why we change hardcoded texts to texts which are inserted using $GLOBALS['LANG'].