-
Notifications
You must be signed in to change notification settings - Fork 137
/
Copy pathgetScriptResourcesLanguage.test.ts
34 lines (30 loc) · 2.07 KB
/
getScriptResourcesLanguage.test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as assert from 'assert';
import { getScriptResourcesLanguage } from '../extension.bundle';
async function verifyLanguage(vscodeLanguage: string, expected: string): Promise<void> {
assert.equal(getScriptResourcesLanguage(vscodeLanguage), expected);
}
suite('getScriptResourcesLanguage', () => {
// list of VS Code locales: https://code.visualstudio.com/docs/getstarted/locales
test('en', async () => { await verifyLanguage('en', 'en-US'); });
test('zh-CN', async () => { await verifyLanguage('zh-CN', 'zh-CN'); });
test('zh-TW', async () => { await verifyLanguage('zh-TW', 'zh-TW'); });
test('fr', async () => { await verifyLanguage('fr', 'fr-FR'); });
test('de', async () => { await verifyLanguage('de', 'de-DE'); });
test('it', async () => { await verifyLanguage('it', 'it-IT'); });
test('es', async () => { await verifyLanguage('es', 'es-ES'); });
test('ja', async () => { await verifyLanguage('ja', 'ja-JP'); });
test('ko', async () => { await verifyLanguage('ko', 'ko-KR'); });
test('ru', async () => { await verifyLanguage('ru', 'ru-RU'); });
test('bg', async () => { await verifyLanguage('bg', 'en-US'); }); // not translated in templates for some reason
test('hu', async () => { await verifyLanguage('hu', 'hu-HU'); });
test('pt-br', async () => { await verifyLanguage('pt-br', 'pt-BR'); });
test('tr', async () => { await verifyLanguage('tr', 'tr-TR'); });
// A few extra cases that might be possible, but aren't covered by current lists of locales
test('pt-pt', async () => { await verifyLanguage('pt-pt', 'pt-PT'); });
test('unknown', async () => { await verifyLanguage('unknown', 'en-US'); });
test('empty', async () => { await verifyLanguage('', 'en-US'); });
});