suhaibkhan / messageResource.js

Javascript library for loading and using message resource property files.
MIT License
22 stars 22 forks source link

Coherence between load and get #12

Closed TMAMychaL closed 8 years ago

TMAMychaL commented 8 years ago

I'm not a Javascript developper, so maybe i don't understood the behavior...

You have written for load function : "case 2 : Module name Home and locale empty, then file name will be Home.properties." which is the case if i try to load an "application.properties".

However, if i try to get a key without specify a locale, the script will use the default locale to search in properties file. So the result will be the key and not the value.

Is it an error or a bad use of my part ?

TMAMychaL commented 8 years ago

Here the code i used :

    messageResource.init({
        filePath : '/xxx/resources/',
        debugMode : true
    });
    messageResource.load('application'); 

    var testFormat = messageResource.get('test.format', 'application');
TMAMychaL commented 8 years ago

My bad, exactly the same problem which KungFuPanaCodes had. Dunno why.