Closed Bug 1129926 Opened 10 years ago Closed 9 years ago

Make it possible to require('./l10n')

Categories

(Firefox OS Graveyard :: Gaia::L10n, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1169361

People

(Reporter: stas, Unassigned)

References

Details

For certain buildtime tasks it would helpful if it was possible to require('./l10n') from a node.js script.
Blocks: 1101632
Since we want to move away from including l10n.js at build time, why are we doing this?
I think it would be useful to share code between runtime and buildtime in some cases, like for the pseudolocales.
(In reply to Staś Małolepszy :stas from comment #3) > I think it would be useful to share code between runtime and buildtime in > some cases, like for the pseudolocales. Does it mean that you disagree that we should move in the direction or removing l10n.js from build time?
No, I still think we should have l10n-related build tasks separated into their own modules in build/. But I think it would be useful to be able to do something to the effect of: var pseudo = require('../shared/js/l10n').PSEUDO_STRATEGIES; in those modules not to duplicate code between runtime and buildtime.
(In reply to Staś Małolepszy :stas from comment #5) > No, I still think we should have l10n-related build tasks separated into > their own modules in build/. But I think it would be useful to be able to > do something to the effect of: > > var pseudo = require('../shared/js/l10n').PSEUDO_STRATEGIES; > > in those modules not to duplicate code between runtime and buildtime. So, here's where I disagree. My vision is for us to have: ./build/l10n/pseudo.js and then do: var pseudo = require('./build/l10n/pseudo.js'); and *not* having shared/js/l10n.js used at build time at all.
What about the pseudo locales logic on runtime in this case?
(In reply to Staś Małolepszy :stas from comment #7) > What about the pseudo locales logic on runtime in this case? So, in my vision, we will have pseudolocales module that will be imported into l10n.js for runtime, and separately used at buildtime.
You mean like this: <script src="/shared/js/l10n.js"></script> <script src="/build/l10n/pseudo.js"></script> ?
(In reply to Staś Małolepszy :stas from comment #9) > You mean like this: > > <script src="/shared/js/l10n.js"></script> > <script src="/build/l10n/pseudo.js"></script> No, bundle it into l10n.js for runtime, and separately keep in ./build/l10n/pseudo.js for build time.
OK, I like this. Let's keep this bug open to figure out exactly how this should work.
I fixed this in bug 1169361.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.