question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dynamically require a language

See original GitHub issue

I’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:open
  • Created 7 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
franciscolourencocommented, Aug 1, 2016

It should be possible to load languages individually

0reactions
ahmedelgabricommented, Jul 28, 2016

Maybe these solutions will work, but the same issue still holds in the library. I think it should be fixed properly.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found