---
title: "TypoScript"
manual: "TYPO3 Explained"
version: "main"
permalink: "https://docs.typo3.org/permalink/t3coreapi:extension-localization-typoscript@main"
source: "ExtensionArchitecture/HowTo/Localization/TypoScript.rst"
rendered: "2026-09-21T11:24:09+00:00"
---

# TypoScript {#extension-localization-typoscript}

## Output localized strings with TypoScript {#extension-localization-typoscript-gettext}

The [getText property LLL](https://docs.typo3.org/m/typo3/reference-typoscript/main/en-us/Functions/Data.html#data-type-gettext-lll) can be
used to fetch translations from a translation file and output it
in the current language:

**EXT:site_package/Configuration/Sets/SitePackage/setup.typoscript**

```typoscript
lib.blogListTitle = TEXT
lib.blogListTitle {
  data = LLL : EXT:blog_example/Resources/Private/Language/locallang.xlf:blog.list
}

```

## TypoScript conditions based on the current language {#extension-localization-typoscript-conditions}

The condition function
[siteLanguage](https://docs.typo3.org/m/typo3/reference-typoscript/main/en-us/Conditions/Index.html#condition-functions-in-frontend-context-function-siteLanguage)
can be used to provide certain TypoScript configurations only for certain
languages. You can query for any property of the language in the
site configuration.

**EXT:site_package/Configuration/Sets/SitePackage/setup.typoscript**

```typoscript
lib.something = TEXT
[siteLanguage("locale") == "de_CH"]
  lib.something.value = This site has the locale "de_CH"
[END]
[siteLanguage("title") == "Italy"]
  lib.something.value = This site has the title "Italy"
[END]

```

## Changing localized terms using TypoScript {#localization-typoscript-local-lang}

> [!WARNING]
> **Attention**
>
> When localized strings are managed directly in TypoScript instead of `.xlf`
> files the translations are not exported with export tools to be send to
> translation agencies. The language strings in TypoScript might be
> overlooked when introducing future translations.

It is possible to override texts in the plugin configuration in
TypoScript.

See [TypoScript reference,
\_LOCAL_LANG](https://docs.typo3.org/m/typo3/reference-typoscript/main/en-us/TopLevelObjects/Plugin.html#setup-plugin-local-lang-lang-key-label-key).

If, for example, you want to use the text "Remarks" instead of the
text "Comments", you can overwrite the identifier
`comment_header` for the affected languages. For this, you can
add the following line to your TypoScript template:

**EXT:blog_example/Configuration/Sets/BlogExample/setup.typoscript**

```typoscript
plugin.tx_blogexample {
  _LOCAL_LANG {
    default.comment_header = Remarks
    de.comment_header = Bemerkungen
    zh.comment_header = 备注
  }
}

```

With this, you will overwrite the localization of the term
`comment_header` for the default language and the languages "de" and "zh"
in the blog example.

The `locallang.xlf` files of the extension do not need to be changed for
this.

> [!WARNING]
> **Attention**
>
> Setting `_LOCAL_LANG` might not work for the ViewHelper
> `<f:translate>` if used outside of the Extbase request.
> and the `extensionName` ViewHelper attribute is not set and the key used
> does not follow the `LLL:EXT:extensionkey` syntax.

Outside of an Extbase request TYPO3 tries to infer the the extension key
from the `extensionName` ViewHelper attribute or the language key
itself.

**Fictional root template**

```typoscript
page = PAGE
page.10 = FLUIDTEMPLATE
page.10.template = TEXT
page.10.template.value (
  # infer from extensionName
  <f:translate key="onlineDocumentation" extensionName="backend" />

  # infer from language key
  <f:translate key="backend.messages:onlineDocumentation" />

  # should not work because the locallang.xlf does not exist, but works right now
  <f:translate key="LLL:EXT:backend/Resources/locallang.xlf:onlineDocumentation" />
)
# Note the tx_ prefix
plugin.tx_backend._LOCAL_LANG.default {
  onlineDocumentation = TYPO3 Online Documentation from Typoscript
}

```

## `stdWrap.lang` {#localization-typoscript-stdwrap-lang}

`stdWrap` offers the [lang](https://docs.typo3.org/m/typo3/reference-typoscript/main/en-us/Functions/Stdwrap.html#stdwrap-lang) property,
which can be used to provide localized strings directly from TypoScript.
This can be used as a quick fix but it is not recommended to
manage translations within the TypoScript code.
