Skip to content

Commit 63fdf92

Browse files
authored
Using the localized texts in UI (#979)
* Making the constants used in views and also the commands and settings localizable
1 parent d786cbe commit 63fdf92

23 files changed

+594
-90
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ coverage
1717
test-reports
1818
.vscode-test
1919
localization/i18n/
20-
src/constants/localizedConstants.ts
20+
src/constants/localizedConstants.ts
21+
package.nls.*.json

gulpfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ gulp.task('ext:copy-appinsights', () => {
120120

121121
gulp.task('ext:copy', gulp.series('ext:copy-tests', 'ext:copy-js', 'ext:copy-config'));
122122

123-
gulp.task('ext:localization', gulp.series('ext:localization:xliff-to-ts', 'ext:localization:xliff-to-json'));
123+
gulp.task('ext:localization', gulp.series('ext:localization:xliff-to-ts', 'ext:localization:xliff-to-json', 'ext:localization:xliff-to-package.nls'));
124124

125125
gulp.task('ext:build', gulp.series('ext:localization', 'ext:lint', 'ext:compile', 'ext:copy'));
126126

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" ?>
2+
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
3+
<file datatype="xml" original="extension.i18ntest.JSON" source-language="en" target-language="zh-Hans">
4+
<body>
5+
</body>
6+
</file>
7+
</xliff>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" ?>
2+
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
3+
<file datatype="xml" original="extension.i18ntest.JSON" source-language="en" target-language="zh-Hant">
4+
<body>
5+
</body>
6+
</file>
7+
</xliff>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" ?>
2+
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
3+
<file datatype="xml" original="extension.i18ntest.JSON" source-language="en" target-language="de">
4+
<body>
5+
</body>
6+
</file>
7+
</xliff>

localization/xliff/enu/constants/localizedConstants.enu.xlf

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,48 @@
293293
<trans-unit id="noActiveEditorMsg">
294294
<source xml:lang="en">A SQL editor must have focus before executing this command</source>
295295
</trans-unit>
296+
<trans-unit id="maximizeLabel">
297+
<source xml:lang="en">Maximize</source>
298+
</trans-unit>
299+
<trans-unit id="restoreLabel">
300+
<source xml:lang="en">Restore</source>
301+
</trans-unit>
302+
<trans-unit id="saveCSVLabel">
303+
<source xml:lang="en">Save as CSV</source>
304+
</trans-unit>
305+
<trans-unit id="saveJSONLabel">
306+
<source xml:lang="en">Save as JSON</source>
307+
</trans-unit>
308+
<trans-unit id="saveExcelLabel">
309+
<source xml:lang="en">Save as Excel</source>
310+
</trans-unit>
311+
<trans-unit id="resultPaneLabel">
312+
<source xml:lang="en">Results</source>
313+
</trans-unit>
314+
<trans-unit id="selectAll">
315+
<source xml:lang="en">Select all</source>
316+
</trans-unit>
317+
<trans-unit id="copyLabel">
318+
<source xml:lang="en">Copy</source>
319+
</trans-unit>
320+
<trans-unit id="copyWithHeadersLabel">
321+
<source xml:lang="en">Copy with Headers</source>
322+
</trans-unit>
323+
<trans-unit id="executeQueryLabel">
324+
<source xml:lang="en">Executing query...</source>
325+
</trans-unit>
326+
<trans-unit id="messagePaneLabel">
327+
<source xml:lang="en">Messages</source>
328+
</trans-unit>
329+
<trans-unit id="lineSelectorFormatted">
330+
<source xml:lang="en">Line {0}</source>
331+
</trans-unit>
332+
<trans-unit id="elapsedTimeLabel">
333+
<source xml:lang="en">Total execution time: {0}</source>
334+
</trans-unit>
335+
<trans-unit id="msgCannotSaveMultipleSelections">
336+
<source xml:lang="en">Save results command cannot be used with multiple selections.</source>
337+
</trans-unit>
296338
</body>
297339
</file>
298340
</xliff>
Lines changed: 199 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
1+
<?xml version="1.0" ?>
2+
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
3+
<file datatype="xml" original="extension.i18ntest.JSON" source-language="en">
4+
<body>
5+
<trans-unit id="extension.runQuery">
6+
<source xml:lang="en">Execute Query</source>
7+
</trans-unit>
8+
<trans-unit id="extension.runCurrentStatement">
9+
<source xml:lang="en">Execute Current Statement</source>
10+
</trans-unit>
11+
<trans-unit id="extension.cancelQuery">
12+
<source xml:lang="en">Cancel Query</source>
13+
</trans-unit>
14+
<trans-unit id="extension.connect">
15+
<source xml:lang="en">Connect</source>
16+
</trans-unit>
17+
<trans-unit id="extension.disconnect">
18+
<source xml:lang="en">Disconnect</source>
19+
</trans-unit>
20+
<trans-unit id="extension.manageProfiles">
21+
<source xml:lang="en">Manage Connection Profiles</source>
22+
</trans-unit>
23+
<trans-unit id="extension.chooseDatabase">
24+
<source xml:lang="en">Use Database</source>
25+
</trans-unit>
26+
<trans-unit id="extension.showGettingStarted">
27+
<source xml:lang="en">Getting Started Guide</source>
28+
</trans-unit>
29+
<trans-unit id="extension.newQuery">
30+
<source xml:lang="en">New Query</source>
31+
</trans-unit>
32+
<trans-unit id="extension.rebuildIntelliSenseCache">
33+
<source xml:lang="en">Refresh IntelliSense Cache</source>
34+
</trans-unit>
35+
<trans-unit id="mssql.logDebugInfo">
36+
<source xml:lang="en">[Optional] Log debug output to the VS Code console (Help -> Toggle Developer Tools)</source>
37+
</trans-unit>
38+
<trans-unit id="mssql.maxRecentConnections">
39+
<source xml:lang="en">The maximum number of recently used connections to store in the connection list.</source>
40+
</trans-unit>
41+
<trans-unit id="mssql.connections">
42+
<source xml:lang="en">Connection profiles defined in 'User Settings' are shown under 'MS SQL: Connect' command in the command palette.</source>
43+
</trans-unit>
44+
<trans-unit id="mssql.connection.server">
45+
<source xml:lang="en"><![CDATA[[Required] Specify the server name to connect to. Use 'hostname\\instance' or '<server>.database.windows.net' for Azure SQL Database.]]></source>
46+
</trans-unit>
47+
<trans-unit id="mssql.connection.database">
48+
<source xml:lang="en">[Optional] Specify the database name to connect to. If database is not specified, the default user database setting is used, typically 'master'.</source>
49+
</trans-unit>
50+
<trans-unit id="mssql.connection.user">
51+
<source xml:lang="en">[Optional] Specify the user name for SQL Server authentication. If user name is not specified, when you connect, you will be asked again.</source>
52+
</trans-unit>
53+
<trans-unit id="mssql.connection.password">
54+
<source xml:lang="en">[Optional] Specify the password for SQL Server authentication. If password is not specified or already saved, when you connect, you will be asked again.</source>
55+
</trans-unit>
56+
<trans-unit id="mssql.connection.authenticationType">
57+
<source xml:lang="en">[Optional] Specify the SQL Server authentication type.</source>
58+
</trans-unit>
59+
<trans-unit id="mssql.connection.port">
60+
<source xml:lang="en">[Optional] Specify the port number to connect to.</source>
61+
</trans-unit>
62+
<trans-unit id="mssql.connection.encrypt">
63+
<source xml:lang="en">[Optional] When set to 'true', SQL Server uses SSL encryption for data sent between the client and the server if the server has a certificate installed. Set 'true' for Azure SQL Database connection.</source>
64+
</trans-unit>
65+
<trans-unit id="mssql.connection.trustServerCertificate">
66+
<source xml:lang="en">[Optional] When set to 'true', the SQL Server SSL certificate is automatically trusted when the communication layer is encrypted using SSL. Set 'false' for Azure SQL Database connection.</source>
67+
</trans-unit>
68+
<trans-unit id="mssql.connection.persistSecurityInfo">
69+
<source xml:lang="en">[Optional] When set to false, security-sensitive information, such as the password, is not returned as part of the connection if the connection is open or has ever been in an open state.</source>
70+
</trans-unit>
71+
<trans-unit id="mssql.connection.connectTimeout">
72+
<source xml:lang="en">[Optional] Specify the length of time in seconds to wait for a connection to the server before it times out. The default timeout value for Azure SQL Database is 30.</source>
73+
</trans-unit>
74+
<trans-unit id="mssql.connection.connectRetryCount">
75+
<source xml:lang="en">[Optional] Specify the number of attempts to restore connection.</source>
76+
</trans-unit>
77+
<trans-unit id="mssql.connection.connectRetryInterval">
78+
<source xml:lang="en">[Optional] Specify the delay between attempts to restore connection.</source>
79+
</trans-unit>
80+
<trans-unit id="mssql.connection.workstationId">
81+
<source xml:lang="en">[Optional] Specify the name of the workstation connecting to SQL Server.</source>
82+
</trans-unit>
83+
<trans-unit id="mssql.connection.applicationIntent">
84+
<source xml:lang="en">[Optional] Declares the application workload type when connecting to SQL Server such as ReadWrite or ReadOnly. Refer to SQL Server AlwaysOn for more detail.</source>
85+
</trans-unit>
86+
<trans-unit id="mssql.connection.currentLanguage">
87+
<source xml:lang="en">[Optional] Indicates the SQL Server language settings.</source>
88+
</trans-unit>
89+
<trans-unit id="mssql.connection.pooling">
90+
<source xml:lang="en">[Optional] When set to 'true', the connection object is drawn from the appropriate pool, or if necessary, is created and added to the appropriate pool.</source>
91+
</trans-unit>
92+
<trans-unit id="mssql.connection.maxPoolSize">
93+
<source xml:lang="en">[Optional] Specify the maximum number of connections allowed in the pool.</source>
94+
</trans-unit>
95+
<trans-unit id="mssql.connection.minPoolSize">
96+
<source xml:lang="en">[Optional] Specify the minimum number of connections allowed in the pool.</source>
97+
</trans-unit>
98+
<trans-unit id="mssql.connection.loadBalanceTimeout">
99+
<source xml:lang="en">[Optional] Specify the minimum amount of time in seconds for this connection to live in the pool before being removed/deleted.</source>
100+
</trans-unit>
101+
<trans-unit id="mssql.connection.replication">
102+
<source xml:lang="en">[Optional] Used by SQL Server in replication.</source>
103+
</trans-unit>
104+
<trans-unit id="mssql.connection.attachDbFilename">
105+
<source xml:lang="en">[Optional] Specify the name of the primary file, including the full path name, of an attachable database.</source>
106+
</trans-unit>
107+
<trans-unit id="mssql.connection.failoverPartner">
108+
<source xml:lang="en">[Optional] Specify the name or network address of the instance of SQL Server that acts as a failover partner.</source>
109+
</trans-unit>
110+
<trans-unit id="mssql.connection.multiSubnetFailover">
111+
<source xml:lang="en">[Optional] When set to 'true', the detection and connection to the active server is faster if AlwaysOn Availability Group is configured on different subnets.</source>
112+
</trans-unit>
113+
<trans-unit id="mssql.connection.multipleActiveResultSets">
114+
<source xml:lang="en">[Optional] When set to 'true', multiple result sets can be returned and read from on connection.</source>
115+
</trans-unit>
116+
<trans-unit id="mssql.connection.packetSize">
117+
<source xml:lang="en">[Optional] Specify the size in bytes of the network packets to communicate with SQL Server.</source>
118+
</trans-unit>
119+
<trans-unit id="mssql.connection.typeSystemVersion">
120+
<source xml:lang="en">[Optional] Indicates which server type the provider will expose through the DataReader.</source>
121+
</trans-unit>
122+
<trans-unit id="mssql.connection.connectionString">
123+
<source xml:lang="en">[Optional] The ADO.NET connection string to use for the connection. Overrides any other options given in this connection.</source>
124+
</trans-unit>
125+
<trans-unit id="mssql.connection.profileName">
126+
<source xml:lang="en">[Optional] Specify a custom name for this connection profile to easily browse and search in the command palette of Visual Studio Code.</source>
127+
</trans-unit>
128+
<trans-unit id="mssql.connection.savePassword">
129+
<source xml:lang="en">[Optional] When set to 'true', the password for SQL Server authentication is saved in the secure store of your operating system such as KeyChain in MacOS or Secure Store in Windows.</source>
130+
</trans-unit>
131+
<trans-unit id="mssql.connection.emptyPasswordInput">
132+
<source xml:lang="en">[Optional] Indicates whether this profile has an empty password explicitly set</source>
133+
</trans-unit>
134+
<trans-unit id="mssql.shortcuts">
135+
<source xml:lang="en">Shortcuts related to the results window</source>
136+
</trans-unit>
137+
<trans-unit id="mssql.messagesDefaultOpen">
138+
<source xml:lang="en">True for the messages pane to be open by default; false for closed</source>
139+
</trans-unit>
140+
<trans-unit id="mssql.resultsFontFamily">
141+
<source xml:lang="en">Set the font family for the results grid; set to blank to use the editor font</source>
142+
</trans-unit>
143+
<trans-unit id="mssql.resultsFontSize">
144+
<source xml:lang="en">Set the font size for the results grid; set to blank to use the editor size</source>
145+
</trans-unit>
146+
<trans-unit id="mssql.saveAsCsv.includeHeaders">
147+
<source xml:lang="en">[Optional] When true, column headers are included when saving results as CSV</source>
148+
</trans-unit>
149+
<trans-unit id="mssql.copyIncludeHeaders">
150+
<source xml:lang="en">[Optional] Configuration options for copying results from the Results View</source>
151+
</trans-unit>
152+
<trans-unit id="mssql.copyRemoveNewLine">
153+
<source xml:lang="en">[Optional] Configuration options for copying multi-line results from the Results View</source>
154+
</trans-unit>
155+
<trans-unit id="mssql.showBatchTime">
156+
<source xml:lang="en">[Optional] Should execution time be shown for individual batches</source>
157+
</trans-unit>
158+
<trans-unit id="mssql.splitPaneSelection">
159+
<source xml:lang="en">[Optional] Configuration options for which column new result panes should open in</source>
160+
</trans-unit>
161+
<trans-unit id="mssql.format.alignColumnDefinitionsInColumns">
162+
<source xml:lang="en">Should column definitions be aligned?</source>
163+
</trans-unit>
164+
<trans-unit id="mssql.format.datatypeCasing">
165+
<source xml:lang="en">Should data types be formatted as UPPERCASE, lowercase, or none (not formatted)</source>
166+
</trans-unit>
167+
<trans-unit id="mssql.format.keywordCasing">
168+
<source xml:lang="en">Should keywords be formatted as UPPERCASE, lowercase, or none (not formatted)</source>
169+
</trans-unit>
170+
<trans-unit id="mssql.format.placeCommasBeforeNextStatement">
171+
<source xml:lang="en">should commas be placed at the beginning of each statement in a list e.g. ', mycolumn2' instead of at the end e.g. 'mycolumn1,'</source>
172+
</trans-unit>
173+
<trans-unit id="mssql.format.placeSelectStatementReferencesOnNewLine">
174+
<source xml:lang="en">Should references to objects in a select statements be split into separate lines? E.g. for 'SELECT C1, C2 FROM T1' both C1 and C2 will be on separate lines</source>
175+
</trans-unit>
176+
<trans-unit id="mssql.applyLocalization">
177+
<source xml:lang="en">[Optional] Configuration options for localizing into VSCode's configured locale (must restart VSCode for settings to take effect)</source>
178+
</trans-unit>
179+
<trans-unit id="mssql.query.displayBitAsNumber">
180+
<source xml:lang="en">Should BIT columns be displayed as numbers (1 or 0)? If false, BIT columns will be displayed as 'true' or 'false'</source>
181+
</trans-unit>
182+
<trans-unit id="mssql.intelliSense.enableIntelliSense">
183+
<source xml:lang="en">Should IntelliSense be enabled</source>
184+
</trans-unit>
185+
<trans-unit id="mssql.intelliSense.enableErrorChecking">
186+
<source xml:lang="en">Should IntelliSense error checking be enabled</source>
187+
</trans-unit>
188+
<trans-unit id="mssql.intelliSense.enableSuggestions">
189+
<source xml:lang="en">Should IntelliSense suggestions be enabled</source>
190+
</trans-unit>
191+
<trans-unit id="mssql.intelliSense.enableQuickInfo">
192+
<source xml:lang="en">Should IntelliSense quick info be enabled</source>
193+
</trans-unit>
194+
<trans-unit id="mssql.intelliSense.lowerCaseSuggestions">
195+
<source xml:lang="en">Should IntelliSense suggestions be lowercase</source>
196+
</trans-unit>
197+
</body>
198+
</file>
199+
</xliff>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" ?>
2+
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
3+
<file datatype="xml" original="extension.i18ntest.JSON" source-language="en" target-language="es">
4+
<body>
5+
</body>
6+
</file>
7+
</xliff>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" ?>
2+
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
3+
<file datatype="xml" original="extension.i18ntest.JSON" source-language="en" target-language="fr">
4+
<body>
5+
</body>
6+
</file>
7+
</xliff>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" ?>
2+
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
3+
<file datatype="xml" original="extension.i18ntest.JSON" source-language="en" target-language="it">
4+
<body>
5+
</body>
6+
</file>
7+
</xliff>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" ?>
2+
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
3+
<file datatype="xml" original="extension.i18ntest.JSON" source-language="en" target-language="ja">
4+
<body>
5+
</body>
6+
</file>
7+
</xliff>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" ?>
2+
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
3+
<file datatype="xml" original="extension.i18ntest.JSON" source-language="en" target-language="ko">
4+
<body>
5+
</body>
6+
</file>
7+
</xliff>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" ?>
2+
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
3+
<file datatype="xml" original="extension.i18ntest.JSON" source-language="en" target-language="pt-BR">
4+
<body>
5+
</body>
6+
</file>
7+
</xliff>

0 commit comments

Comments
 (0)