Commit graph

2634 commits

Author SHA1 Message Date
Alex Gleason
d4767f56c6
Enable translations dynamically depending on whether a TRANSLATION_PROVIDER is set 2024-10-09 20:17:04 -05:00
Alex Gleason
878535c428 Merge branch 'worker-names' into 'main'
Add names to web workers

See merge request soapbox-pub/ditto!540
2024-10-09 22:59:15 +00:00
Alex Gleason
4d146dcc98
Add names to web workers 2024-10-09 17:58:11 -05:00
Alex Gleason
0819049cb8 Merge branch 'handle-translate-error-not-supported' into 'main'
feat: return translation not supported error to the frontend

See merge request soapbox-pub/ditto!539
2024-10-09 22:24:09 +00:00
P. Reis
b86bd81ed2 refactor: cast correct error type 2024-10-09 19:19:54 -03:00
P. Reis
87e0f594df refactor: throw new Error to have benefit of stack trace 2024-10-09 19:17:03 -03:00
P. Reis
54fa38795a feat: return translation not supported error to the frontend 2024-10-09 18:52:23 -03:00
Alex Gleason
91b82c36a8 Merge branch 'translate-status' into 'main'
Feat: Support Machine Translations

Closes #201

See merge request soapbox-pub/ditto!537
2024-10-09 18:59:04 +00:00
P. Reis
cad0da2732 feat: rateLimit translate endpoint 2024-10-09 15:24:01 -03:00
P. Reis
57bbbb289b fix: types must have the type prefix
apparently happens in Deno 2.0?
2024-10-09 15:22:09 -03:00
P. Reis
22fa3f944c chore: update nostrify:db 2024-10-09 15:18:20 -03:00
P. Reis
728d7b33fb Merge branch 'main' into translate-status
Conflicts:
	deno.lock
        I have let the changes of main to prevail, I will update nostrify:db manually
2024-10-09 15:14:22 -03:00
P. Reis
4f8c8fd1de refactor: simply DittoTranslator interface and classes that implement it 2024-10-09 15:03:11 -03:00
P. Reis
c1c25d7c08 feat: create localeSchema 2024-10-09 14:57:28 -03:00
Alex Gleason
376fd8a956 Merge branch 'deno-2.0.0' into 'main'
Upgrade to Deno v2.0

See merge request soapbox-pub/ditto!538
2024-10-09 09:38:33 +00:00
Alex Gleason
df92483617
Add --allow-import to check task 2024-10-09 04:25:49 -05:00
Alex Gleason
bf2e20f2ce
Upgrade to Deno v2.0 2024-10-09 04:17:55 -05:00
Alex Gleason
d6b65245ea
Fix dompurify in deno.lock 2024-10-09 04:01:08 -05:00
Alex Gleason
90e0de2cac
Upgrade dompurify 2024-10-08 23:23:52 -05:00
Alex Gleason
11193fa689
Upgrade @gleasonator/policy in deno.lock 2024-10-08 20:11:12 -05:00
P. Reis
49d815826c refactor(languageSchema): enforce return type 2024-10-08 17:07:05 -03:00
P. Reis
fc5e9b2990 Revert "refactor: move getConfigs() function and frontendConfig logic to 'src/utils/frontendConfig.ts'"
This reverts commit ab85360d2f.

The discussion started publicly in Gitlab: https://gitlab.com/soapbox-pub/ditto/-/merge_requests/537#note_2148430111
Then it kept going in Element, basically the purpose of the commit is
correct, but the way Patrick did it is not good.
2024-10-08 16:58:42 -03:00
P. Reis
20caaa9ebd refactor: LibreTranslate and DeepL with separate environment variables for their configuration 2024-10-08 16:53:30 -03:00
Alex Gleason
8abac7ffa7
InstanceV2: remove supported_mime_types property 2024-10-08 12:52:14 -05:00
P. Reis
dbd590228d fix: typo 2024-10-08 14:39:59 -03:00
P. Reis
f76ee000b0 refactor: use 'lang' instead of 'target_language' 2024-10-08 14:35:51 -03:00
Alex Gleason
e6495c3687
Also add nostr to InstanceV2 2024-10-08 12:35:03 -05:00
Alex Gleason
248324f642
Add pleroma to InstanceV2 2024-10-08 12:32:00 -05:00
P. Reis
a3bc5ec5c3 refactor: remove translation enabled in instanceV1Controller 2024-10-08 14:27:00 -03:00
P. Reis
ba23931727 refactor: remove unused imports 2024-10-08 14:25:25 -03:00
P. Reis
d4a8ec21fe fix: add 'pure' option in EventsDB
if pure is true, EventsDB will return a Nostr event, otherwise it will return a Ditto event
2024-10-08 14:17:27 -03:00
P. Reis
df27959d35 fix(relay.ts): purify event 2024-10-08 14:15:48 -03:00
P. Reis
17be4ab48f fix(instanceV1Controller): add translation field 2024-10-08 11:11:29 -03:00
P. Reis
3f00f255a5 fix: type assertions in EventsDB 2024-10-08 11:01:34 -03:00
P. Reis
6c93153117 refactor: get language from event itself 2024-10-07 17:55:50 -03:00
P. Reis
acbdae29ae fix(EventsDB): type is correct, ignore type complaint 2024-10-07 17:54:41 -03:00
P. Reis
bfab84d937 refactor: make provider lowercase because supporting case insensitive is allegedly protocol bloat 2024-10-07 17:54:03 -03:00
P. Reis
4712cb1d80 fix: fix language property in the Mastodon API 2024-10-07 16:08:23 -03:00
P. Reis
bbbce958d9 chore: update nostrify:db 2024-10-07 16:04:59 -03:00
P. Reis
01a16473ab Merge branch 'main' into translate-status 2024-10-07 15:02:47 -03:00
P. Reis
b369b2171d feat: create translateController - /api/v1/statuses/:id/translate 2024-10-07 15:02:04 -03:00
P. Reis
8e58b1a7d4 feat: create translatorMiddleware 2024-10-07 15:00:46 -03:00
P. Reis
a2d8478e1a test(LibreTranslateTranslator): create multiple tests 2024-10-07 14:59:05 -03:00
P. Reis
c23ddb7d84 feat: create LibreTranslateTranslator class that implements DittoTranslator 2024-10-07 14:58:33 -03:00
P. Reis
321d26b470 test(DeepLTranslator): create multiple tests 2024-10-07 14:55:12 -03:00
P. Reis
27f435a93c feat: create DeepLTranslator class that implements DittoTranslator 2024-10-07 14:54:10 -03:00
P. Reis
ea4d0f002a feat: create dittoTranslations LRUCache, create DittoTranslator interface, create MastodonTranslation type, create DittoTranslation type, create Provider type and some other minor ones 2024-10-07 14:42:10 -03:00
P. Reis
f434f87584 feat(instanceV2Controller): enable translation 2024-10-07 14:39:42 -03:00
P. Reis
c6626313bc feat: get TRANSLATION_PROVIDER, TRANSLATION_PROVIDER_ENDPOINT & TRANSLATION_PROVIDER_API_KEY enviornment variables 2024-10-07 14:38:55 -03:00
P. Reis
de8eba4079 feat: create getLanguage() function, used for testing purposes 2024-10-07 14:37:53 -03:00