You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This causes overhead in each request and prevents client side caching of the translation file (Yii appends the timestamp, but that changes on every request due to the forced copy)
The text was updated successfully, but these errors were encountered:
I think the reason behind it is that this minimizes the possibility of serving an out of date language file. The language file is updated each time when a translation is modified. Without the forceCopy option, the Yii2 AssetManager will not update the file in the web folder (it will only publish once, when it detects that the file is missing), so the translations won't get updated. However if you use the linkAssets => true options in the AssetManager config, this will not be a problem (because of the symlink the file will always contain the latest translations). So you may need it in your specific environment, it depends on how you deal with assets.
Fortunately Yii2 provides a way to change the configuration for an asset bundle. If you don't need the forceCopy, you can turn of like this in the application config:
Is it really necessary to force a copy in the LanguageItemPluginAsset?
yii2-translate-manager/bundles/LanguageItemPluginAsset.php
Line 25 in 560baa7
This causes overhead in each request and prevents client side caching of the translation file (Yii appends the timestamp, but that changes on every request due to the forced copy)
The text was updated successfully, but these errors were encountered: