refactor: define own translations in other themes (#5849)

Co-authored-by: Armano <armano2@users.noreply.github.com>
This commit is contained in:
Alexey Pyltsyn 2021-11-20 18:35:27 +03:00 committed by GitHub
parent 87a486a02f
commit 63bd6b9025
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
120 changed files with 750 additions and 446 deletions

View file

@ -6,9 +6,14 @@
*/
import path from 'path';
import {Plugin} from '@docusaurus/types';
import {readDefaultCodeTranslationMessages} from '@docusaurus/theme-translations';
import {DocusaurusContext, Plugin} from '@docusaurus/types';
export default function theme(context: DocusaurusContext): Plugin {
const {
i18n: {currentLocale},
} = context;
export default function theme(): Plugin {
return {
name: 'docusaurus-theme-live-codeblock',
@ -16,6 +21,13 @@ export default function theme(): Plugin {
return path.resolve(__dirname, './theme');
},
getDefaultCodeTranslationMessages() {
return readDefaultCodeTranslationMessages({
locale: currentLocale,
name: 'theme-live-codeblock',
});
},
configureWebpack() {
return {
resolve: {