Skip to content

Commit

Permalink
Revert JS regexp. Fixes #8
Browse files Browse the repository at this point in the history
  • Loading branch information
iamgergo committed Jun 3, 2019
1 parent 237f2a1 commit ebec099
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## v0.6.2 (2018-06-03 )
### Changed
- revet JS regexp to have better browser support

## v0.6.1 (2018-06-03 )
### Fixed
- use concat in JS instead of push
Expand Down
6 changes: 5 additions & 1 deletion resources/js/I18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,13 @@ export default class I18n
*/
_extract(key, value = null)
{
let path = key.toString().split(/(?<=::)/),
let path = key.toString().split('::'),
keys = path.pop().toString().split('.');

if (path.length > 0) {
path[0] += '::';
}

return path.concat(keys).reduce((t, i) => t[i] || (value || key), window[this.key]);
}
}

0 comments on commit ebec099

Please sign in to comment.