File tree Expand file tree Collapse file tree 6 files changed +32
-57
lines changed
docs/plugins/distributors
packages/translate-transform Expand file tree Collapse file tree 6 files changed +32
-57
lines changed Original file line number Diff line number Diff line change 22sidebar_position : 2
33---
44
5- # 💬 Discord Plugin
5+ # 👾 Discord Plugin
66
77The Discord plugin enables distribution of curated content to Discord channels.
88
Original file line number Diff line number Diff line change @@ -91,6 +91,11 @@ const sidebars: SidebarsConfig = {
9191 id : "plugins/distributors/telegram" ,
9292 label : "📱 Telegram" ,
9393 } ,
94+ {
95+ type : "doc" ,
96+ id : "plugins/distributors/discord" ,
97+ label : "👾 Discord" ,
98+ } ,
9499 {
95100 type : "doc" ,
96101 id : "plugins/distributors/notion" ,
Original file line number Diff line number Diff line change 1- import type {
2- SourceLanguageCode ,
3- TargetLanguageCode ,
4- TranslateTextOptions ,
5- } from "./types" ;
1+ import type { TranslateTextOptions } from "./types" ;
62import type { TransformerPlugin , ActionArgs } from "@curatedotfun/types" ;
73import { Translator } from "deepl-node" ;
4+ import type { SourceLanguageCode , TargetLanguageCode } from "deepl-node" ;
85
96interface TranslationConfig extends Record < string , unknown > {
107 apiKey : string ;
@@ -64,8 +61,8 @@ export default class TranslationTransformer
6461 // Perform translation
6562 const result = await this . translator . translateText (
6663 textToTranslate ,
67- this . config . sourceLang || null ,
68- this . config . targetLang ,
64+ this . config . sourceLang as SourceLanguageCode ,
65+ this . config . targetLang as TargetLanguageCode ,
6966 {
7067 preserveFormatting : this . config . preserveFormatting ?? true ,
7168 } as TranslateTextOptions ,
Original file line number Diff line number Diff line change 1- export type SourceLanguageCode = string ;
2- export type TargetLanguageCode =
3- | "BG"
4- | "CS"
5- | "DA"
6- | "DE"
7- | "EL"
8- | "EN-GB"
9- | "EN-US"
10- | "ES"
11- | "ET"
12- | "FI"
13- | "FR"
14- | "HU"
15- | "ID"
16- | "IT"
17- | "JA"
18- | "KO"
19- | "LT"
20- | "LV"
21- | "NB"
22- | "NL"
23- | "PL"
24- | "PT-BR"
25- | "PT-PT"
26- | "RO"
27- | "RU"
28- | "SK"
29- | "SL"
30- | "SV"
31- | "TR"
32- | "UK"
33- | "ZH" ;
34-
351export type TagHandlingMode = "html" | "xml" ;
362
373export interface TranslateTextOptions {
@@ -47,18 +13,3 @@ export interface TranslationResult {
4713 text : string ;
4814 detectedSourceLang ?: string ;
4915}
50-
51- export interface DeepL {
52- translateText (
53- text : string ,
54- sourceLang : string | null ,
55- targetLang : TargetLanguageCode ,
56- options ?: TranslateTextOptions ,
57- ) : Promise < TranslationResult > ;
58- translateText (
59- text : string [ ] ,
60- sourceLang : string | null ,
61- targetLang : TargetLanguageCode ,
62- options ?: TranslateTextOptions ,
63- ) : Promise < TranslationResult [ ] > ;
64- }
Original file line number Diff line number Diff line change 1+ {
2+ "extends" : " ./tsconfig.json" ,
3+ "compilerOptions" : {
4+ "emitDeclarationOnly" : true ,
5+ "noEmit" : false
6+ }
7+ }
Original file line number Diff line number Diff line change 1+ {
2+ "compilerOptions" : {
3+ "target" : " ES2020" ,
4+ "module" : " ESNext" ,
5+ "moduleResolution" : " bundler" ,
6+ "declaration" : true ,
7+ "outDir" : " ./dist" ,
8+ "strict" : true ,
9+ "esModuleInterop" : true ,
10+ "skipLibCheck" : true ,
11+ "forceConsistentCasingInFileNames" : true
12+ },
13+ "include" : [" src/**/*" ],
14+ "exclude" : [" node_modules" , " dist" ]
15+ }
You can’t perform that action at this time.
0 commit comments