langDir does not support absolute path
See original GitHub issueVersion
nuxt-i18n: 6.13.1 nuxt: 2.13.3
Nuxt configuration
mode:
- universal
- [] spa
Nuxt-i18n configuration
const { resolve } = require('path');
...
['nuxt-i18n', {
lazy: true
langDir: resolve(__dirname, 'lang'),
}]
–>
Steps to reproduce
I am trying to use lazy load on windows, but setting langDir to some diroctory with full path it will generate options.js
:
...
export const langDir = 'C:\web\work\zeoshop\client\lang'
...
What is Expected?
backslash should be prefixed:
...
export const langDir = 'C:\\web\\work\\zeoshop\\client\\lang'
...
What is actually happening?
ERROR in ./.nuxt/nuxt-i18n/options.js
Syntax Error: Unterminated string constant (9:23)
7 | export const strategy = 'prefix_except_default'
8 | export const lazy = true
> 9 | export const langDir = 'C:\web\work\zeoshop\client\lang\'
edit
or probably i do something bad, because it is forcing '~/<%= options.langDir %>'
… what is ~
directory? why is it forced?
edit 2
we have translable translation in admin area, so probably locale’s file
should be http://...
? to load newest translations every time by http/https protocol? but this is change request not bug (like this issue)
Issue Analytics
- State:
- Created 3 years ago
- Comments:8
Top Results From Across the Web
langDir does not support absolute path · Issue #792 - GitHub
I am trying to use lazy load on windows, but setting langDir to some diroctory with full path it will generate options.js :...
Read more >Relative path import fails, module not found, but absolute path ...
Upon migrating, however, I was met with an issue of Node.js not finding my command handler file using relative paths.
Read more >Untitled
No leading slash, no trailing slash, full path, not relative to ABSPATH * * @since ... backward compatibility - won't work in some...
Read more >getPath() - WinCC OA
This function determines the absolute paths for panels, scripts etc. ... filename, The file name whose absolute path is to be determined (an...
Read more >build.gradle · devel · labs / Tablexia · GitLab
absolutePath }/assets/keystore/tablexiaTrustKeystore"). ... //Fallback value if sentry DSN is not defined (gradle parameter SENTRY_DSN_DEBUG or ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
we have translations editable in admin area… so that JSONs are changeable in runtime, so we need to load actual json on every load (have some small cache time on server) so I need to get around building translations messages with webpack
No, it can’t and won’t support
http://...
. Instead, you can assign a javascript file to thefile
property, that exports a function and you can have any custom logic you want there, including loading translations from a remote endpoint. See https://i18n.nuxtjs.org/lazy-load-translations.html for an example.I’m treating this bug as being about supporting absolute paths in
langDir
and nothing more.