@@ -2,6 +2,7 @@ import { deepEqual as equal, ok } from "assert/strict";
2
2
import { Application } from ".." ;
3
3
import { readdirSync } from "fs" ;
4
4
import { join } from "path" ;
5
+ import { translatable } from "../lib/internationalization/translatable" ;
5
6
6
7
describe ( "Internationalization" , ( ) => {
7
8
let app : Application ;
@@ -14,10 +15,10 @@ describe("Internationalization", () => {
14
15
} ) ;
15
16
16
17
it ( "Supports getting the list of supported languages" , ( ) => {
17
- equal (
18
- app . internationalization . getSupportedLanguages ( ) . sort ( ) ,
19
- [ "en" , "zh" , "jp" , " ko", "test" ] . sort ( ) ,
20
- ) ;
18
+ const langs = app . internationalization . getSupportedLanguages ( ) ;
19
+ ok ( langs . includes ( "en" ) ) ;
20
+ ok ( langs . includes ( " ko") ) ;
21
+ ok ( langs . includes ( "jp" ) ) ;
21
22
} ) ;
22
23
23
24
it ( "Supports translating without placeholders" , ( ) => {
@@ -62,6 +63,11 @@ describe("Locales", () => {
62
63
`${ key } translation references "${ placeholder [ 0 ] } " which will not be available at runtime.` ,
63
64
) ;
64
65
}
66
+
67
+ ok (
68
+ key in translatable ,
69
+ `${ locale } defines translation key ${ key } , which is not available in the default locale.` ,
70
+ ) ;
65
71
}
66
72
} ) ;
67
73
}
0 commit comments