Skip to content

Commit e5b1f13

Browse files
Merge branch 'master' into microsoft/samirpuranik/telemetry-init
2 parents 562d984 + bcde9ae commit e5b1f13

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+18516
-328
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
pgsqltoolsservice
22
node_modules
33
out
4+
*nls.*.json
45
*.vsix
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
trigger:
2+
batch: true
3+
branches:
4+
include:
5+
- master
6+
paths:
7+
include:
8+
- src/l10n/l10n.xlf
9+
- src/loc
10+
11+
pr: none
12+
13+
resources:
14+
repositories:
15+
- repository: self
16+
type: git
17+
ref: refs/heads/main
18+
19+
jobs:
20+
- job: localization
21+
displayName: localization
22+
pool:
23+
vmImage: windows-latest
24+
steps:
25+
- checkout: self
26+
clean: true
27+
fetchTags: true
28+
- task: OneLocBuild@2
29+
displayName: Localization Build
30+
inputs:
31+
locProj: src/LocProject.json
32+
outDir: $(Build.ArtifactStagingDirectory)
33+
isCreatePrSelected: true
34+
repoType: gitHub
35+
gitHubPatVariable: $(githubPatToken)
36+
prSourceBranchPrefix: locfiles
37+
gitHubPrMergeMethod: squash
38+
packageSourceAuth: patAuth
39+
patVariable: $(OneLocBuildPat)
40+
- task: PublishBuildArtifacts@1
41+
displayName: 'Publish Artifact: drop'

.pipeline/release-pipeline.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
trigger:
2-
- release
1+
trigger: none
32
pr: none
43
jobs:
54
- job: build_artifacts

.pipeline/snap-pipeline.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
trigger: none
2-
pr:
3-
- release
2+
pr: none
43
jobs:
54
- job: build_artifacts
65
displayName: Build and Publish Artifacts
76
pool:
87
vmImage: 'windows-latest'
98
steps:
10-
- template: templates/build-snap.yml
9+
- template: templates/build.yml
1110
- template: templates/code-sign.yml
1211
- task: CopyFiles@2
1312
condition: always()

.pipeline/templates/build-snap.yml

Lines changed: 0 additions & 51 deletions
This file was deleted.

.pipeline/templates/code-sign.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ steps:
22
- task: EsrpCodeSigning@3
33
displayName: 'Code Signing'
44
inputs:
5-
ConnectedServiceName: 'Database System ESRP Connector'
5+
ConnectedServiceName: 'OrcaSQL ESRP Code Sign'
66
FolderPath: '$(Build.SourcesDirectory)'
77
Pattern: '*.vsix'
88
useMinimatch: true
@@ -28,5 +28,4 @@ steps:
2828
]
2929
SessionTimeout: '60'
3030
MaxConcurrency: '50'
31-
MaxRetryAttempts: '5'
32-
condition: eq(variables['platform'], 'windows')
31+
MaxRetryAttempts: '5'

gulpfile.js

Lines changed: 68 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,72 @@ var srcmap = require('gulp-sourcemaps');
99
var config = require('./tasks/config');
1010
var cproc = require('child_process');
1111
var nls = require('vscode-nls-dev');
12-
12+
const path = require('path');
13+
const es = require('event-stream')
1314
require('./tasks/packagetasks')
1415

15-
const languages = [ /* for example { folderName: 'ru', id: 'ru' } */ ];
16+
const languages = [
17+
{ id: 'zh-tw', folderName: 'cht', localeId: 'zh-Hant'},
18+
{ id: 'zh-cn', folderName: 'chs', localeId: 'zh-Hans'},
19+
{ id: 'ja', folderName: 'jpn' },
20+
{ id: 'ko', folderName: 'kor' },
21+
{ id: 'de', folderName: 'deu' },
22+
{ id: 'fr', folderName: 'fra' },
23+
{ id: 'es', folderName: 'esn' },
24+
{ id: 'ru', folderName: 'rus' },
25+
{ id: 'it', folderName: 'ita' },
26+
{ id: 'pt-BR', folderName: 'ptb'}
27+
];
28+
29+
const cleanTask = function() {
30+
return del(['out/**', 'package.nls.*.json']);
31+
}
32+
33+
const addI18nTask = function() {
34+
return gulp.src(['package.nls.json'])
35+
.pipe(nls.createAdditionalLanguageFiles(languages, 'i18n'))
36+
.pipe(gulp.dest('.'));
37+
};
38+
39+
// Creates an xlf file containing all the localized strings. This file is picked by translation pipeline.
40+
const exporti18n = function() {
41+
return gulp.src(['package.nls.json', 'out/nls.metadata.header.json', 'out/nls.metadata.json'])
42+
.pipe(nls.createXlfFiles("l10n", "l10n"))
43+
.pipe(gulp.dest(path.join('src')));
44+
};
45+
46+
// Use the returned xlf files for all languages and fill i18n dir with respective lang files in respective lang dir.
47+
const importi18n = function() {
48+
return Promise.resolve(es.merge(languages.map(language => {
49+
let languageId = language.localeId || language.id;
50+
return gulp.src(`src/l10n/transXlf/l10n.${languageId}.xlf`, { allowEmpty: true })
51+
.pipe(nls.prepareJsonFiles())
52+
.pipe(gulp.dest(path.join('./i18n', language.folderName)));
53+
})));
54+
}
55+
56+
// generate metadata containing all localized files in src directory, to be used later by exporti18n task to create an xlf file.
57+
gulp.task('generate-metadata', (done) => {
58+
return gulp.src([
59+
config.paths.project.root + '/src/**/*.ts',
60+
config.paths.project.root + '/src/**/*.js'])
61+
.pipe(srcmap.init())
62+
.pipe(tsProject())
63+
.on('error', function() {
64+
if (process.env.BUILDMACHINE) {
65+
done('Extension Tests failed to build. See Above.');
66+
process.exit(1);
67+
}
68+
})
69+
.pipe(nls.rewriteLocalizeCalls())
70+
.pipe(nls.bundleMetaDataFiles('postgresql-extension', 'out'))
71+
.pipe(nls.bundleLanguageFiles())
72+
.pipe(srcmap.write('.', {
73+
sourceRoot: function(file){ return file.cwd + '/src'; }
74+
}))
75+
.pipe(gulp.dest('out/'));
76+
});
77+
1678

1779
gulp.task('ext:lint', () => {
1880
return gulp.src([
@@ -26,12 +88,6 @@ gulp.task('ext:lint', () => {
2688
.pipe(tslint.report());
2789
});
2890

29-
gulp.task('localization:process-package-json', function () {
30-
return gulp.src(['package.nls.json'])
31-
.pipe(nls.createAdditionalLanguageFiles(languages, 'i18n'))
32-
.pipe(gulp.dest('.'));
33-
});
34-
3591
gulp.task('ext:compile-src', (done) => {
3692
return gulp.src([
3793
config.paths.project.root + '/src/**/*.ts',
@@ -71,7 +127,9 @@ gulp.task('ext:compile-tests', (done) => {
71127

72128
});
73129

74-
gulp.task('ext:compile', gulp.series('ext:compile-src', 'ext:compile-tests'));
130+
gulp.task('ext:localize', gulp.series(cleanTask, 'generate-metadata', exporti18n));
131+
132+
gulp.task('ext:compile', gulp.series(importi18n, cleanTask, 'ext:compile-src', addI18nTask, 'ext:compile-tests'));
75133

76134
gulp.task('ext:copy-tests', () => {
77135
return gulp.src(config.paths.project.root + '/test/resources/**/*')
@@ -122,7 +180,7 @@ gulp.task('clean', function (done) {
122180
return del('out', done);
123181
});
124182

125-
gulp.task('build', gulp.series('clean', 'ext:build', 'localization:process-package-json'));
183+
gulp.task('build', gulp.series('clean', 'ext:build'));
126184

127185
gulp.task('watch', function(){
128186
return gulp.watch(config.paths.project.root + '/src/**/*', gulp.series('build'))

i18n/chs/package.i18n.json

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
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+
// Do not edit this file. It is machine generated.
6+
{
7+
"json.schemas.desc": "将架构关联到当前项目中的 JSON 文件",
8+
"json.schemas.url.desc": "架构的 URL 或当前目录中架构的相对路径",
9+
"json.schemas.fileMatch.desc": "将 JSON 文件解析到架构时用于匹配的一组文件模式。",
10+
"json.schemas.fileMatch.item.desc": "将 JSON 文件解析到架构时用于匹配的可以包含 \"*\" 的文件模式。",
11+
"json.schemas.schema.desc": "给定 URL 的架构定义。仅当要避免访问架构 URL 时需要提供架构。",
12+
"json.format.enable.desc": "启用/禁用默认 JSON 格式化程序(需要重启)",
13+
"postgres.description": "适用于 Azure Data Studio 的 PostgreSQL 扩展",
14+
"postgres.logDebugInfo.description": "[可选] 将调试输出记录到 VS Code 控制台(“帮助”->“切换开发人员工具”)",
15+
"postgres.configuration.title": "PostgreSQL 配置",
16+
"postgres.enabled.description": "[可选] 启用 PostgreSQL 支持(当前正在开发中)",
17+
"postgres.debugSourcePath.description": "[可选] PG SQL 工具服务源目录的路径,用于调试",
18+
"postgres.useDebugSource.description": "[可选] 通过在 pgsql.debugSourcePath 中设置的路径支持运行 PostgreSQL 扩展",
19+
"postgres.enableStartupDebugging.description": "[可选] 是否将 PG SQL 工具服务设置为在启动时等待调试器附加",
20+
"postgres.debugServerPort.description": "[可选] 要运行 PG SQL 工具服务远程调试器的端口(默认值为 3000)",
21+
"postgres.defaultDatabase.description": "创建新的 PostgreSQL 连接时要使用的默认数据库",
22+
"postgres.format.keywordCase.description": "[可选] 更改关键字的格式设置方式。允许的值为“大写”、“小写”和“首字母大写”。",
23+
"postgres.format.identifierCase.description": "[可选] 更改标识符的格式设置方式。允许的值为“大写”、“小写”和“首字母大写”。",
24+
"postgres.format.stripComments.description": "[可选] 如果为 true,则从语句中移除注释",
25+
"postgres.format.reindent.description": "[可选] 如果为 true,则更改语句的缩进。",
26+
"postgres.provider.displayName": "PostgreSQL",
27+
"postgres.connectionOptions.groupName.source": "",
28+
"postgres.connectionOptions.groupName.security": "安全性",
29+
"postgres.connectionOptions.groupName.server": "服务器",
30+
"postgres.connectionOptions.groupName.client": "客户端",
31+
"postgres.connectionOptions.groupName.ssl": "SSL",
32+
"postgres.connectionOptions.connectionName.displayName": "名称(可选)",
33+
"postgres.connectionOptions.connectionName.description": "连接的自定义名称",
34+
"postgres.connectionOptions.host.displayName": "服务器名称",
35+
"postgres.connectionOptions.host.description": "PostgreSQL 实例的名称",
36+
"postgres.connectionOptions.authenticationType.displayName": "身份验证类型",
37+
"postgres.connectionOptions.authenticationType.description": "如何向服务器进行身份验证。",
38+
"postgres.connectionOptions.authenticationType.password": "密码",
39+
"postgres.connectionOptions.authenticationType.azuremfaanduser": "Azure Active Directory",
40+
"postgres.connectionOptions.dbname.displayName": "数据库名称",
41+
"postgres.connectionOptions.dbname.description": "数据源中的初始目录或数据库的名称。",
42+
"postgres.connectionOptions.user.displayName": "用户名",
43+
"postgres.connectionOptions.user.description": "指示连接到数据源时使用的用户 ID",
44+
"postgres.connectionOptions.password.displayName": "密码",
45+
"postgres.connectionOptions.password.description": "指示连接到数据源时使用的密码",
46+
"postgres.connectionOptions.hostIp.displayName": "主机 IP 地址",
47+
"postgres.connectionOptions.hostIp.description": "服务器的 IP 地址",
48+
"postgres.connectionOptions.port.displayName": "端口",
49+
"postgres.connectionOptions.port.description": "服务器端口号",
50+
"postgres.connectionOptions.connectTimeout.displayName": "连接超时",
51+
"postgres.connectionOptions.connectTimeout.description": "连接时超时之前要等待的秒数",
52+
"postgres.connectionOptions.clientEncoding.displayName": "客户端编码",
53+
"postgres.connectionOptions.clientEncoding.description": "用于连接的客户端编码",
54+
"postgres.connectionOptions.options.displayName": "命令行选项",
55+
"postgres.connectionOptions.options.description": "连接启动时发送到服务器的命令行选项",
56+
"postgres.connectionOptions.applicationName.displayName": "应用程序名称",
57+
"postgres.connectionOptions.applicationName.description": "\"application_name\" 配置参数的值",
58+
"postgres.connectionOptions.ssl.displayName": "SSL 模式",
59+
"postgres.connectionOptions.ssl.description": "连接时要使用的 SSL 模式",
60+
"postgres.connectionOptions.ssl.mode.disable": "Disable",
61+
"postgres.connectionOptions.ssl.mode.require": "Require",
62+
"postgres.connectionOptions.ssl.mode.allow": "Allow",
63+
"postgres.connectionOptions.ssl.mode.prefer": "Prefer",
64+
"postgres.connectionOptions.ssl.mode.verify_ca": "Verify-CA",
65+
"postgres.connectionOptions.ssl.mode.verify_full": "Verify-Full",
66+
"postgres.connectionOptions.ssl.compression.displayName": "使用 SSL 压缩",
67+
"postgres.connectionOptions.ssl.compression.description": "是否压缩 SSL 连接",
68+
"postgres.connectionOptions.ssl.rootcert.displayName": "SSL 根证书文件名",
69+
"postgres.connectionOptions.ssl.rootcert.description": "要使用的 SSL 根 CA 证书的文件名",
70+
"postgres.connectionOptions.ssl.key.displayName": "SSL 密钥文件名",
71+
"postgres.connectionOptions.ssl.key.description": "用于 SSL 证书的密钥的文件名",
72+
"postgres.connectionOptions.ssl.cert.displayName": "SSL 证书文件名",
73+
"postgres.connectionOptions.ssl.cert.description": "要使用的 SSL 证书的文件名",
74+
"postgres.connectionOptions.ssl.crl.displayName": "SSL CRL 文件名",
75+
"postgres.connectionOptions.ssl.crl.description": "要使用的 SSL 证书吊销列表的文件名",
76+
"postgres.connectionOptions.requirepeer.displayName": "需要对等机",
77+
"postgres.connectionOptions.requirepeer.description": "服务器进程的必需用户名",
78+
"postgres.connectionOptions.service.displayName": "服务名称",
79+
"postgres.connectionOptions.service.description": "用于连接参数的 pg_service.conf 中的服务名称",
80+
"postgres.resourceDeployment.displayName": "Azure Database for PostgreSQL",
81+
"postgres.resourceDeployment.description": "创建 Azure Database for PostgreSQL 灵活服务器 - Azure 上完全托管的 PostgreSQL 数据库即服务。",
82+
"postgres.resourceDeployment.okButtonText": "在 Azure 门户中创建",
83+
"postgres.resourceDeployment.agreements.template": "我接受 {0} 和 {1}。",
84+
"postgres.resourceDeployment.helpTexts.template": "Azure Database for PostgreSQL 灵活服务器是由 PostgreSQL 社区版提供支持的关系数据库服务。它是一种完全托管的数据库即服务产品,可通过可预测的性能和动态可伸缩性处理任务关键型工作负载。此外,它旨在让你能够更精细地控制且更灵活地使用数据库管理功能和配置设置。{0}",
85+
"microsoft.azure.termsOfUse": "Microsoft Azure 使用条款",
86+
"microsoft.privacy.statement": "Microsoft 隐私声明",
87+
"learnMore": "了解详细信息。",
88+
"postgres.command.buildAll": "生成所有 PostgreSQL 项目",
89+
"postgres.command.buildCurrent": "生成 PostgreSQL 项目",
90+
"postgres.command.newProject": "新建 PostgreSQL 项目",
91+
"postgres.command.deploy": "部署"
92+
}

0 commit comments

Comments
 (0)