diff options
author | André Oliveira <37463445+SpecialAro@users.noreply.github.com> | 2022-08-17 22:54:41 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-17 22:54:41 +0100 |
commit | fb0cc81d1db0d88c90bb112a0caec66095fcc0f0 (patch) | |
tree | aaa5d0f92f55ccf3984af2cbf2ebbcb1da5fd7c6 /src/config.ts | |
parent | 6.0.1-nightly.16 [skip ci] (diff) | |
download | ferdium-app-fb0cc81d1db0d88c90bb112a0caec66095fcc0f0.tar.gz ferdium-app-fb0cc81d1db0d88c90bb112a0caec66095fcc0f0.tar.zst ferdium-app-fb0cc81d1db0d88c90bb112a0caec66095fcc0f0.zip |
Feature: Add Ferdium Translator (#548)
Add feature to translate text natively using https://github.com/shikar/NODE_GOOGLE_TRANSLATE package and a LibreTranslate self-hosted option (already running on our server on https://translator.ferdium.org).
Diffstat (limited to 'src/config.ts')
-rw-r--r-- | src/config.ts | 139 |
1 files changed, 139 insertions, 0 deletions
diff --git a/src/config.ts b/src/config.ts index 150b7101d..c8cb09d84 100644 --- a/src/config.ts +++ b/src/config.ts | |||
@@ -24,6 +24,8 @@ export const LIVE_WS_API = 'wss://api.franzinfra.com'; | |||
24 | export const LOCAL_API_WEBSITE = 'http://localhost:3333'; | 24 | export const LOCAL_API_WEBSITE = 'http://localhost:3333'; |
25 | export const DEV_API_FRANZ_WEBSITE = 'https://meetfranz.com'; | 25 | export const DEV_API_FRANZ_WEBSITE = 'https://meetfranz.com'; |
26 | export const LIVE_API_FERDIUM_WEBSITE = 'https://ferdium.org'; | 26 | export const LIVE_API_FERDIUM_WEBSITE = 'https://ferdium.org'; |
27 | export const LIVE_API_FERDIUM_LIBRETRANSLATE = | ||
28 | 'https://translator.ferdium.org/translate'; | ||
27 | 29 | ||
28 | export const STATS_API = 'https://stats.franzinfra.com'; | 30 | export const STATS_API = 'https://stats.franzinfra.com'; |
29 | 31 | ||
@@ -84,6 +86,140 @@ export const SEARCH_ENGINE_NAMES = { | |||
84 | [SEARCH_ENGINE_DDG]: 'DuckDuckGo', | 86 | [SEARCH_ENGINE_DDG]: 'DuckDuckGo', |
85 | }; | 87 | }; |
86 | 88 | ||
89 | export const TRANSLATOR_ENGINE_GOOGLE = 'Google'; | ||
90 | export const TRANSLATOR_ENGINE_LIBRETRANSLATE = 'LibreTranslate'; | ||
91 | export const TRANSLATOR_ENGINE_NAMES = { | ||
92 | [TRANSLATOR_ENGINE_LIBRETRANSLATE]: | ||
93 | 'Ferdium Translator (Powered by LibreTranslate)', | ||
94 | [TRANSLATOR_ENGINE_GOOGLE]: 'Google', | ||
95 | }; | ||
96 | |||
97 | export const LIBRETRANSLATE_TRANSLATOR_LANGUAGES = { | ||
98 | ar: 'Arabic', | ||
99 | zh: 'Chinese', | ||
100 | en: 'English', | ||
101 | fr: 'French', | ||
102 | de: 'German', | ||
103 | hi: 'Hindi', | ||
104 | id: 'Indonesian', | ||
105 | ga: 'Irish', | ||
106 | it: 'Italian', | ||
107 | ja: 'Japanese', | ||
108 | ko: 'Korean', | ||
109 | pl: 'Polish', | ||
110 | pt: 'Portuguese', | ||
111 | ru: 'Russian', | ||
112 | es: 'Spanish', | ||
113 | tr: 'Turkish', | ||
114 | vi: 'Vietnamese', | ||
115 | }; | ||
116 | |||
117 | export const GOOGLE_TRANSLATOR_LANGUAGES = { | ||
118 | af: 'Afrikaans', | ||
119 | sq: 'Albanian', | ||
120 | ar: 'Arabic', | ||
121 | hy: 'Armenian', | ||
122 | az: 'Azerbaijani', | ||
123 | eu: 'Basque', | ||
124 | be: 'Belarusian', | ||
125 | bn: 'Bengali', | ||
126 | bs: 'Bosnian', | ||
127 | bg: 'Bulgarian', | ||
128 | ca: 'Catalan', | ||
129 | ceb: 'Cebuano', | ||
130 | ny: 'Chichewa', | ||
131 | 'zh-cn': 'Chinese Simplified', | ||
132 | 'zh-tw': 'Chinese Traditional', | ||
133 | co: 'Corsican', | ||
134 | hr: 'Croatian', | ||
135 | cs: 'Czech', | ||
136 | da: 'Danish', | ||
137 | nl: 'Dutch', | ||
138 | en: 'English', | ||
139 | eo: 'Esperanto', | ||
140 | et: 'Estonian', | ||
141 | tl: 'Filipino', | ||
142 | fi: 'Finnish', | ||
143 | fr: 'French', | ||
144 | fy: 'Frisian', | ||
145 | gl: 'Galician', | ||
146 | ka: 'Georgian', | ||
147 | de: 'German', | ||
148 | el: 'Greek', | ||
149 | gu: 'Gujarati', | ||
150 | ht: 'Haitian Creole', | ||
151 | ha: 'Hausa', | ||
152 | haw: 'Hawaiian', | ||
153 | iw: 'Hebrew', | ||
154 | hi: 'Hindi', | ||
155 | hmn: 'Hmong', | ||
156 | hu: 'Hungarian', | ||
157 | is: 'Icelandic', | ||
158 | ig: 'Igbo', | ||
159 | id: 'Indonesian', | ||
160 | ga: 'Irish', | ||
161 | it: 'Italian', | ||
162 | ja: 'Japanese', | ||
163 | jw: 'Javanese', | ||
164 | kn: 'Kannada', | ||
165 | kk: 'Kazakh', | ||
166 | km: 'Khmer', | ||
167 | ko: 'Korean', | ||
168 | ku: 'Kurdish (Kurmanji)', | ||
169 | ky: 'Kyrgyz', | ||
170 | lo: 'Lao', | ||
171 | la: 'Latin', | ||
172 | lv: 'Latvian', | ||
173 | lt: 'Lithuanian', | ||
174 | lb: 'Luxembourgish', | ||
175 | mk: 'Macedonian', | ||
176 | mg: 'Malagasy', | ||
177 | ms: 'Malay', | ||
178 | ml: 'Malayalam', | ||
179 | mt: 'Maltese', | ||
180 | mi: 'Maori', | ||
181 | mr: 'Marathi', | ||
182 | mn: 'Mongolian', | ||
183 | my: 'Myanmar (Burmese)', | ||
184 | ne: 'Nepali', | ||
185 | no: 'Norwegian', | ||
186 | ps: 'Pashto', | ||
187 | fa: 'Persian', | ||
188 | pl: 'Polish', | ||
189 | pt: 'Portuguese', | ||
190 | ma: 'Punjabi', | ||
191 | ro: 'Romanian', | ||
192 | ru: 'Russian', | ||
193 | sm: 'Samoan', | ||
194 | gd: 'Scots Gaelic', | ||
195 | sr: 'Serbian', | ||
196 | st: 'Sesotho', | ||
197 | sn: 'Shona', | ||
198 | sd: 'Sindhi', | ||
199 | si: 'Sinhala', | ||
200 | sk: 'Slovak', | ||
201 | sl: 'Slovenian', | ||
202 | so: 'Somali', | ||
203 | es: 'Spanish', | ||
204 | su: 'Sudanese', | ||
205 | sw: 'Swahili', | ||
206 | sv: 'Swedish', | ||
207 | tg: 'Tajik', | ||
208 | ta: 'Tamil', | ||
209 | te: 'Telugu', | ||
210 | th: 'Thai', | ||
211 | tr: 'Turkish', | ||
212 | uk: 'Ukrainian', | ||
213 | ur: 'Urdu', | ||
214 | uz: 'Uzbek', | ||
215 | vi: 'Vietnamese', | ||
216 | cy: 'Welsh', | ||
217 | xh: 'Xhosa', | ||
218 | yi: 'Yiddish', | ||
219 | yo: 'Yoruba', | ||
220 | zu: 'Zulu', | ||
221 | }; | ||
222 | |||
87 | export const SEARCH_ENGINE_URLS = { | 223 | export const SEARCH_ENGINE_URLS = { |
88 | [SEARCH_ENGINE_STARTPAGE]: ({ searchTerm }) => | 224 | [SEARCH_ENGINE_STARTPAGE]: ({ searchTerm }) => |
89 | `https://www.startpage.com/sp/search?query=${searchTerm}`, | 225 | `https://www.startpage.com/sp/search?query=${searchTerm}`, |
@@ -222,6 +358,7 @@ export const DEFAULT_APP_SETTINGS = { | |||
222 | showMessageBadgeWhenMuted: true, | 358 | showMessageBadgeWhenMuted: true, |
223 | showDragArea: false, | 359 | showDragArea: false, |
224 | enableSpellchecking: true, | 360 | enableSpellchecking: true, |
361 | enableTranslator: false, | ||
225 | spellcheckerLanguage: 'en-us', | 362 | spellcheckerLanguage: 'en-us', |
226 | darkMode: false, | 363 | darkMode: false, |
227 | navigationBarManualActive: false, | 364 | navigationBarManualActive: false, |
@@ -261,6 +398,8 @@ export const DEFAULT_APP_SETTINGS = { | |||
261 | iconSize: iconSizeBias, | 398 | iconSize: iconSizeBias, |
262 | navigationBarBehaviour: 'custom', | 399 | navigationBarBehaviour: 'custom', |
263 | searchEngine: SEARCH_ENGINE_STARTPAGE, | 400 | searchEngine: SEARCH_ENGINE_STARTPAGE, |
401 | translatorLanguage: 'en', | ||
402 | translatorEngine: TRANSLATOR_ENGINE_LIBRETRANSLATE, | ||
264 | useHorizontalStyle: false, | 403 | useHorizontalStyle: false, |
265 | hideCollapseButton: false, | 404 | hideCollapseButton: false, |
266 | isMenuCollapsed: false, | 405 | isMenuCollapsed: false, |