Cache
Whenever you run the translate
script in Terai to generate translations,
the framework checks the internal cache first. Terai will only translate
messages that have not been historically translated before. This approach
significantly reduces the translation workload, making the process faster and
more efficient.
Location: The internal cache is stored locally in a directory named
.terai
within your project's root folder. The cache directory is named
.terai/cache
, and it's the storage location for all cached translation data.
Overriding Cached Values
One notable feature of the internal cache is its ability to adapt to changes in your project's translations. If you override the values of some messages in your locale files, the internal cache will automatically update and use the overridden values moving forward. This ensures that the cached translations remain in sync with the actual translations in your project.
Manual Message Creation and Cache
In cases where you manually create a message translation, Terai will store this translation in the internal cache as well. This feature allows you to add custom translations and ensures that Terai leverages the cached data effectively.