richarddobron / fbt
An Internationalization Framework for PHP.
Installs: 1 850
Dependents: 2
Suggesters: 0
Security: 0
Stars: 15
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: ^7.2 || ^8.0
- ext-dom: *
- ext-iconv: *
- ext-json: *
- ext-mbstring: *
- minicli/minicli: 1.0.4
- nikic/php-parser: ^4.1
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.2.1
- latte/latte: ^2.5 || ^3.0
- phpunit/phpunit: ^8.5.5 || ^9.3.5
- spatie/phpunit-snapshot-assertions: ^2.0|^3.0|^4.0
- dev-main
- 4.3.3
- 4.3.2
- 4.3.1
- 4.3.0
- 4.2.9
- 4.2.8
- 4.2.7
- 4.2.6
- 4.2.5
- 4.2.4
- 4.2.3
- 4.2.2
- 4.2.1
- 4.2.0
- 4.1.0
- 4.0.11
- 4.0.10
- 4.0.9
- 4.0.8
- 4.0.7
- 4.0.6
- 4.0.5
- 4.0.4
- 4.0.3
- 4.0.2
- 4.0.1
- 4.0
- 3.x-dev
- 3.3.3
- 3.3.2
- 3.3.1
- 3.3.0
- 3.2.9
- 3.2.8
- 3.2.7
- 3.2.6
- 3.2.5
- 3.2.4
- 3.2.3
- 3.2.2
- 3.2.1
- 3.2.0
- 3.1.0
- 3.0.11
- 3.0.10
- 3.0.9
- 3.0.8
- 3.0.7
- 3.0.6
- 3.0.5
- 3.0.4
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0
This package is auto-updated.
Last update: 2025-05-16 17:08:20 UTC
README
FBT for PHP
FBT is an internationalization framework for PHP designed to be not just powerful and flexible, but also simple and intuitive. It helps with the following:
- Organizing your source text for translation
- Composing grammatically correct translatable UI
- Eliminating verbose boilerplate for generating UI
This library is based on the JavaScript implementation of Facebook's FBT.
π Requirements
- PHP 7.0 or higher
- Composer is required for installation
π¦ Installing
$ composer require richarddobron/fbt:^4
β¨ Features
- Parameters and interpolation
- Implicit parameters
- Auto-parameterization
- Plurals
- Enumerations
- Pronouns
- Number formatting
- Phrase extracting
- Inline translating
π Getting started
See the Getting Started guide for more.
π Version Guidance
Version | Released | Status | Repo | PHP Version |
---|---|---|---|---|
3.x | 2022-02-18 | Maintained | v3 | >= 7.0 |
4.x | 2022-04-09 | Latest | v4 | >= 7.2 |
π Official integrations
The following integrations are fully supported and maintained:
βοΈ How FBT works
FBT works by transforming your <fbt>
and fbt(...)
constructs via
Simple HTML DOM Parser. It serves to extract strings from source and
lookup translated payloads generated during execution. FBT creates tables
of all possible variations for each fbt phrase and accesses them
at runtime.
π Full documentation
β TODO
- Add driver-agnostic support for multiple database systems.
- Add integrations for Symfony, CakePHP, Zend Framework, ...
- ...
π€ Contributing
We welcome contributions! If you'd like to help improve this project, feel free to open an issue or submit a pull request.
π License
FBT is MIT licensed, as found in the LICENSE file.