Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

fiona / fix SEO 404 errors #2393

Merged
1 commit merged into from
Jan 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions src/components/localization/localized-link.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,7 @@ import { LocationContext } from '../layout/location-context.js'
import language_config from '../../../i18n-config'
import { LocaleContext } from './locale-context'
import { localized_link_url } from 'common/constants'
import {
getLocalizedUrl,
getDerivAppLocalizedURL,
getThaiExcludedLocale,
replaceLocale,
} from 'common/utility'
import { getLocalizedUrl, getDerivAppLocalizedURL, getThaiExcludedLocale } from 'common/utility'
import { DerivStore } from 'store'

export const SharedLinkStyle = css`
Expand Down Expand Up @@ -188,7 +183,7 @@ const ExternalLink = ({
const { is_eu_country } = useContext(DerivStore)
const { setModalPayload, toggleModal } = useContext(LocationContext)
const { affiliate_lang } = language_config[locale]
const url = getURLFormat(type, replaceLocale(locale), to, affiliate_lang)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the reason that we no longer need this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was replacing the Chinese urls with a hyphen rather than an underscore, giving 404 errors when we select some trading platforms in these languages.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you check with @nikolaiberestevich-deriv on this? I remembered he did this to fix an issue with language codes coming from backend.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, I will

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes , I had an issue (see the parent task of https://redmine.deriv.cloud/issues/46240#Broken_links_for_%22zh_tw%22_or_%22zh_cn%22_languages) maybe the problem is that some of apps( trading platforms) use "_" and our deriv.com uses "-".

const url = getURLFormat(type, locale, to, affiliate_lang)
const show_modal =
is_eu_country &&
!is_mail_link &&
Expand Down