richarddobron/laravel-fbt

A PHP Internationalization Framework for Laravel Application.

Installs: 1 090

Dependents: 0

Suggesters: 0

Security: 0

Stars: 12

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/richarddobron/laravel-fbt

4.3.3 2025-04-15 19:25 UTC

README

FBT

FBT is an internationalization framework for Laravel Application 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.

FBT intro

FBT plurals

FBT enum

FBT pronouns

πŸ“– Requirements

  • Laravel 5.5 or higher
  • Composer is required for installation

πŸ“¦ Installing

$ composer require richarddobron/laravel-fbt

✨ Features

  • Parameters and interpolation
  • Implicit parameters
  • Auto-parameterization
  • Plurals
  • Enumerations
  • Pronouns
  • Number formatting
  • Phrase extracting
  • Inline translating

πŸš€ Getting started

Integrating into your app

πŸ“‘ Version Guidance

Version Released Status Repo Laravel Version PHP Version
3.x 2022-02-21 Maintained v3 ^5.5 ^7.0
4.x 2022-04-09 Latest v4 ^5.6|^5.7|^5.8|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0 ^7.2|^8.0

βš™οΈ How FBT works

FBT works by transforming your <fbt> and fbt(...) constructs via Simple HTML DOM Parser. This library serve to extract strings from source and lookup translated payloads generated while execution. FBT creates tables of all possible variations for the given fbt phrase and accesses this at runtime.

πŸ“• Full documentation

https://github.com/richarddobron/laravel-fbt/tree/main/docs

🀝 Contributing

Please see CONTRIBUTING for details.

πŸ“œ License

This project is licensed under the MIT License. See the LICENSE file for details.