File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change 1919 */
2020class LanguageTranslations
2121{
22- protected App $ kirby ;
2322 protected array $ data ;
2423
2524 public function __construct (
2625 protected Language $ language ,
2726 self |array $ translations = []
2827 ) {
29- $ this ->kirby = App::instance ();
3028 $ this ->setTranslations ($ translations );
3129 }
3230
@@ -62,8 +60,9 @@ public function load(array $default = []): array
6260 */
6361 public function save (array $ translations = []): static
6462 {
63+ $ this ->setTranslations ($ translations );
64+
6565 if ($ root = $ this ->root ()) {
66- $ this ->data = $ translations ;
6766 Data::write ($ root , $ translations );
6867 }
6968
@@ -77,7 +76,7 @@ public function root(): string|null
7776 {
7877 $ kirby = App::instance ();
7978 $ root = $ kirby ->root ('translations ' );
80- $ file = $ root . '/ ' . $ this ->language ->code () . '.php ' ;
79+ $ file = ( $ root ?? '' ) . '/ ' . $ this ->language ->code () . '.php ' ;
8180
8281 if (
8382 $ root !== null &&
You can’t perform that action at this time.
0 commit comments