Skip to content

Commit ac8dea9

Browse files
committed
Rename fluent/src/context.js to bundle.js
1 parent 840c7ce commit ac8dea9

18 files changed

+28
-28
lines changed

fluent/src/context.js renamed to fluent/src/bundle.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ import FluentResource from "./resource";
77
* format translation units (entities) to strings.
88
*
99
* Always use `FluentBundle.format` to retrieve translation units from a
10-
* context. Translations can contain references to other entities or variables,
10+
* bundle. Translations can contain references to other entities or variables,
1111
* conditional logic in form of select expressions, traits which describe their
1212
* grammatical features, and can use Fluent builtins which make use of the
1313
* `Intl` formatters to format numbers, dates, lists and more into the
14-
* context's language. See the documentation of the Fluent syntax for more
14+
* bundle's language. See the documentation of the Fluent syntax for more
1515
* information.
1616
*/
1717
export default class FluentBundle {
@@ -20,7 +20,7 @@ export default class FluentBundle {
2020
* Create an instance of `FluentBundle`.
2121
*
2222
* The `locales` argument is used to instantiate `Intl` formatters used by
23-
* translations. The `options` object can be used to configure the context.
23+
* translations. The `options` object can be used to configure the bundle.
2424
*
2525
* Examples:
2626
*
@@ -45,7 +45,7 @@ export default class FluentBundle {
4545
*
4646
* - `transform` - a function used to transform string parts of patterns.
4747
*
48-
* @param {string|Array<string>} locales - Locale or locales of the context
48+
* @param {string|Array<string>} locales - Locale or locales of the bundle
4949
* @param {Object} [options]
5050
* @returns {FluentBundle}
5151
*/
@@ -74,7 +74,7 @@ export default class FluentBundle {
7474
}
7575

7676
/*
77-
* Check if a message is present in the context.
77+
* Check if a message is present in the bundle.
7878
*
7979
* @param {string} id - The identifier of the message to check.
8080
* @returns {bool}
@@ -97,11 +97,11 @@ export default class FluentBundle {
9797
}
9898

9999
/**
100-
* Add a translation resource to the context.
100+
* Add a translation resource to the bundle.
101101
*
102102
* The translation resource must use the Fluent syntax. It will be parsed by
103-
* the context and each translation unit (message) will be available in the
104-
* context by its identifier.
103+
* the bundle and each translation unit (message) will be available in the
104+
* bundle by its identifier.
105105
*
106106
* bundle.addMessages('foo = Foo');
107107
* bundle.getMessage('foo');
@@ -120,7 +120,7 @@ export default class FluentBundle {
120120
}
121121

122122
/**
123-
* Add a translation resource to the context.
123+
* Add a translation resource to the bundle.
124124
*
125125
* The translation resource must be an instance of FluentResource,
126126
* e.g. parsed by `FluentResource.fromString`.
@@ -163,7 +163,7 @@ export default class FluentBundle {
163163
/**
164164
* Format a message to a string or null.
165165
*
166-
* Format a raw `message` from the context into a string (or a null if it has
166+
* Format a raw `message` from the bundle into a string (or a null if it has
167167
* a null value). `args` will be used to resolve references to variables
168168
* passed as arguments to the translation.
169169
*

fluent/src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*/
99

10-
export { default as FluentBundle } from "./context";
10+
export { default as FluentBundle } from "./bundle";
1111
export { default as FluentResource } from "./resource";
1212
export { FluentType, FluentNumber, FluentDateTime } from "./types";
1313

fluent/src/resolver.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* conditional logic in form of select expressions, traits which describe their
99
* grammatical features, and can use Fluent builtins which make use of the
1010
* `Intl` formatters to format numbers, dates, lists and more into the
11-
* context's language. See the documentation of the Fluent syntax for more
11+
* bundle's language. See the documentation of the Fluent syntax for more
1212
* information.
1313
*
1414
* In case of errors the resolver will try to salvage as much of the
@@ -36,7 +36,7 @@
3636
* This object stores a set of elements used by all resolve functions:
3737
*
3838
* * {FluentBundle} bundle
39-
* context for which the given resolution is happening
39+
* bundle for which the given resolution is happening
4040
* * {Object} args
4141
* list of developer provided arguments that can be used
4242
* * {Array} errors

fluent/test/arguments_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import assert from 'assert';
44

5-
import FluentBundle from '../src/context';
5+
import FluentBundle from '../src/bundle';
66
import { FluentType } from '../src/types';
77
import { ftl } from '../src/util';
88

fluent/test/attributes_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import assert from 'assert';
44

5-
import FluentBundle from '../src/context';
5+
import FluentBundle from '../src/bundle';
66
import { ftl } from '../src/util';
77

88
suite('Attributes', function() {

fluent/test/bomb_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import assert from 'assert';
44

5-
import FluentBundle from '../src/context';
5+
import FluentBundle from '../src/bundle';
66
import { ftl } from '../src/util';
77

88
suite('Reference bombs', function() {

fluent/test/constructor_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import assert from 'assert';
44
import sinon from 'sinon';
55

6-
import FluentBundle from '../src/context';
6+
import FluentBundle from '../src/bundle';
77
import { ftl } from '../src/util';
88

99
suite('FluentBundle constructor', function() {

fluent/test/context_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import assert from 'assert';
44

5-
import FluentBundle from '../src/context';
5+
import FluentBundle from '../src/bundle';
66
import FluentResource from '../src/resource';
77
import { ftl } from '../src/util';
88

fluent/test/functions_builtin_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import assert from 'assert';
44

5-
import FluentBundle from '../src/context';
5+
import FluentBundle from '../src/bundle';
66
import { ftl } from '../src/util';
77

88
suite('Built-in functions', function() {

fluent/test/functions_runtime_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import assert from 'assert';
44

5-
import FluentBundle from '../src/context';
5+
import FluentBundle from '../src/bundle';
66
import { ftl } from '../src/util';
77

88
suite('Runtime-specific functions', function() {

fluent/test/functions_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import assert from 'assert';
44

5-
import FluentBundle from '../src/context';
5+
import FluentBundle from '../src/bundle';
66
import { ftl } from '../src/util';
77

88
suite('Functions', function() {

fluent/test/isolating_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import assert from 'assert';
44

5-
import FluentBundle from '../src/context';
5+
import FluentBundle from '../src/bundle';
66
import { ftl } from '../src/util';
77

88
// Unicode bidi isolation characters.

fluent/test/patterns_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import assert from 'assert';
44

5-
import FluentBundle from '../src/context';
5+
import FluentBundle from '../src/bundle';
66
import { ftl } from '../src/util';
77

88
suite('Patterns', function(){

fluent/test/primitives_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import assert from 'assert';
44

5-
import FluentBundle from '../src/context';
5+
import FluentBundle from '../src/bundle';
66
import { ftl } from '../src/util';
77

88
suite('Primitives', function() {

fluent/test/select_expressions_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import assert from 'assert';
44

5-
import FluentBundle from '../src/context';
5+
import FluentBundle from '../src/bundle';
66
import { ftl } from '../src/util';
77

88
suite('Select expressions', function() {

fluent/test/transform_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import assert from 'assert';
44

5-
import FluentBundle from '../src/context';
5+
import FluentBundle from '../src/bundle';
66
import { ftl } from '../src/util';
77

88
suite('Transformations', function(){

fluent/test/values_format_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import assert from 'assert';
44

5-
import FluentBundle from '../src/context';
5+
import FluentBundle from '../src/bundle';
66
import { ftl } from '../src/util';
77

88
suite('Formatting values', function(){

fluent/test/values_ref_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import assert from 'assert';
44

5-
import FluentBundle from '../src/context';
5+
import FluentBundle from '../src/bundle';
66
import { ftl } from '../src/util';
77

88
suite('Referencing values', function(){

0 commit comments

Comments
 (0)