---
title: "php-joomla"
description: "The preset for Joomla. It reads INI language files and Text::_ calls."
canonical_url: "https://x18n.dev/presets/php-joomla"
---
# php-joomla

> The preset for Joomla. It reads INI language files and Text::\_ calls.

The `php-joomla` preset supports the [language files of Joomla](https://docs.joomla.org/Specification_of_language_files).

## Detection

The preset applies when `composer.json` requires `joomla/application` or `joomla/cms`.

```ts [x18n.config.ts]
import { defineConfig } from '@x18n/core'

export default defineConfig({
  presets: ['php-joomla'],
})
```

## Locale files

If your config has no `resources`, the preset uses `language/{locale}/*.ini` and `administrator/language/{locale}/*.ini`. The `ini` format reads and writes these files. Keys stay flat.

```ini [language/en-GB/en-GB.com_demo.ini]
COM_DEMO_TITLE="Demo"
```

## Supported syntax

In PHP files, the preset reads `Text::_` and the other static methods of `Text`, and the legacy `JText`:

```php [site/view.php]
<?php echo Text::_('COM_DEMO_TITLE'); ?>
```

## Placeholders

printf: `%s`, `%d`, `%1$s`.

## Extraction templates

| Kinds | Template           |
| ----- | ------------------ |
| any   | `Text::_('{key}')` |


## Sitemap

See the full [sitemap](https://x18n.dev/sitemap.md) for all pages.
