Skip to content

Commit

Permalink
Switch bundles and langs inside i18n to variables again
Browse files Browse the repository at this point in the history
  • Loading branch information
hgiesel committed Oct 4, 2021
1 parent 0a96776 commit 72256f0
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
4 changes: 2 additions & 2 deletions ts/lib/i18n/bundles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import type { FluentBundle, FluentVariable } from "@fluent/bundle";

let bundles: FluentBundle[] = [];

export function setBundles(...newBundles: FluentBundle[]): void {
bundles.splice(0, bundles.length, ...newBundles);
export function setBundles(newBundles: FluentBundle[]): void {
bundles = newBundles;
}

export function firstLanguage(): string {
Expand Down
1 change: 0 additions & 1 deletion ts/lib/i18n/translate.ts

This file was deleted.

4 changes: 2 additions & 2 deletions ts/lib/i18n/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,6 @@ export async function setupI18n(args: { modules: ModuleName[] }): Promise<void>
newBundles.push(bundle);
}

setBundles(...newBundles);
langs.splice(0, langs.length, ...json.langs);
setBundles(newBundles);
langs = json.langs;
}
6 changes: 1 addition & 5 deletions ts/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@
"composite": true,
"target": "es6",
"module": "es2020",
"lib": [
"es2020",
"dom",
"dom.iterable"
],
"lib": ["es2020", "dom", "dom.iterable"],
// uncomment for building with tsc directly
// "outDir": "dist",
// "rootDir": "..",
Expand Down

0 comments on commit 72256f0

Please sign in to comment.