Skip to content

Validate language + AMD load (requirejs) #546

Closed
@luizkim

Description

@luizkim

When loading the files via requirejs (AMD Load) the language file is loaded normally:

Var userLanguage = 'pt';
    Var core = {};

    Core.config = function () {
        Var config = {
            BaseUrl: '/ vendor',
            Paths: {
                'Jquery': 'jquery / dist / jquery.min',
                'Form-validator-lang': 'jquery-form-validator / form-validator / lang /' + userLanguage,
                'Form-validator': 'jquery-form-validator / form-validator / jquery.form-validator.min'
            },
            Shim: {
                Jquery: {
                    Exports: "$"
                }
            }
        };
        Require.config (config);

        Require (['jquery'], function ($) {
            If ($ ('[data-validation]'). Length) {
                    Require (['form-validator-lang', 'form-validator'], function () {
                        $ .validate ({lang: userLanguage});
                    });
            }
        });
}

However, when the jquery.form-validator.min file is loaded, it tries again to load the language file, however in an incorrect folder (jquery-form-validator/form-validator/lang/lang/pt.js).

This does not trap the plugin, but causes a 404 error call to be triggered.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions