diff --git a/src/pages/ContentScripts/features/developer-networks/view.tsx b/src/pages/ContentScripts/features/developer-networks/view.tsx index 890a4586..8b9243ef 100644 --- a/src/pages/ContentScripts/features/developer-networks/view.tsx +++ b/src/pages/ContentScripts/features/developer-networks/view.tsx @@ -22,9 +22,11 @@ const logoStyle = { }; const baseOSGraphUrls = { - developmentActivityNetwork: 'https://osgraph.com/graphs/dev-activity/github/{userName}?repo-limit=10', - openSourcePartnersNetwork: 'https://osgraph.com/graphs/dev-partner/github/{userName}?partner-limit=10', - openSourceInterestsNetwork: 'https://osgraph.com/graphs/dev-interest/github/{userName}?repo-limit=3&topic-limit=5', + developmentActivityNetwork: + 'https://osgraph.com/graphs/developer-activity/github/{userName}?lang={lang}&user-limit=10', + openSourcePartnersNetwork: 'https://osgraph.com/graphs/os-partner/github/{userName}?lang={lang}&user-limit=10', + openSourceInterestsNetwork: + 'https://osgraph.com/graphs/os-interest/github/{userName}?lang={lang}&repo-limit=3&topic-limit=5', }; const View = ({ userName }: Props): JSX.Element => { const [options, setOptions] = useState(defaults); @@ -34,14 +36,17 @@ const View = ({ userName }: Props): JSX.Element => { const { t, i18n } = useTranslation(); const osGraphLogo = chrome.runtime.getURL('osGraphLogo.png'); const OSGraphUrls = Object.fromEntries( - Object.entries(baseOSGraphUrls).map(([key, url]) => [key, url.replace('{userName}', userName)]) + Object.entries(baseOSGraphUrls).map(([key, url]) => [ + key, + url.replace('{userName}', userName).replace('{lang}', i18n.language == 'en' ? 'en-US' : 'zh-CN'), + ]) ); useEffect(() => { (async function () { setOptions(await optionsStorage.getAll()); + i18n.changeLanguage(options.locale); })(); }, [options.locale]); - return (

Perceptor

diff --git a/src/pages/ContentScripts/features/repo-networks/view.tsx b/src/pages/ContentScripts/features/repo-networks/view.tsx index ee54d279..736d30b7 100644 --- a/src/pages/ContentScripts/features/repo-networks/view.tsx +++ b/src/pages/ContentScripts/features/repo-networks/view.tsx @@ -20,17 +20,22 @@ const logoStyle = { marginRight: '50px', marginTop: '5px', }; + const baseOSGraphUrls = { - projectContributionNetwork: 'https://osgraph.com/graphs/repo-contrib/github/{repoName}?contrib-limit=10', - projectEcosystemNetwork: 'https://osgraph.com/graphs/repo-eco/github/{repoName}?repo-limit=10', + projectContributionNetwork: + 'https://osgraph.com/graphs/project-contribution/github/{repoName}?lang={lang}&repo-limit=10', + projectEcosystemNetwork: 'https://osgraph.com/graphs/project-ecosystem/github/{repoName}?lang={lang}&repo-limit=10', projectCommunityNetwork: - 'https://osgraph.com/graphs/repo-community/github/{repoName}?country-limit=5&org-limit=5&contrib-limit=3', + 'https://osgraph.com/graphs/project-community/github/{repoName}?lang={lang}&country-limit=5&company-limit=5&user-limit=3', }; const View = ({ repoName }: Props): JSX.Element => { const [options, setOptions] = useState(defaults); const { t, i18n } = useTranslation(); const OSGraphUrls = Object.fromEntries( - Object.entries(baseOSGraphUrls).map(([key, url]) => [key, url.replace('{repoName}', repoName)]) + Object.entries(baseOSGraphUrls).map(([key, url]) => [ + key, + url.replace('{repoName}', repoName).replace('{lang}', i18n.language == 'en' ? 'en-US' : 'zh-CN'), + ]) ); const osGraphLogo = chrome.runtime.getURL('osGraphLogo.png'); useEffect(() => {