Fixed i18n translation files with ESM and vite.#1017
Open
mikevandiepen wants to merge 1 commit intomistic100:devfrom
Open
Fixed i18n translation files with ESM and vite.#1017mikevandiepen wants to merge 1 commit intomistic100:devfrom
mikevandiepen wants to merge 1 commit intomistic100:devfrom
Conversation
Author
|
We could hack around it using this approach. import nl_lang from './../../../node_modules/jQuery-QueryBuilder/src/i18n/nl.json';
import fr_lang from './../../../node_modules/jQuery-QueryBuilder/src/i18n/fr.json';
import es_lang from './../../../node_modules/jQuery-QueryBuilder/src/i18n/es.json';
import de_lang from './../../../node_modules/jQuery-QueryBuilder/src/i18n/de.json';
if (window.$) {
let fnQueryBuilderImport = import('jQuery-QueryBuilder/dist/js/query-builder');
fnQueryBuilderImport.then(function() {
window.$.fn.queryBuilder.regional['nl'] = nl_lang;
window.$.fn.queryBuilder.regional['fr'] = fr_lang;
window.$.fn.queryBuilder.regional['es'] = es_lang;
window.$.fn.queryBuilder.regional['de'] = de_lang;
});
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Merge request checklist
devand I am issuing the PR todevdistdirectory__localeand__authorfields🗒️ There where issues where jquery wasn't globally accessible when initializing jquery-builder, adding window.$ solved the problem. i18n files cannot be imported using ESM and vite.