Load namespaces with variable from another file
See original GitHub issueHi, I want to load namespaces with variable from another file. I try this;
import { ABOUT_US } from "./src/core/routes";
module.exports = {
locales: ["az", "ru"],
defaultLocale: "az",
pages: {
"*": ["common", "metatags", "menus", "slip", "components", "forms", "validationMessages", "cookiePolicy", "personalDataProtection", "termsOfUse", "personalDataApplication", "responsibleBetting", "ourLogos", "advertisingFilms", "sponsors", "member"],
ABOUT_US: ["aboutUs"],
},
loadLocaleFrom: (lang, ns) =>
import(`./src/locales/${lang}/${ns}.json`).then((m) => m.default),
};
But it does not work. How can i do this? Please help me!
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
How to use variable from resource another .cs file with "using"
OK, I want to have a file that contains something like A = 1 B = 2 C = 3 and then I...
Read more >c++ - Load values from txt to variables in namespace
Is it possible to load the txt file and define the variables inside the namespace or I have to rewrite everything that is...
Read more >Namespaces — Mako 1.2.4 Documentation
Namespaces are used to organize groups of defs into categories, and also to “import” defs from other files. ... The comp variable above...
Read more >R Packages (2e) - 11 Dependencies: Mindset and Background
Each namespace has an imports environment that can contain bindings to functions used by the package that are defined in another package. The...
Read more >6. Modules — Python 3.11.1 documentation
Each module has its own private namespace, which is used as the global namespace by all functions defined in the module. Thus, the...
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 Free
Top 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

Thank you, its worked!
Replace the first line to
And your other file should be:
The dynamic import inside
loadLocaleFromis not a problem. https://github.com/vinissimus/next-translate/blob/master/examples/complex/i18n.js