Skip to content

Commit 09972b3

Browse files
committed
refactor(amazonqFeatureDev): add i18n to shared folder
1 parent 9716193 commit 09972b3

File tree

7 files changed

+12
-10
lines changed

7 files changed

+12
-10
lines changed

packages/.vscodeignore.packages

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
!types/**
2020
!package.json
2121
!package.nls.json
22+
!package.nls.*.json
2223

2324
!quickStart**
2425
!README.**

packages/amazonq/scripts/build/copyFiles.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ const tasks: CopyTask[] = [
3131
}),
3232

3333
{ target: path.join('../core', 'resources'), destination: path.join('..', 'resources') },
34-
{ target: path.join('../core', 'package.nls.json'), destination: path.join('..', 'package.nls.json') },
34+
{
35+
target: path.join('../core/src/shared/i18n/', 'package.nls.json'),
36+
destination: path.join('..', 'package.nls.json'),
37+
},
3538
{ target: 'test/unit/amazonqGumby/resources' },
3639

3740
// Vue

packages/core/scripts/build/generateConfigurationAttributes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import * as fs from 'fs'
77
import { JSONSchema4 } from 'json-schema'
88
import { compile } from 'json-schema-to-typescript'
99
import packageJson from '../../package.json'
10-
import * as nlsJson from '../../package.nls.json'
10+
import * as nlsJson from '../../src/shared/i18n/package.nls.json'
1111

1212
const config = [
1313
{

packages/core/src/amazonqFeatureDev/errors.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,7 @@ export class ApiError extends ToolkitError {
142142
}
143143
}
144144

145-
export const denyListedErrors: string[] = [
146-
i18n('AWS.amazonq.featureDev.error.deserialization'),
147-
i18n('AWS.amazonq.featureDev.error.inaccessibleHost'),
148-
]
145+
export const denyListedErrors: string[] = ['Deserialization error', 'Inaccessible host']
149146

150147
export function createUserFacingErrorMessage(message: string) {
151148
if (denyListedErrors.some((err) => message.includes(err))) {

packages/core/src/amazonqFeatureDev/util/i18n-helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
import translations from '../../../package.nls.json'
6+
import translations from '../../../src/shared/i18n/package.nls.json'
77
import { localize } from '../../shared/utilities/vsCodeUtils'
88

99
export const i18n = (code: string) => {

packages/core/package.nls.json renamed to packages/core/src/shared/i18n/package.nls.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,6 @@
286286
"AWS.amazonq.featureDev.error.monthlyLimitReached": "You've reached the monthly quota for the Amazon Q agent for software development. You can try again next month. For more information on usage limits, see the <a href=\"https://aws.amazon.com/q/developer/pricing/\" target=\"_blank\">Amazon Q Developer pricing page</a>.",
287287
"AWS.amazonq.featureDev.error.technicalDifficulties": "I'm sorry, I'm having technical difficulties and can't continue at the moment. Please try again later, and share feedback to help me improve.",
288288
"AWS.amazonq.featureDev.error.throttling": "I'm sorry, I'm experiencing high demand at the moment and can't generate your code. This attempt won't count toward usage limits. Please try again.",
289-
"AWS.amazonq.featureDev.error.deserialization": "Deserialization error",
290-
"AWS.amazonq.featureDev.error.inaccessibleHost": "Inaccessible host",
291289
"AWS.amazonq.featureDev.error.submitFeedback": "'submitFeedback' command was called programmatically, but its not registered.",
292290
"AWS.amazonq.featureDev.error.approachNewTab": "There has been a problem generating an approach. Please open a conversation in a new tab",
293291
"AWS.amazonq.featureDev.pillText.modifyDefaultSourceFolder": "Choose another folder in your workspace",

packages/toolkit/scripts/build/copyFiles.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ const tasks: CopyTask[] = [
3030
}),
3131

3232
{ target: path.join('../core', 'resources'), destination: path.join('..', 'resources') },
33-
{ target: path.join('../core', 'package.nls.json'), destination: path.join('..', 'package.nls.json') },
33+
{
34+
target: path.join('../core/src/shared/i18n/', 'package.nls.json'),
35+
destination: path.join('..', 'package.nls.json'),
36+
},
3437
{ target: path.join('../core', 'src', 'templates'), destination: path.join('src', 'templates') },
3538
{
3639
target: '../core/src/auth/sso/vue',

0 commit comments

Comments
 (0)