forked from nuxt-modules/i18n
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Since using lodash templates makes it impossible to properly lint files, create options.js file that has all options stringified and exported so that all other files can just import those without using templates. That makes it possible to lint files and also see exactly which variables are used and which are missing which was really hard when whole functions were inlined when processing templates. Instead of passing various functions through templates and stringifying them, keep them in templates/utils.js and import directly. This also has benefit of avoiding code duplication in processed files. Compute localeCodes and some other variables up-front as when those are based on user settings, they are guaranteed not to change so we don't have to processes them on each request/route change. `loadLanguageAsync` is one tricky function that needs to use templates so that we don't include `import` statement when `langDir` is not defined. To not break linting, added some hacky block comments to hide template directives from linter.
- Loading branch information
Showing
12 changed files
with
253 additions
and
256 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.