Skip to content

Commit fe71782

Browse files
authored
Merge pull request #415 from stasm/fluent-bundle
Rename fluent/ to fluent-bundle/
2 parents c00c007 + eb26c76 commit fe71782

File tree

158 files changed

+38
-30
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

158 files changed

+38
-30
lines changed

README.md

+7-4
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

fluent-dom/test/dom_localization_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import assert from "assert";
2-
import { FluentBundle, FluentResource } from "../../fluent/src/index";
2+
import { FluentBundle, FluentResource } from "../../fluent-bundle/src/index";
33
import DOMLocalization from "../src/dom_localization";
44

55
async function* mockGenerateMessages(resourceIds) {

fluent-dom/test/localization_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import assert from "assert";
2-
import { FluentBundle, FluentResource } from "../../fluent/src/index";
2+
import { FluentBundle, FluentResource } from "../../fluent-bundle/src/index";
33
import Localization from "../src/localization";
44

55
async function* mockGenerateMessages(resourceIds) {

fluent-gecko/makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ build: Fluent.jsm FluentSyntax.jsm Localization.jsm DOMLocalization.jsm l10n.js
1111
Fluent.jsm: $(SOURCES)
1212
@rollup $(CURDIR)/src/fluent.js \
1313
--config ./xpcom_config.js \
14-
--output.intro "/* $(call version,fluent) */" \
14+
--output.intro "/* $(call version,fluent-bundle) */" \
1515
--output.file ./dist/$@
1616
@echo -e " $(OK) $@ built"
1717

fluent-gecko/src/fluent.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
FluentType,
66
FluentNumber,
77
FluentDateTime,
8-
} from "../../fluent/src/index";
8+
} from "../../fluent-bundle/src/index";
99

1010
this.EXPORTED_SYMBOLS = [
1111
...Object.keys({

fluent-react/test/localized_change_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import assert from 'assert';
33
import { shallow } from 'enzyme';
4-
import { FluentBundle, FluentResource } from '../../fluent/src';
4+
import { FluentBundle, FluentResource } from '../../fluent-bundle/src';
55
import ReactLocalization from '../src/localization';
66
import { Localized } from '../src/index';
77

fluent-react/test/localized_fallback_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import assert from 'assert';
33
import { shallow } from 'enzyme';
4-
import { FluentBundle, FluentResource } from '../../fluent/src';
4+
import { FluentBundle, FluentResource } from '../../fluent-bundle/src';
55
import ReactLocalization from '../src/localization';
66
import { Localized } from '../src/index';
77

fluent-react/test/localized_overlay_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import assert from 'assert';
33
import { shallow } from 'enzyme';
4-
import { FluentBundle, FluentResource } from '../../fluent/src';
4+
import { FluentBundle, FluentResource } from '../../fluent-bundle/src';
55
import ReactLocalization from '../src/localization';
66
import createParseMarkup from '../src/markup';
77
import { Localized } from '../src/index';

fluent-react/test/localized_render_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react';
22
import assert from 'assert';
33
import sinon from 'sinon';
44
import { shallow } from 'enzyme';
5-
import { FluentBundle, FluentResource } from '../../fluent/src';
5+
import { FluentBundle, FluentResource } from '../../fluent-bundle/src';
66
import ReactLocalization from '../src/localization';
77
import { Localized } from '../src/index';
88

fluent-react/test/localized_void_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import assert from 'assert';
33
import { shallow } from 'enzyme';
4-
import { FluentBundle, FluentResource } from '../../fluent/src';
4+
import { FluentBundle, FluentResource } from '../../fluent-bundle/src';
55
import ReactLocalization from '../src/localization';
66
import { Localized } from '../src/index';
77

fluent-react/test/provider_context_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, {Component} from 'react';
22
import PropTypes from "prop-types";
33
import assert from 'assert';
44
import { render } from 'enzyme';
5-
import { FluentBundle, FluentResource } from '../../fluent/src';
5+
import { FluentBundle, FluentResource } from '../../fluent-bundle/src';
66
import { LocalizationProvider, isReactLocalization } from '../src/index';
77

88

fluent-react/test/with_localization_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import assert from 'assert';
33
import { mount, shallow } from 'enzyme';
4-
import { FluentBundle, FluentResource } from '../../fluent/src';
4+
import { FluentBundle, FluentResource } from '../../fluent-bundle/src';
55
import ReactLocalization from '../src/localization';
66
import { withLocalization, LocalizationProvider } from '../src';
77

makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export SHELL := /bin/bash
22
export PATH := $(CURDIR)/node_modules/.bin:$(PATH)
33

44
TARGETS := all dist lint test build html deps depsclean
5-
PACKAGES := $(wildcard fluent*)
5+
PACKAGES := $(wildcard fluent-*)
66

77
$(TARGETS): $(PACKAGES)
88

tools/fluentfmt.js

+7-6
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,15 @@ function print(err, data) {
2626
return console.error('File not found: ' + err.path);
2727
}
2828

29-
const res = FluentSyntax.parse(data.toString());
29+
const source = data.toString();
30+
const res = FluentSyntax.parse(source, {withSpans: true});
3031
const pretty = FluentSyntax.serialize(res);
3132
console.log(pretty);
3233

3334
if (!program.silent) {
3435
res.body
3536
.filter(entry => entry.type === "Junk")
36-
.map(entry => printAnnotations(res.source, entry));
37+
.map(entry => printAnnotations(source, entry));
3738
}
3839
}
3940

@@ -45,17 +46,17 @@ function printAnnotations(source, junk) {
4546
}
4647

4748
function printAnnotation(source, span, annot) {
48-
const { name, message, pos } = annot;
49+
const { code, message, span: { start } } = annot;
4950
const slice = source.substring(span.start, span.end);
50-
const lineNumber = FluentSyntax.lineOffset(source, pos) + 1;
51-
const columnOffset = FluentSyntax.columnOffset(source, pos);
51+
const lineNumber = FluentSyntax.lineOffset(source, start) + 1;
52+
const columnOffset = FluentSyntax.columnOffset(source, start);
5253
const showLines = lineNumber - FluentSyntax.lineOffset(source, span.start);
5354
const lines = slice.split('\n');
5455
const head = lines.slice(0, showLines);
5556
const tail = lines.slice(showLines);
5657

5758
console.log();
58-
console.log(`! ${name} on line ${lineNumber}:`);
59+
console.log(`! ${code} on line ${lineNumber}:`);
5960
console.log(head.map(line => ` | ${line}`).join('\n'));
6061
console.log(` … ${indent(columnOffset)}^----- ${message}`);
6162
console.log(tail.map(line => ` | ${line}`).join('\n'));

tools/format.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const program = require('commander');
88

99
require = require('esm')(module);
1010
require('intl-pluralrules');
11-
const Fluent = require('../fluent/src');
11+
const Fluent = require('../fluent-bundle/src');
1212

1313
program
1414
.version('0.0.1')

tools/fuzz.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,13 @@ function fuzz(err, data) {
3030
return console.error('File not found: ' + err.path);
3131
}
3232

33-
const parse = program.runtime
34-
? require('../fluent/src/parser').default
35-
: require('../fluent-syntax/src').parse;
33+
let parse;
34+
if (program.runtime) {
35+
let {FluentResource} = require('../fluent-bundle/src');
36+
parse = source => new FluentResource(source);
37+
} else {
38+
parse = require('../fluent-syntax/src').parse;
39+
}
3640

3741
const source = data.toString();
3842
const mutations = new Set();

tools/parse.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function print(err, data) {
3535
}
3636

3737
function printRuntime(data) {
38-
const FluentResource = require('../fluent/src/resource').default;
38+
const FluentResource = require('../fluent-bundle/src/resource').default;
3939
const res = new FluentResource(data.toString());
4040
console.log(JSON.stringify(res, null, 4));
4141
}

tools/perf/benchmark.d8.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
load('../../fluent/index.js');
1+
load('../../fluent-bundle/index.js');
22
load('../../fluent-syntax/index.js');
33
load('./benchmark.common.js');
44

tools/perf/benchmark.jsshell.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
load('../../fluent/index.js');
1+
load('../../fluent-bundle/index.js');
22
load('../../fluent-syntax/index.js');
33
load('./benchmark.common.js');
44

tools/perf/benchmark.node.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const fs = require('fs');
22

3-
const FluentBundle = require('../../fluent');
3+
const FluentBundle = require('../../fluent-bundle');
44
const FluentSyntax = require('../../fluent-syntax');
55
const { runTest } = require('./benchmark.common');
66
require('intl-pluralrules');

0 commit comments

Comments
 (0)