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

# PHP 字符串

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

PHP翻译通常只包含一种语言，因此建议指定(最常见的)带英语字符串的模板文件。

Weblate 目前支持几种 PHP 翻译的变体：

* 多种语法格式的单语言 PHP 字符串
* [Laravel PHP 字符串](https://docs.weblate.org/zh-cn/latest/formats/laravel.md#laravel-php)

示例文件：

```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. -->

#### 支持的功能

| 文件扩展名                                                                                    | `.php`   |
|------------------------------------------------------------------------------------------|----------|
| Linguality [ⓘ](https://docs.weblate.org/zh-cn/latest/formats.md#bimono)                       | 单语言      |
| 支持复数 [ⓘ](https://docs.weblate.org/zh-cn/latest/formats.md#format-plurals)                     | `No`     |
| 支持描述 [ⓘ](https://docs.weblate.org/zh-cn/latest/formats.md#format-description)                 | `Yes`    |
| 支持解释 [ⓘ](https://docs.weblate.org/zh-cn/latest/formats.md#format-explanation)                 | `No`     |
| 支持上下文 [ⓘ](https://docs.weblate.org/zh-cn/latest/formats.md#format-context)                    | `No`     |
| 支持位置 [ⓘ](https://docs.weblate.org/zh-cn/latest/formats.md#format-location)                    | `No`     |
| Supports line number [ⓘ](https://docs.weblate.org/zh-cn/latest/formats.md#format-line-number) | `No`     |
| 支持标记 [ⓘ](https://docs.weblate.org/zh-cn/latest/formats.md#format-flags)                       | `No`     |
| API 标识符                                                                                  | `php`    |
| 支持只读字符串 [ⓘ](https://docs.weblate.org/zh-cn/latest/formats.md#read-only-strings)               | `No`     |
| 支持删除过时字符串 [ⓘ](https://docs.weblate.org/zh-cn/latest/formats.md#obsolete-strings)              | `No`     |
<!-- AUTOGENERATED END: format-features php -->

## Weblate 配置

|             | 典型的 Weblate [部件配置](https://docs.weblate.org/zh-cn/latest/admin/projects.md#component)   |
|-------------|-----------------------------------------------------------------------------|
| 文件掩码        | `lang/*/texts.php`                                                          |
| 单语言译文模版语言文件 | `lang/en/texts.php`                                                         |
| 新语种的翻译模版    | `lang/en/texts.php`                                                         |
| 文件格式        | PHP 字符串                                                                     |
