lavinjj/angularjs-localizationservice

hardcoded absolute URL for resource

xliyong opened this issue · 4 comments

In Phonegap environment, where file// protocol is used to retrieve resource files, the absolute url does not work

var url = '/i18n/resources-locale_' + localize.language + '.js';

What do you think if we require a constant that would provide an absolute URL? Then it would work in all environments.

Right now, I simply remove the leading slash and use relative path to retrieve the resource file. This may not work in other environments.

You could try loading the resource file based on document base href attribute. The base href attribute is usually set to the application starting page, which applies for both web applications and phonegap applications.

Sounds good enough for me.

It's been changed. should now work for you without modification.