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"