| 1 |
/*--------------------------------------------------------------------------------------------- |
| 2 |
* Copyright (c) Microsoft Corporation. All rights reserved. |
| 3 |
* Licensed under the MIT License. See License.txt in the project root for license information. |
| 4 |
*--------------------------------------------------------------------------------------------*/ |
| 5 |
|
| 6 |
export interface ILocalizeInfo { |
| 7 |
key: string; |
| 8 |
comment: string[]; |
| 9 |
} |
| 10 |
|
| 11 |
export function localize(info: ILocalizeInfo | string, message: string, ...args: (string | number | boolean | undefined | null)[]): string { |
| 12 |
return message; |
| 13 |
} |
| 14 |
|
| 15 |
export interface INLSLanguagePackConfiguration { |
| 16 |
|
| 17 |
/** |
| 18 |
* The path to the translations config file that contains pointers to |
| 19 |
* all message bundles for `main` and extensions. |
| 20 |
*/ |
| 21 |
readonly translationsConfigFile: string; |
| 22 |
|
| 23 |
/** |
| 24 |
* The path to the file containing the translations for this language |
| 25 |
* pack as flat string array. |
| 26 |
*/ |
| 27 |
readonly messagesFile: string; |
| 28 |
|
| 29 |
/** |
| 30 |
* The path to the file that can be used to signal a corrupt language |
| 31 |
* pack, for example when reading the `messagesFile` fails. This will |
| 32 |
* instruct the application to re-create the cache on next startup. |
| 33 |
*/ |
| 34 |
readonly corruptMarkerFile: string; |
| 35 |
} |
| 36 |
|
| 37 |
export interface INLSConfiguration { |
| 38 |
|
| 39 |
/** |
| 40 |
* Locale as defined in `argv.json` or `app.getLocale()`. |
| 41 |
*/ |
| 42 |
readonly userLocale: string; |
| 43 |
|
| 44 |
/** |
| 45 |
* Locale as defined by the OS (e.g. `app.getPreferredSystemLanguages()`). |
| 46 |
*/ |
| 47 |
readonly osLocale: string; |
| 48 |
|
| 49 |
/** |
| 50 |
* The actual language of the UI that ends up being used considering `userLocale` |
| 51 |
* and `osLocale`. |
| 52 |
*/ |
| 53 |
readonly resolvedLanguage: string; |
| 54 |
|
| 55 |
/** |
| 56 |
* Defined if a language pack is used that is not the |
| 57 |
* default english language pack. This requires a language |
| 58 |
* pack to be installed as extension. |
| 59 |
*/ |
| 60 |
readonly languagePack?: INLSLanguagePackConfiguration; |
| 61 |
|
| 62 |
/** |
| 63 |
* The path to the file containing the default english messages |
| 64 |
* as flat string array. The file is only present in built |
| 65 |
* versions of the application. |
| 66 |
*/ |
| 67 |
readonly defaultMessagesFile: string; |
| 68 |
|
| 69 |
/** |
| 70 |
* Below properties are deprecated and only there to continue support |
| 71 |
* for `vscode-nls` module that depends on them. |
| 72 |
* Refs https://github.com/microsoft/vscode-nls/blob/main/src/node/main.ts#L36-L46 |
| 73 |
*/ |
| 74 |
/** @deprecated */ |
| 75 |
readonly locale: string; |
| 76 |
/** @deprecated */ |
| 77 |
readonly availableLanguages: Record<string, string>; |
| 78 |
/** @deprecated */ |
| 79 |
readonly _languagePackSupport?: boolean; |
| 80 |
/** @deprecated */ |
| 81 |
readonly _languagePackId?: string; |
| 82 |
/** @deprecated */ |
| 83 |
readonly _translationsConfigFile?: string; |
| 84 |
/** @deprecated */ |
| 85 |
readonly _cacheRoot?: string; |
| 86 |
/** @deprecated */ |
| 87 |
readonly _resolvedLanguagePackCoreLocation?: string; |
| 88 |
/** @deprecated */ |
| 89 |
readonly _corruptedFile?: string; |
| 90 |
} |