Simple, ease-to-use and flexible package for the Laravel web framework. Allows you to use localized messages of the Laravel webapp (see `resources/lang` directory) in your Javascript code.
MIT License
143
stars
51
forks
source link
Unable to get translation to work (question on how this supposed to work) #69
I am asking this because there is no explanation/example on how it actually works
I am using laravel 5.7
line in composer "andywer/js-localization": "dev-laravel-5"
in my messages.php I have 'test' => 'frtest' in lang/fr_FR folder
in js-localization.php file I have :
'locales' => [ 'en_US', 'en_AU', 'fr_FR', 'ja_JP' ],'messages' => [ 'test' ],'disable_config_cache' => true,
the rest are all default
in my js file I am trying to use Lang.get( 'messages.test' ) or I tried Lang.get( 'test' )
This just returns the key messages.test or test
I don't know what I am doing wrong, I couldn't find any full examples on how this works so now I am stuck. Can anyone tell me how this thing actually works?
I am asking this because there is no explanation/example on how it actually works
I am using laravel 5.7
line in composer
"andywer/js-localization": "dev-laravel-5"
in my messages.php I have
'test' => 'frtest'
inlang/fr_FR
folderin
js-localization.php
file I have :'locales' => [ 'en_US', 'en_AU', 'fr_FR', 'ja_JP' ],
'messages' => [ 'test' ],
'disable_config_cache' => true,
the rest are all defaultin my js file I am trying to use
Lang.get( 'messages.test' )
or I triedLang.get( 'test' )
This just returns the key
messages.test
ortest
I don't know what I am doing wrong, I couldn't find any full examples on how this works so now I am stuck. Can anyone tell me how this thing actually works?