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
Hello!
I have some troubles when working with arrays.
When load pure array like this one: 'months' => ['Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь'],
do some translations and then publish here is what i get: 'months' => [ '0' => 'Январь', '1' => 'Февраль', '10'=> 'Ноябрь', '11'=> 'Декабрь', '2' => 'Март', '3' => 'Апрель', '4' => 'Май', '5' => 'Июнь', '6' => 'Июль', '7' => 'Август', '8' => 'Сентябрь', '9' => 'Октябрь', ]
It literally rewrites all keys and makes it completely unusable, because further this array is converted to JS object, instead of array. Is there a way to avoid it and preserve array as is?
Thank you!
The text was updated successfully, but these errors were encountered:
which shows that the two declarations are equivalent. However, I noticed that the keys in the translations are not created in numeric order which causes the two arrays to differ:
So the solution would require creating arrays with numerical keys sorted numerically and not alphabetically. This will ensure that if the keys are numeric and increasing by 1 then the created array will be equivalent to an array instead of associative array.
Hello!
I have some troubles when working with arrays.
When load pure array like this one:
'months' => ['Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь'],
do some translations and then publish here is what i get:
'months' => [ '0' => 'Январь', '1' => 'Февраль', '10'=> 'Ноябрь', '11'=> 'Декабрь', '2' => 'Март', '3' => 'Апрель', '4' => 'Май', '5' => 'Июнь', '6' => 'Июль', '7' => 'Август', '8' => 'Сентябрь', '9' => 'Октябрь', ]
It literally rewrites all keys and makes it completely unusable, because further this array is converted to JS object, instead of array. Is there a way to avoid it and preserve array as is?
Thank you!
The text was updated successfully, but these errors were encountered: