-
Notifications
You must be signed in to change notification settings - Fork 272
WS-2323 - Add Language Script Switch Button to New Navigation Dual Script Language Services [Do Not Merge] #13881
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: latest
Are you sure you want to change the base?
Changes from 25 commits
b447d45
5eb49f5
fbcac40
92e5b98
3933214
e120108
04dfec8
02e1186
f06ed52
c65f2c5
f19d41f
c4a6f25
e15c7b6
22155fd
c6fd858
25b666e
206e4cc
66825e2
fc0f0df
b5434ee
989800b
3dea0d1
3d73268
ca84a24
e9b8e9e
5930dfe
ae80e77
2170a7c
2533f26
336d893
4ce75a1
317ee75
d312f31
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,13 +13,17 @@ const SERVICES_WITH_NEW_NAV: Services[] = [ | |
| 'marathi', | ||
| 'pidgin', | ||
| 'punjabi', | ||
| 'serbian', | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We'll need to remove these services before merging so that we don't release the new nav to them early.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah got a subtask for that in https://bbc.atlassian.net/jira/software/c/projects/WS/boards/1251?selectedIssue=WS-2487
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (just as a reminder to remove, i'll fix the conflicts once it's gone to preview and been swarmed) |
||
| 'somali', | ||
| 'swahili', | ||
| 'tamil', | ||
| 'telugu', | ||
| 'tigrinya', | ||
| 'ukchina', | ||
| 'urdu', | ||
|
Comment on lines
+16
to
23
|
||
| 'uzbek', | ||
| 'yoruba', | ||
| 'zhongwen', | ||
| ] as const; | ||
|
|
||
| export default SERVICES_WITH_NEW_NAV; | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
currentVariantcan benullinRequestContext, andindexOfwill return-1if the variant segment isn’t present in the URL. In that casepathPartsWithoutExtension[currentVariantIndex] = alternateVariantwrites to index-1and the joined path won’t change, producing an incorrect href (no variant switch). Add a guard forcurrentVariantIndex < 0(e.g. returnnullor derive the replacement segment more defensively).