Skip to main content
The everyday-nl/tolk-laravel package is being built in a separate repository and is not available yet. This page describes how it will work. Until it is available, use the API directly; see Syncing keys and Imports and exports.
The package makes Tolk part of the usual development flow: keys go to Tolk with tolk:push, and translations come back into the repository as files with tolk:pull.

Installing

tolk:install publishes config/tolk.php. Then set in .env:
.env
Create the token under Settings › API tokens (Instellingen › API-tokens) of the project. For tolk:push, the token needs the permission Read and write (Lezen en schrijven); for tolk:pull only, Read only (Alleen lezen) is enough. In config/tolk.php you set which paths the package reads (for example lang/ and lang/vendor/) and which export profiles a pull fetches.

Commands

Smart syncing

  • Push as a delta. The package computes a hash per key locally and first sends only that list. Only new and changed keys are sent after that.
  • Pull with an ETag. The package sends the last ETag. If nothing has changed, Tolk responds with 304 Not Modified and the package writes nothing.
  • Final check. Before writing, the package checks the placeholders in the received files once more.

Working with git

After a pull, translations are simply in the repository. Commit them like any other code. A deploy therefore does not need Tolk. Use the GitHub Action to automate this.