Skip to content

Commit

Permalink
Merge pull request #488 from translate-tools/479-add-blog-to-site
Browse files Browse the repository at this point in the history
Add blog to site
  • Loading branch information
vitonsky committed Jun 25, 2024
2 parents a015ef7 + f4f8df2 commit 57ac069
Show file tree
Hide file tree
Showing 31 changed files with 210 additions and 31 deletions.
6 changes: 6 additions & 0 deletions site/blog/authors.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
vitonsky:
name: Robert Vitonsky
title: Founder of Linguist Translate
url: https://vitonsky.net
image_url: https://github.com/vitonsky.png
email: [email protected]
28 changes: 28 additions & 0 deletions site/blog/release/6.0.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
title: Release 6.0.0
description: Manifest V3 and sandboxed translators
authors: [vitonsky]
tags: [release]
date: 2024-06-25T16:00
---

Key changes in [new release](https://github.com/translate-tools/linguist/releases/tag/v6.0.0).

- Chrome extension moved to a Manifest v3
- Custom translators code now run in sandboxed iframe with no access to addon API
- New option to disable translation history recording https://github.com/translate-tools/linguist/issues/151
- Minor bug fixes and improvements, see [milestone](https://github.com/translate-tools/linguist/milestone/7?closed=1)

**Full Changelog**: https://github.com/translate-tools/linguist/compare/v5.0.17...6.0.0

## Improved security

Now custom translators executes in sandboxed context, so they no have access to addon API.

Users now may use custom translators with lower trust level. Custom translator still may sent requests to any domains from your browser, and still may mine on your hardware as any other software, but custom translator can't inspect content on pages and do other things that browser extensions do.

## Manifest V3

A chrome [announced](https://developer.chrome.com/blog/resuming-the-transition-to-mv3/#the_phase-out_timeline) they will deprecate and disable extensions with manifest v2 soon. So Linguist migrate to manifest v3 on Chrome and stay on manifest v2 on Firefox.

Due to some limitations of Manifest V3, Linguist may not work on too old browsers like Chrome 109 and older.
40 changes: 38 additions & 2 deletions site/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { Config } from '@docusaurus/types';
const config: Config = {
title: 'Linguist Translate',
tagline: 'Privacy focused translation',
favicon: 'favicon.svg',
favicon: 'favicon.ico',

// Set the production url of your site here
url: 'https://linguister.io',
Expand All @@ -20,10 +20,46 @@ const config: Config = {
// path: '../docs',
// include: ['*.md', '*.mdx'],
// },
blog: false,
blog: {
blogTitle: 'Linguist Translate blog',
blogDescription:
'A blog of Linguist Translate, the privacy focused translation in your browser',
postsPerPage: 'ALL',
blogSidebarCount: 0,
},
},
],
],

themeConfig: {
image: '/screenshots/page-translation.png',
colorMode: {
defaultMode: 'light',
disableSwitch: true,
respectPrefersColorScheme: true,
},
navbar: {
logo: {
alt: 'Linguist Translate',
src: '/logo.svg',
srcDark: 'img/logo_dark.svg',
href: '/',
target: '_self',
width: 100,
},
items: [
{
href: 'https://github.com/translate-tools/linguist',
label: 'GitHub',
position: 'right',
target: '_blank',
},
],
},
footer: {
copyright: `Copyright © ${new Date().getFullYear()} FluidMinds team. Built with Docusaurus.`,
},
},
} satisfies Config;

export default config;
34 changes: 31 additions & 3 deletions site/src/components/Analytics/AnalyticsProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
import React, { PropsWithChildren, useCallback, useEffect, useState } from 'react';
import Plausible from 'plausible-tracker';
import { PlausibleInitOptions } from 'plausible-tracker/build/main/lib/tracker';
import Head from '@docusaurus/Head';

import { analyticsContext, IAnalyticsContext } from './useAnalyticsContext';

export type AnalyticsProviderProps = PropsWithChildren<{
plausible: PlausibleInitOptions;
googleAnalytics: {
tagId: string;
};
}>;

export const AnalyticsProvider = ({
options,
plausible: plausibleOptions,
googleAnalytics,
children,
}: PropsWithChildren<{ options: PlausibleInitOptions }>) => {
const [plausible] = useState(() => Plausible(options));
}: AnalyticsProviderProps) => {
const [plausible] = useState(() => Plausible(plausibleOptions));

const trackEvent: IAnalyticsContext['trackEvent'] = useCallback(
(eventName, props) => {
Expand Down Expand Up @@ -51,6 +60,25 @@ export const AnalyticsProvider = ({

return (
<analyticsContext.Provider value={{ trackEvent }}>
<Head>
<script
async
src={`https://www.googletagmanager.com/gtag/js?id=${googleAnalytics.tagId}`}
></script>
</Head>
<script
dangerouslySetInnerHTML={{
__html: `
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '${googleAnalytics.tagId}');
`
.replace(/\t/g, '')
.trim(),
}}
/>
{children}
</analyticsContext.Provider>
);
Expand Down
3 changes: 3 additions & 0 deletions site/src/components/Landing/Landing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ export const Landing = ({ baseUrl }: { baseUrl: string }) => {
<Link variant="base" href="#features">
{t('navigation.features.content')}
</Link>
<Link variant="base" href="/blog">
{t('navigation.blog.content')}
</Link>
<Link
variant="base"
href="https://github.com/translate-tools/linguist"
Expand Down
3 changes: 3 additions & 0 deletions site/src/components/Landing/locales/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"features": {
"content": "الميزات"
},
"blog": {
"content": "بلوق"
},
"github": {
"content": "جيثب"
}
Expand Down
3 changes: 3 additions & 0 deletions site/src/components/Landing/locales/bn.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"features": {
"content": "বৈশিষ্ট্য"
},
"blog": {
"content": "ব্লগ"
},
"github": {
"content": "GitHub"
}
Expand Down
3 changes: 3 additions & 0 deletions site/src/components/Landing/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"features": {
"content": "Features"
},
"blog": {
"content": "Blog"
},
"github": {
"content": "GitHub"
}
Expand Down
3 changes: 3 additions & 0 deletions site/src/components/Landing/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"features": {
"content": "Features"
},
"blog": {
"content": "Blog"
},
"github": {
"content": "GitHub"
}
Expand Down
3 changes: 3 additions & 0 deletions site/src/components/Landing/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"features": {
"content": "Características"
},
"blog": {
"content": "Blog"
},
"github": {
"content": "GitHub"
}
Expand Down
3 changes: 3 additions & 0 deletions site/src/components/Landing/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"features": {
"content": "Caractéristiques"
},
"blog": {
"content": "Blog"
},
"github": {
"content": "GitHub"
}
Expand Down
3 changes: 3 additions & 0 deletions site/src/components/Landing/locales/gu.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"features": {
"content": "લક્ષણો"
},
"blog": {
"content": "બ્લોગ"
},
"github": {
"content": "GitHub"
}
Expand Down
3 changes: 3 additions & 0 deletions site/src/components/Landing/locales/hi.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"features": {
"content": "विशेषताएं"
},
"blog": {
"content": "ब्लॉग"
},
"github": {
"content": "GitHub"
}
Expand Down
3 changes: 3 additions & 0 deletions site/src/components/Landing/locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"features": {
"content": "Caratteristiche"
},
"blog": {
"content": "Blog"
},
"github": {
"content": "GitHub"
}
Expand Down
3 changes: 3 additions & 0 deletions site/src/components/Landing/locales/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"features": {
"content": "特徴"
},
"blog": {
"content": "ブログ"
},
"github": {
"content": "GitHub"
}
Expand Down
3 changes: 3 additions & 0 deletions site/src/components/Landing/locales/jv.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"features": {
"content": "Fitur"
},
"blog": {
"content": "Blog"
},
"github": {
"content": "GitHub"
}
Expand Down
3 changes: 3 additions & 0 deletions site/src/components/Landing/locales/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"features": {
"content": "특징"
},
"blog": {
"content": "블로그"
},
"github": {
"content": "GitHub"
}
Expand Down
3 changes: 3 additions & 0 deletions site/src/components/Landing/locales/mr.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"features": {
"content": "वैशिष्ट्ये"
},
"blog": {
"content": "ब्लॉग"
},
"github": {
"content": "GitHub"
}
Expand Down
3 changes: 3 additions & 0 deletions site/src/components/Landing/locales/pa.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"features": {
"content": "ਫੀਚਰ"
},
"blog": {
"content": "Blog"
},
"github": {
"content": "GitHub"
}
Expand Down
3 changes: 3 additions & 0 deletions site/src/components/Landing/locales/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"features": {
"content": "Recursos"
},
"blog": {
"content": "Blog"
},
"github": {
"content": "GitHub"
}
Expand Down
3 changes: 3 additions & 0 deletions site/src/components/Landing/locales/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"features": {
"content": "Характеристики"
},
"blog": {
"content": "Блог"
},
"github": {
"content": "GitHub"
}
Expand Down
3 changes: 3 additions & 0 deletions site/src/components/Landing/locales/ta.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"features": {
"content": "அம்சங்கள்"
},
"blog": {
"content": "வலைப்பதிவு"
},
"github": {
"content": "மகிழ்ச்சியா"
}
Expand Down
3 changes: 3 additions & 0 deletions site/src/components/Landing/locales/te.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"features": {
"content": "లక్షణాలు"
},
"blog": {
"content": "బ్లాగ్"
},
"github": {
"content": "GitHub"
}
Expand Down
3 changes: 3 additions & 0 deletions site/src/components/Landing/locales/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"features": {
"content": "Özellikler"
},
"blog": {
"content": "Blog"
},
"github": {
"content": "GitHub"
}
Expand Down
3 changes: 3 additions & 0 deletions site/src/components/Landing/locales/ur.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"features": {
"content": "خصوصیات"
},
"blog": {
"content": "بلاگ"
},
"github": {
"content": "GitHub"
}
Expand Down
3 changes: 3 additions & 0 deletions site/src/components/Landing/locales/vi.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"features": {
"content": "Tính năng"
},
"blog": {
"content": "Blog"
},
"github": {
"content": "GitHub"
}
Expand Down
3 changes: 3 additions & 0 deletions site/src/components/Landing/locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"features": {
"content": "功能"
},
"blog": {
"content": "博客"
},
"github": {
"content": ""
}
Expand Down
Loading

0 comments on commit 57ac069

Please sign in to comment.