Skip to content

Commit a08708b

Browse files
committed
do not add language namespace for default language in Link component
Signed-off-by: Dmitriy Nevzorov <jimmy.lugat@gmail.com>
1 parent 8b06e8d commit a08708b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Link.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ type Props = GatsbyLinkProps<any> & {language?: string};
88
export const Link: React.FC<Props> = ({language, to, onClick, ...rest}) => {
99
const context = useContext(I18nextContext);
1010
const urlLanguage = language || context.language;
11-
const link = context.routed || language ? `/${urlLanguage}${to}` : `${to}`;
11+
const link = urlLanguage !== context.defaultLanguage ? `/${urlLanguage}${to}` : `${to}`;
1212

1313
return (
1414
// @ts-ignore

0 commit comments

Comments
 (0)