JS Library
4 years ago
4 years ago


(Reporter: Yan-Fa Li, Assigned: Craig Michael Thompson)




(1 attachment)



4 years ago
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36

Steps to reproduce:

✗ bower search l20n

Actual results:

Search results:

    angularjs-l20n git://

Expected results:

Search results:
    angularjs-l20n git://

I would like to use l20n in my javascript projects. l20n is in npm, but it's not available in bower, which is the tool of choice for yeoman based projects. It would be great if you could make it officially supported and available to the yeoman and bower communities.

Comment 1

4 years ago
I'm interesting this too. I made a webapp template based on l20n as well ,currently I have to bundle l20n into the template.

Maybe we could add dist/ folder similar to

So bower could take care the rest part. I could help the bower part

Comment 2

4 years ago
This could also be easily achieved by adding a `bower.json` file to the existing `l20n/builds` repository on GitHub here:

    "name": "l20n",
    "main": "l20n.min.js",
    "description": "A natural-language localization framework",
    "version": "1.0.0rc",
    "homepage": "",
    "authors": [
      "Mozilla <>",
      "Zbigniew Braniecki",
      "Staś Małolepszy"
    "license": "Apache 2.0",
    "keywords": [

And registering it using `bower register l20n`

Comment 3

4 years ago
good idea, could you create a Pull Request on github for that?
Flags: needinfo?(craga89)

Comment 4

4 years ago
Added the file and requested a pull:
Flags: needinfo?(craga89)

Comment 5

4 years ago
Created attachment 8404596 [details] [review]
pull request redirect to github
Attachment #8404596 - Flags: review?(gandalf)


4 years ago
Assignee: nobody → craga89
Thanks for the pull request, Craig!  I haven't worked with bower before, but I'll read the docs and review the pull request today or tomorrow.

One question:  is it helpful to have the dist version of L20n in bower, or should we register the AMD-enabled version suitable for use with for instance RequireJS? Or both?

Comment 7

4 years ago
Happy to help! In fact, both would be useful depending on people's environments. Libraries such as `Handlebars` handle this by exposing both "Globalized" and AMD specific builds, see:

There's also the option of utilising the "Universal Module Definition" pattern and providing a single file that works in all environments (Browser, Node and AMD), great article on this here: 

I'm not averse to either, I use RequireJS in my own production builds, so an AMD specific build would be ideal, but the overhead of adding the UMD definition is in the order of a few hundred bytes, so I'd air towards that psersonally!

Comment 8

4 years ago
Thanks for working on this guys. I'm using RequireJS too. I use a patched version of @fernandogmar L20n-RequireJS to load the translations automatically. I submitted a bug report, but he doesn't appear to be maintaining it any longer so the github uses an older API.

Comment 9

4 years ago
@stas, it's possible to use github release with version name ex: `v1.0`, so bower will take the current release version. We already did it in BuildingBlocks (firefoxos UI)

$ bower install building-blocks

or specify a target version with #

$ bower install building-blocks#1.2.1
Comment on attachment 8404596 [details] [review]
pull request redirect to github

not sure if I'm the best reviewer since I don't understand bower :) But the code looks clean and green, so r+
Attachment #8404596 - Flags: review?(gandalf) → review+
Ever confirmed: true
Landed in  Thanks for everyone's help!

You can now use `bower info l20n` to see the details of the l20n package.

I plan to also register a l20n-amd package from the l20n/l20n.js repository.
Last Resolved: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.