Dynamically require a language
See original GitHub issueI’m trying load a culture dynamically and it doesn’t seem to be working. According to numbro.cultrue
& numbro.loadCulturesInNode
I should be able to pass a locale/culture/code & an object of this locale.
So this should work, but it doesn’t. Not sure what is the problem here?
import numbro from 'numbro'
// Any of these should work.
numbro.culture('fr-FR', require('numbro/languages')['fr-FR'])
numbro.culture('fr-FR', require('numbro/languages/fr-FR'))
const fr = require('numbro/languages/fr-FR')
numbro.culture('fr-FR', fr)
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Dynamic programming language - Wikipedia
In computer science, a dynamic programming language is a class of high-level programming languages, which at runtime execute many common programming behaviours ...
Read more >Magic lies here - Statically vs Dynamically Typed Languages
Common examples of dynamically-typed languages includes JavaScript, Objective-C, PHP, Python, Ruby, Lisp, and Tcl.
Read more >Dynamic Languages - Javatpoint
The most on demand dynamic languages are Python, Perl and Ruby. Dynamic languages allow programmers to modify even change the structure while running....
Read more >Setting RequireJS i18n locale dynamically - Stack Overflow
It seems after a lot of research, the best approach for solving this problem is to check localStorage for a locale value.
Read more >Understanding JavaScript: Coercion in a Dynamically Typed ...
... JavaScript (JS) is a dynamically typed language. What does that mean? It means that JS does not require the explicit declaration of...
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
It should be possible to load languages individually
Maybe these solutions will work, but the same issue still holds in the library. I think it should be fixed properly.