Closed
Bug 1129926
Opened 10 years ago
Closed 9 years ago
Make it possible to require('./l10n')
Categories
(Firefox OS Graveyard :: Gaia::L10n, defect)
Firefox OS Graveyard
Gaia::L10n
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.
Reporter | ||
Comment 1•10 years ago
|
||
Comment 2•10 years ago
|
||
Since we want to move away from including l10n.js at build time, why are we doing this?
Reporter | ||
Comment 3•10 years ago
|
||
I think it would be useful to share code between runtime and buildtime in some cases, like for the pseudolocales.
Comment 4•10 years ago
|
||
(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?
Reporter | ||
Comment 5•10 years ago
|
||
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.
Comment 6•10 years ago
|
||
(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.
Reporter | ||
Comment 7•10 years ago
|
||
What about the pseudo locales logic on runtime in this case?
Comment 8•10 years ago
|
||
(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.
Reporter | ||
Comment 9•10 years ago
|
||
You mean like this:
<script src="/shared/js/l10n.js"></script>
<script src="/build/l10n/pseudo.js"></script>
?
Comment 10•10 years ago
|
||
(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.
Reporter | ||
Comment 11•10 years ago
|
||
OK, I like this. Let's keep this bug open to figure out exactly how this should work.
Reporter | ||
Comment 12•9 years ago
|
||
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.
Description
•