Skip to content

Separate language files#336

Open
holtkamp wants to merge 14 commits intomasterfrom
separate-language-files
Open

Separate language files#336
holtkamp wants to merge 14 commits intomasterfrom
separate-language-files

Conversation

@holtkamp
Copy link
Collaborator

Initial approach to separate non-default language files

@holtkamp
Copy link
Collaborator Author

holtkamp commented Mar 29, 2017

A problem is that the language files as loaded by $.ajax should be located relative to the HTML page (and not relative to the .js file) that uses the functionality, so using relative URLs will be a no-go... 😞

http://stackoverflow.com/questions/36369082/relative-paths-with-fetch-in-javascript

@mazipan
Copy link
Contributor

mazipan commented Mar 30, 2017

maybe we can setup browsersync (https://browsersync.io/) for gulp in development phase.
so there is no problem with ajax.

@holtkamp
Copy link
Collaborator Author

@mazipan I don't see how this circumvents the problem?

Suppose I have a webpage, which references to the JavaScript files on CDNJS:

Then the English translation file will be loaded relative to the .html page, so from:

Instead of:
https://cdnjs.cloudflare.com/ajax/libs/jquery-date-range-picker/0.14.4/locales/en.json

We might be able to circumvent this by introducing a configuration option basePath that a user has to point to https://cdnjs.cloudflare.com/ajax/libs/jquery-date-range-picker/0.14.4/, but I think that is a big disadvantage / not worth it...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants