Skip to content

Commit c16ea45

Browse files
feat: update localization labels
1 parent 2081fa1 commit c16ea45

File tree

8 files changed

+27
-27
lines changed

8 files changed

+27
-27
lines changed

packages/template-retail-react-app/app/components/header/index.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ const Header = ({
124124
const navigate = useNavigation()
125125
const storeLocatorEnabled = getConfig()?.app?.storeLocatorEnabled ?? STORE_LOCATOR_IS_ENABLED
126126
const commerceAgentConfig = getCommerceAgentConfig()
127-
const showLaunchAgentFromHeader = commerceAgentConfig?.enableLaunchAgentFromHeader === 'true'
127+
const showLaunchAgentButton = commerceAgentConfig?.enableAgentFromHeader === 'true'
128128
const {
129129
getButtonProps: getAccountMenuButtonProps,
130130
getDisclosureProps: getAccountMenuDisclosureProps,
@@ -197,12 +197,12 @@ const Header = ({
197197
<HideOnMobile>
198198
<SearchBar />
199199
</HideOnMobile>
200-
{showLaunchAgentFromHeader && (
200+
{showLaunchAgentButton && (
201201
<IconButton
202202
icon={<SparkleIcon />}
203203
aria-label={intl.formatMessage({
204-
id: 'header.button.assistive_msg.agent',
205-
defaultMessage: 'Agent'
204+
id: 'header.button.assistive_msg.ask_shopping_agent',
205+
defaultMessage: 'Ask Shopping Agent'
206206
})}
207207
variant="unstyled"
208208
{...styles.icons}

packages/template-retail-react-app/app/components/header/index.test.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ beforeEach(() => {
6262
)
6363
// Default mock for getCommerceAgentConfig
6464
getCommerceAgentConfig.mockReturnValue({
65-
enableLaunchAgentFromHeader: 'false'
65+
enableAgentFromHeader: 'false'
6666
})
6767
})
6868
afterEach(() => {
@@ -337,9 +337,9 @@ test('handles search functionality', async () => {
337337
})
338338

339339
describe('Agent button (SparkleIcon)', () => {
340-
test('renders agent button when enableLaunchAgentFromHeader is true', async () => {
340+
test('renders agent button when enableAgentFromHeader is true', async () => {
341341
getCommerceAgentConfig.mockReturnValue({
342-
enableLaunchAgentFromHeader: 'true'
342+
enableAgentFromHeader: 'true'
343343
})
344344

345345
renderWithProviders(<Header />)
@@ -350,9 +350,9 @@ describe('Agent button (SparkleIcon)', () => {
350350
})
351351
})
352352

353-
test('does not render agent button when enableLaunchAgentFromHeader is false', async () => {
353+
test('does not render agent button when enableAgentFromHeader is false', async () => {
354354
getCommerceAgentConfig.mockReturnValue({
355-
enableLaunchAgentFromHeader: 'false'
355+
enableAgentFromHeader: 'false'
356356
})
357357

358358
renderWithProviders(<Header />)
@@ -363,9 +363,9 @@ describe('Agent button (SparkleIcon)', () => {
363363
})
364364
})
365365

366-
test('does not render agent button when enableLaunchAgentFromHeader is undefined', async () => {
366+
test('does not render agent button when enableAgentFromHeader is undefined', async () => {
367367
getCommerceAgentConfig.mockReturnValue({
368-
enableLaunchAgentFromHeader: undefined
368+
enableAgentFromHeader: undefined
369369
})
370370

371371
renderWithProviders(<Header />)
@@ -376,9 +376,9 @@ describe('Agent button (SparkleIcon)', () => {
376376
})
377377
})
378378

379-
test('does not render agent button when enableLaunchAgentFromHeader is not "true"', async () => {
379+
test('does not render agent button when enableAgentFromHeader is not "true"', async () => {
380380
getCommerceAgentConfig.mockReturnValue({
381-
enableLaunchAgentFromHeader: 'someOtherValue'
381+
enableAgentFromHeader: 'someOtherValue'
382382
})
383383

384384
renderWithProviders(<Header />)
@@ -392,7 +392,7 @@ describe('Agent button (SparkleIcon)', () => {
392392
test('calls onAgentClick when agent button is clicked', async () => {
393393
const onAgentClick = jest.fn()
394394
getCommerceAgentConfig.mockReturnValue({
395-
enableLaunchAgentFromHeader: 'true'
395+
enableAgentFromHeader: 'true'
396396
})
397397

398398
renderWithProviders(<Header onAgentClick={onAgentClick} />)
@@ -410,7 +410,7 @@ describe('Agent button (SparkleIcon)', () => {
410410

411411
test('agent button has correct aria-label', async () => {
412412
getCommerceAgentConfig.mockReturnValue({
413-
enableLaunchAgentFromHeader: 'true'
413+
enableAgentFromHeader: 'true'
414414
})
415415

416416
renderWithProviders(<Header />)
@@ -424,7 +424,7 @@ describe('Agent button (SparkleIcon)', () => {
424424

425425
test('calls getCommerceAgentConfig to check configuration', async () => {
426426
getCommerceAgentConfig.mockReturnValue({
427-
enableLaunchAgentFromHeader: 'true'
427+
enableAgentFromHeader: 'true'
428428
})
429429

430430
renderWithProviders(<Header />)

packages/template-retail-react-app/app/static/translations/compiled/en-GB.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1943,10 +1943,10 @@
19431943
"value": "View"
19441944
}
19451945
],
1946-
"header.button.assistive_msg.agent": [
1946+
"header.button.assistive_msg.ask_shopping_agent": [
19471947
{
19481948
"type": 0,
1949-
"value": "Agent"
1949+
"value": "Ask Shopping Agent"
19501950
}
19511951
],
19521952
"header.button.assistive_msg.logo": [

packages/template-retail-react-app/app/static/translations/compiled/en-US.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1943,10 +1943,10 @@
19431943
"value": "View"
19441944
}
19451945
],
1946-
"header.button.assistive_msg.agent": [
1946+
"header.button.assistive_msg.ask_shopping_agent": [
19471947
{
19481948
"type": 0,
1949-
"value": "Agent"
1949+
"value": "Ask Shopping Agent"
19501950
}
19511951
],
19521952
"header.button.assistive_msg.logo": [

packages/template-retail-react-app/app/static/translations/compiled/en-XA.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3959,14 +3959,14 @@
39593959
"value": "]"
39603960
}
39613961
],
3962-
"header.button.assistive_msg.agent": [
3962+
"header.button.assistive_msg.ask_shopping_agent": [
39633963
{
39643964
"type": 0,
39653965
"value": "["
39663966
},
39673967
{
39683968
"type": 0,
3969-
"value": "Ȧɠḗḗƞŧ"
3969+
"value": "Ȧşķ Şħǿǿƥƥīƞɠ Ȧɠḗḗƞŧ"
39703970
},
39713971
{
39723972
"type": 0,

packages/template-retail-react-app/app/utils/config-utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const getCommerceAgentConfig = () => {
2020
siteId: '',
2121
enableConversationContext: 'false',
2222
conversationContext: [],
23-
enableLaunchAgentFromHeader: 'false'
23+
enableAgentFromHeader: 'false'
2424
}
2525
return getConfig().app.commerceAgent ?? defaults
2626
}

packages/template-retail-react-app/translations/en-GB.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -759,8 +759,8 @@
759759
"global.link.added_to_wishlist.view_wishlist": {
760760
"defaultMessage": "View"
761761
},
762-
"header.button.assistive_msg.agent": {
763-
"defaultMessage": "Agent"
762+
"header.button.assistive_msg.ask_shopping_agent": {
763+
"defaultMessage": "Ask Shopping Agent"
764764
},
765765
"header.button.assistive_msg.logo": {
766766
"defaultMessage": "Logo"

packages/template-retail-react-app/translations/en-US.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -759,8 +759,8 @@
759759
"global.link.added_to_wishlist.view_wishlist": {
760760
"defaultMessage": "View"
761761
},
762-
"header.button.assistive_msg.agent": {
763-
"defaultMessage": "Agent"
762+
"header.button.assistive_msg.ask_shopping_agent": {
763+
"defaultMessage": "Ask Shopping Agent"
764764
},
765765
"header.button.assistive_msg.logo": {
766766
"defaultMessage": "Logo"

0 commit comments

Comments
 (0)