Skip to content

Commit

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

## @fluent/bundle 0.13.0 (July 25, 2019)

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

## fluent 0.13.0 (July 25, 2019)

- Support Fluent Syntax 1.0.
Expand Down
21 changes: 11 additions & 10 deletions fluent/README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
# fluent
# @fluent/bundle

`fluent` is a JavaScript implementation of Project Fluent, a localization
framework designed to unleash the expressive power of the natural language.
`@fluent/bundle` is a JavaScript implementation of Project Fluent, a
localization framework designed to unleash the expressive power of the
natural language.


## Installation

`fluent` 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
`Fluent` global).
`@fluent/bundle` 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
`FluentBundle` global).

npm install fluent
npm install @fluent/bundle


## How to use
Expand All @@ -19,7 +20,7 @@ The `FluentBundle` constructor provides the core functionality of formatting
translations from FTL files.

```javascript
import { FluentBundle, ftl } from 'fluent';
import { FluentBundle, ftl } from '@fluent/bundle';

const bundle = new FluentBundle('en-US');

Expand Down Expand Up @@ -54,14 +55,14 @@ however, a polyfill will be required. We recommend [intl-pluralrules][].

```javascript
import 'intl-pluralrules';
import { FluentBundle } from 'fluent';
import { FluentBundle } from '@fluent/bundle';
```

For legacy browsers, the `compat` build has been transpiled using Babel's [env
preset][]. It requires the regenerator runtime provided by [babel-polyfill][].

```javascript
import { FluentBundle } from 'fluent/compat';
import { FluentBundle } from '@fluent/bundle/compat';
```


Expand Down
10 changes: 5 additions & 5 deletions fluent/makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
PACKAGE := fluent
GLOBAL := Fluent
PACKAGE := @fluent/bundle
GLOBAL := FluentBundle

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 @@ -24,7 +24,7 @@ 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"

Expand Down
4 changes: 2 additions & 2 deletions fluent/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "fluent",
"name": "@fluent/bundle",
"description": "Localization library for expressive translations.",
"version": "0.13.0",
"homepage": "http://projectfluent.org",
Expand All @@ -18,7 +18,7 @@
"directories": {
"lib": "./src"
},
"main": "./fluent.js",
"main": "./index.js",
"module": "./src/index.js",
"repository": {
"type": "git",
Expand Down
4 changes: 2 additions & 2 deletions tools/perf/benchmark.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function runTest(env) {
{
const testName = "parse-runtime";
let start = env.now();
resource = env.Fluent.FluentResource.fromString(ftlCode);
resource = env.FluentBundle.FluentResource.fromString(ftlCode);
let end = env.now();

// we don't report any runtime parser errors, so
Expand All @@ -38,7 +38,7 @@ function runTest(env) {
let body = functions[fnName];
fncs[fnName] = new Function(body);
}
const bundle = new env.Fluent.FluentBundle('en-US', {
const bundle = new env.FluentBundle.FluentBundle('en-US', {
functions: fncs
});
const errors = bundle.addResource(resource);
Expand Down
6 changes: 3 additions & 3 deletions tools/perf/benchmark.d8.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load('../../fluent/fluent.js');
load('../../fluent-syntax/fluent-syntax.js');
load('../../fluent/index.js');
load('../../fluent-syntax/index.js');
load('./benchmark.common.js');

const env = {
Expand All @@ -12,7 +12,7 @@ const env = {
benchmarkName: arguments[0],
now: Date.now,
FluentSyntax,
Fluent,
FluentBundle,
};

const results = runTest(env);
Expand Down
6 changes: 3 additions & 3 deletions tools/perf/benchmark.jsshell.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load('../../fluent/fluent.js');
load('../../fluent-syntax/fluent-syntax.js');
load('../../fluent/index.js');
load('../../fluent-syntax/index.js');
load('./benchmark.common.js');

const env = {
Expand All @@ -12,7 +12,7 @@ const env = {
benchmarkName: scriptArgs[0],
now: performance.now,
FluentSyntax,
Fluent,
FluentBundle,
};

const results = runTest(env);
Expand Down
4 changes: 2 additions & 2 deletions tools/perf/benchmark.node.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const fs = require('fs');

const Fluent = require('../../fluent');
const FluentBundle = require('../../fluent');
const FluentSyntax = require('../../fluent-syntax');
const { runTest } = require('./benchmark.common');
require('intl-pluralrules');
Expand All @@ -15,7 +15,7 @@ const env = {
benchmarkName: process.argv[2],
now: process.hrtime,
FluentSyntax,
Fluent,
FluentBundle,
};

const results = runTest(env);
Expand Down

0 comments on commit d79fe1b

Please sign in to comment.