File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -234,6 +234,7 @@ private function adjustArray(array $arr)
234
234
{
235
235
$ res = [];
236
236
foreach ($ arr as $ key => $ val ) {
237
+ $ key = $ this ->adjustString ($ key );
237
238
238
239
if (is_string ($ val )) {
239
240
$ res [$ key ] = $ this ->adjustString ($ val );
Original file line number Diff line number Diff line change @@ -86,6 +86,29 @@ function testBasic()
86
86
$ this ->destroyLocaleFilesFrom ($ arr , $ root );
87
87
}
88
88
89
+ function testBasicWithTranslationString ()
90
+ {
91
+ $ arr = [
92
+ 'en ' => [
93
+ 'main ' => [
94
+ 'hello :name ' => 'Hello :name ' ,
95
+ ]
96
+ ],
97
+ ];
98
+
99
+ $ root = $ this ->generateLocaleFilesFrom ($ arr );
100
+ $ this ->assertEquals (
101
+ 'export default { ' . PHP_EOL
102
+ . ' "en": { ' . PHP_EOL
103
+ . ' "main": { ' . PHP_EOL
104
+ . ' "hello {name}": "Hello {name}" ' . PHP_EOL
105
+ . ' } ' . PHP_EOL
106
+ . ' } ' . PHP_EOL
107
+ . '} ' . PHP_EOL ,
108
+ (new Generator ([]))->generateFromPath ($ root ));
109
+ $ this ->destroyLocaleFilesFrom ($ arr , $ root );
110
+ }
111
+
89
112
function testBasicWithVendor ()
90
113
{
91
114
$ arr = [
You can’t perform that action at this time.
0 commit comments