Skip to main content
Version: 5.x

Upgrading to fbt 5

This release requires fbt 5, which collects phrases in a new format. With the eloquent driver, run php artisan migrate (it widens the project column of phrases to 100 characters).

The md5_digest configuration of this package stays hex, so the hashes of stored phrases and the keys of translation files stay valid. Translation files don't have to be migrated (fbt:migrate-v5 --translations converts their keys to base64).

  1. Collect the source strings again:

    php artisan fbt:collect-fbts --clean-cache=true

    With the eloquent driver, stored phrases (and their translations) are kept: once a phrase is collected again, it's moved from its fbt 4 source to the new one. Sources collected by fbt 4 aren't exported to .source_strings.json anymore.

  2. Translate the phrases which changed in fbt 5 again (e.g. inner strings of HTML elements nested in an fbt, whose descriptions now contain the whole enclosing string). With the eloquent driver, they are listed by:

    php artisan fbt:migrate-v5 --dry-run

    With the json driver, the missing translations are generated by:

    php artisan fbt:generate-translations
  3. Generate the translations:

    php artisan fbt:translate

To switch to base64 (the default of fbt 5), set md5_digest to base64 and convert the stored hashes (eloquent driver) or the keys of translation files (json driver):

php artisan fbt:migrate-v5 --digest=base64
php artisan fbt:migrate-v5 --digest=base64 --translations="./storage/fbt/translations/*.json"

Upgrading to fbt 5.1​

fbt 5.1 ports features of fbtee, e.g. lists. With the json driver, the translation files are handled differently:

  • fbt:generate-translations adds new strings with their source text, their description and "status": "new", and removes translations of strings that are no longer collected. Commit your translation files before running it.
  • fbt:translate skips entries marked as new, remove the status once an entry is translated. Strings without a translation use the source string.

The strings of intlList() have new descriptions, so they have to be translated again.