Skip to content

Commit

Permalink
@fluent/dom 0.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
stasm committed Jul 25, 2019
1 parent a15fbec commit 92db8e2
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 16 deletions.
2 changes: 1 addition & 1 deletion fluent-dom/.esdoc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"source": "./src",
"destination": "../html/fluent-dom",
"destination": "../html/dom",
"plugins": [
{
"name": "esdoc-standard-plugin"
Expand Down
4 changes: 2 additions & 2 deletions fluent-dom/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
fluent-dom.js
compat.js
/index.js
/compat.js
4 changes: 4 additions & 0 deletions fluent-dom/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## @fluent/dom 0.5.0 (July 25, 2019)

- Rename `fluent-dom` to `@fluent/dom`.

## fluent-dom 0.5.0 (July 25, 2019)

- Deprecate `fluent-dom` in favor of `@fluent/dom`.
Expand Down
14 changes: 7 additions & 7 deletions fluent-dom/README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
# fluent-dom
# @fluent/dom

`fluent-dom` provides DOM bindings for Project Fluent, a localization
`@fluent/dom` provides DOM bindings for Project Fluent, a localization
framework designed to unleash the expressive power of the natural language.

## Installation

`fluent-dom` can be used both on the client-side and the server-side. You
`@fluent/dom` can be used both on the client-side and the server-side. You
can install it from the npm registry or use it as a standalone script (as the
`FluentDOM` global).

npm install fluent-dom
npm install @fluent/dom


## How to use

The `DOMLocalization` constructor provides the core functionality of
full-fallback ready message formatting. It uses a lazy-resolved
`FluentBundle` objects from the `fluent` package to format messages.
`FluentBundle` objects from the `@fluent/bundle` package to format messages.

On top of that, `DOMLocalization` can localize any DOMFragment by
identifying localizable elements with `data-l10n-id` and translating them.

```javascript
import { DOMLocalization } from 'fluent-dom'
import { DOMLocalization } from '@fluent/dom'

const l10n = new DOMLocalization(MutationObserver, [
'/browser/main.ftl',
Expand All @@ -45,7 +45,7 @@ For imperative uses straight from the JS code, there's also a `Localization`
class that provides just the API needed to format messages in the running code.

```javascript
import { Localization } from 'fluent-dom'
import { Localization } from '@fluent/dom'

function *generateBundles() {
// Some lazy logic for yielding FluentBundles.
Expand Down
8 changes: 4 additions & 4 deletions fluent-dom/makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
PACKAGE := fluent-dom
PACKAGE := @fluent/dom
GLOBAL := FluentDOM
DEPS := cached-iterable:CachedIterable

include ../common.mk

build: $(PACKAGE).js compat.js
build: index.js compat.js

$(PACKAGE).js: $(SOURCES)
index.js: $(SOURCES)
@rollup $(CURDIR)/src/index.js \
--config $(ROOT)/bundle_config.js \
--banner "/* $(PACKAGE)@$(VERSION) */" \
Expand All @@ -27,6 +27,6 @@ compat.js: $(SOURCES)
@echo -e " $(OK) $@ built"

clean:
@rm -f $(PACKAGE).js compat.js
@rm -f index.js compat.js
@rm -rf .nyc_output coverage
@echo -e " $(OK) clean"
4 changes: 2 additions & 2 deletions fluent-dom/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "fluent-dom",
"name": "@fluent/dom",
"version": "0.5.0",
"description": "Fluent bindings for DOM",
"repository": {
Expand All @@ -21,7 +21,7 @@
"directories": {
"lib": "./src"
},
"main": "./fluent-dom.js",
"main": "./index.js",
"module": "./src/index.js",
"keywords": [
"localization",
Expand Down

0 comments on commit 92db8e2

Please sign in to comment.