Closed Bug 963320 Opened 10 years ago Closed 10 years ago

Get L20N.js into bower

Categories

(L20n :: JS Library, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: yanfali, Assigned: craga89)

Details

Attachments

(1 file)

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://texthtml.net/webapp/lib/angularjs/l20n



Expected results:

Search results:
    l20n git@github.com:l20n/l20n.js.git
    angularjs-l20n git://texthtml.net/webapp/lib/angularjs/l20n

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.
I'm interesting this too. I made a webapp template based on l20n as well https://github.com/gasolin/webapplate ,currently I have to bundle l20n into the template.


Maybe we could add dist/ folder similar to
http://mozilla.github.io/localForage/

So bower could take care the rest part. I could help the bower part
This could also be easily achieved by adding a `bower.json` file to the existing `l20n/builds` repository on GitHub here: https://github.com/l20n/builds

```
{
    "name": "l20n",
    "main": "l20n.min.js",
    "description": "A natural-language localization framework",
    "version": "1.0.0rc",
    "homepage": "http://l20n.org",
    "authors": [
      "Mozilla <l10n-drivers@mozilla.org>",
      "Zbigniew Braniecki",
      "Staś Małolepszy"
    ],
    "license": "Apache 2.0",
    "keywords": [
      "localization",
      "l10n",
      "l20n"
    ]
}
```

And registering it using `bower register https://github.com/l20n/builds l20n`
good idea, could you create a Pull Request on github for that?
Flags: needinfo?(craga89)
Added the file and requested a pull: https://github.com/l20n/builds/pull/1
Flags: needinfo?(craga89)
Attachment #8404596 - Flags: review?(gandalf)
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?
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: https://github.com/components/handlebars.js/blob/master/handlebars.js

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: http://bob.yexley.net/umd-javascript-that-runs-anywhere/. 

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!
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.
@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) https://github.com/buildingfirefoxos/Building-Blocks/releases

$ 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+
Status: UNCONFIRMED → NEW
Ever confirmed: true
Landed in https://github.com/l20n/builds/commit/5b1340b8991b1b6efe9769685561e2962d7351b4.  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.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: