<a id="php"></a>

# PHP strings

<a id="index-0"></a>

PHP translations are usually monolingual, so it is recommended to specify a base
file with (what is most often the) English strings.

Weblate currently supports several variants of PHP translations:

* Monolingual PHP strings in various syntax
* [Laravel PHP strings](https://docs.weblate.org/no/latest/formats/laravel.md#laravel-php)

Example file:

```php
<?php
$LANG['foo'] = 'bar';
$LANG['foo1'] = 'foo bar';
$LANG['foo2'] = 'foo bar baz';
$LANG['foo3'] = 'foo bar baz bag';
```

<!-- AUTOGENERATED START: format-features php -->
<!-- This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. -->

#### Supported features

| File extensions                                                                                      | `.php`      |
|------------------------------------------------------------------------------------------------------|-------------|
| Linguality [ⓘ](https://docs.weblate.org/no/latest/formats.md#bimono)                                   | Monolingual |
| Supports plural [ⓘ](https://docs.weblate.org/no/latest/formats.md#format-plurals)                      | `No`        |
| Supports descriptions [ⓘ](https://docs.weblate.org/no/latest/formats.md#format-description)            | `Yes`       |
| Supports explanation [ⓘ](https://docs.weblate.org/no/latest/formats.md#format-explanation)             | `No`        |
| Supports context [ⓘ](https://docs.weblate.org/no/latest/formats.md#format-context)                     | `No`        |
| Supports location [ⓘ](https://docs.weblate.org/no/latest/formats.md#format-location)                   | `No`        |
| Supports flags [ⓘ](https://docs.weblate.org/no/latest/formats.md#format-flags)                         | `No`        |
| API identifier                                                                                       | `php`       |
| Supports read-only strings [ⓘ](https://docs.weblate.org/no/latest/formats.md#read-only-strings)        | `No`        |
| Supports removing obsolete strings [ⓘ](https://docs.weblate.org/no/latest/formats.md#obsolete-strings) | `No`        |
<!-- AUTOGENERATED END: format-features php -->

## Weblate configuration

|                                | Typical Weblate [Component configuration](https://docs.weblate.org/no/latest/admin/projects.md#component)   |
|--------------------------------|----------------------------------------------------------------------------------------------------|
| File mask                      | `lang/*/texts.php`                                                                                 |
| Monolingual base language file | `lang/en/texts.php`                                                                                |
| Template for new translations  | `lang/en/texts.php`                                                                                |
| File format                    | PHP strings                                                                                        |
