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
"question_hours_per_day" => "How many hours will you work per day?",
"question_hours_per_day.postfix" => "hours",
"question_hours_per_day.help" => "Enter your planned average number of work hours per day. (...) ",
Importing this into the manager works ok:
However, when exporting, the "root" element is lost as the dotted elements are converted into an array whose key is the root element:
'question_hours_per_day' =>
array (
'postfix' => 'hours',
'help' => 'Enter your planned average number of work hours per day. The typical work day for a Spanish full-time employee is about 8 hours. The legal maximum for employees is 9 hours per day. As an autónomo, you are usually not bound by this limitation. ',
),
Is having a "root" element like "question_hours_per_day" - or rather, having dotted "sub-elements" - against Laravel convention, or should this be treated as a bug?
The text was updated successfully, but these errors were encountered:
pekka
changed the title
Translations break when
"Root" element in translations gets lost as it becomes an array key
Mar 24, 2024
pekka
changed the title
"Root" element in translations gets lost as it becomes an array key
Translations get lost in export when there are "sub"-elements
Mar 24, 2024
This is caused by the use of Arr:Set() in makeTree() in Manager.php. This is expected behaviour on Arr::Set()'s part, not sure if it should be changed in this context.
I managed to hack this by changing it so that it will always use jsonSet():
Suppose the following translation source data:
Importing this into the manager works ok:
However, when exporting, the "root" element is lost as the dotted elements are converted into an array whose key is the root element:
Is having a "root" element like "question_hours_per_day" - or rather, having dotted "sub-elements" - against Laravel convention, or should this be treated as a bug?
The text was updated successfully, but these errors were encountered: