Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.15.0: Russian & Portuguese doesn’t seem to work at all #42

Open
Moonbase59 opened this issue Aug 16, 2021 · 34 comments
Open

2.15.0: Russian & Portuguese doesn’t seem to work at all #42

Moonbase59 opened this issue Aug 16, 2021 · 34 comments
Labels
bug Something isn't working critical

Comments

@Moonbase59
Copy link

Moonbase59 commented Aug 16, 2021

Russian apparently uses the Free Dictionary API but has no synonym provider.

It doesn’t seem to work at all (not even an error message), try words like

Москва
Ру́сский
русский
словарь
язык

Same for Portuguese, word list I tried:

língua
dicionário
brasileiro
brasileira
@Moonbase59 Moonbase59 changed the title 2.15.0: Russian doesn’t seem to work at all 2.15.0: Russian & Portuguese doesn’t seem to work at all Aug 16, 2021
@phibr0
Copy link
Owner

phibr0 commented Aug 16, 2021

A Synonym Provider is not needed, the Synonym Popover won't work but the Sidebar lookup still should. Let me investigate

@phibr0
Copy link
Owner

phibr0 commented Aug 16, 2021

I think i already found the Error. These russian letters need to be urlencoded like so: https://api.dictionaryapi.dev/api/v2/entries/ru/%D0%91%D0%BE%D0%BB%D1%8C%D1%88%D0%BE%D0%B9

@phibr0 phibr0 added the bug Something isn't working label Aug 16, 2021
@phibr0
Copy link
Owner

phibr0 commented Aug 16, 2021

Could you please try again with the newest Version?

@Moonbase59
Copy link
Author

Yeah, thanks!

In the meantime, list of languages I could use:

de
en-US
en-GB
es
fr
it
ko
tr

Languages that didn’t work:

hi
ja
ru
pt-BR
ar
zh

@phibr0
Copy link
Owner

phibr0 commented Aug 16, 2021

These are all Languages with "non standard" letters right?

@Moonbase59
Copy link
Author

Moonbase59 commented Aug 16, 2021

Still not functioning (2.15.1):

  • Japanese
  • Russian
  • Portuguese
  • Arabic (unsure about RTL, just copied some words from Google Translate)
  • Chinese

These are the ones that worked:

-Dictionary TOC (2021-08-16) - Knowledgebase - Obsidian 0 12 12_140

@Moonbase59
Copy link
Author

Moonbase59 commented Aug 16, 2021

These are all Languages with "non standard" letters right?

I’d say "standard" lol, because Unicode. But yes, non-latin script, and odd word separators. Plus, with Arabic, a right-to-left language.

@phibr0
Copy link
Owner

phibr0 commented Aug 16, 2021

Yeah but they seem to get encoded differently in a URL

These russian letters need to be urlencoded like so: https://api.dictionaryapi.dev/api/v2/entries/ru/%D0%91%D0%BE%D0%BB%D1%8C%D1%88%D0%BE%D0%B9

@phibr0
Copy link
Owner

phibr0 commented Aug 16, 2021

Or atleast this API is doing it

@Moonbase59
Copy link
Author

Would probably not hurt always using encodeURIComponent() on the search phrases.

@phibr0
Copy link
Owner

phibr0 commented Aug 16, 2021

Did that in 2.15.1, need to investigate some more tomorrow for the other languages

@Moonbase59
Copy link
Author

Moonbase59 commented Aug 16, 2021

Btw, do we have an offline dictionary for Chinese? When selecting Chinese, it always switches to the Offline Dictionary …

Thanks for keeping on the track!

@phibr0
Copy link
Owner

phibr0 commented Aug 16, 2021

Yes, the offline Dictionary works in english and chinese

@Moonbase59
Copy link
Author

Moonbase59 commented Aug 16, 2021

But there’s no online directory for Chinese?

@phibr0
Copy link
Owner

phibr0 commented Aug 16, 2021

Just to be sure, hindi works in 2.15.1?

@phibr0
Copy link
Owner

phibr0 commented Aug 16, 2021

But there’s no online directory?

No, just the offline Dictionary for now.

@Moonbase59
Copy link
Author

Moonbase59 commented Aug 16, 2021

Just to be sure, hindi works in 2.15.1?

Hm. It worked before (see screenshot), and if I look something up, it shows it in the pane, but now it won’t create a file anymore?!

Try the word for "yes" → हाँ

Odd. The word for "dictionary" it writes a note for → शब्दकोश

@phibr0
Copy link
Owner

phibr0 commented Aug 16, 2021

Any Console Errors?

@Moonbase59
Copy link
Author

Here you go, had to clean all the old errors first ;-)

app.js:1 Obsidian Developer Console
main.ts:27 loading markdown-table-editor plugin
main.ts:40 Dataview: Version 0.4.x Loaded
main.ts:77 DiceRoller plugin loaded
main.ts:49 loading Find unlinked files and unresolved links plugin
main.ts:40 loading Hotkeys for templates plugin v1.4.2
main.ts:10 Loading Hotkeys++ plugin
main.ts:125 loading plugin
VM122:2 Loading Obsidian Leaflet v3.24.10
main.ts:55 loading plugin
main.ts:17 Sortable: loading plugin...
main.ts:25 Sortable: loaded plugin.
main.ts:17 Loading snippets plugin
main.ts:27 Loading Pandoc plugin
main.ts:31 Loading status bar pomodoro timer
VM147:4684 loading dictionary
VM148:10348 [Longform] Starting Longform 1.0.3…
main.ts:20 loading open-note-to-window-title plugin
index.ts:356 Dataview: Parsed all file prefixes (0.001s)
main.ts:148 Hotkeys for templates -> active plugins: templater-obsidian,core
VM148:10529 [Longform] Loaded and watching projects.
index.ts:409 Dataview: Initialized CSV row cache (loading 5 CSV files).
index.ts:247 Dataview: Task & metadata parsing queued in 0.001s.
DevTools failed to load SourceMap: Could not parse content for app://obsidian.md/main.js.map: Unexpected end of JSON input
VM147:4543 Uncaught (in promise) TypeError: Cannot read property 'split' of undefined
    at LocalDictionaryBuilder.cap (eval at <anonymous> (app.js:1), <anonymous>:4543:30)
    at eval (eval at <anonymous> (app.js:1), <anonymous>:4560:43)
    at Array.forEach (<anonymous>)
    at LocalDictionaryBuilder.eval (eval at <anonymous> (app.js:1), <anonymous>:4559:30)
    at Generator.next (<anonymous>)
    at eval (eval at <anonymous> (app.js:1), <anonymous>:31:71)
    at new Promise (<anonymous>)
    at __awaiter (eval at <anonymous> (app.js:1), <anonymous>:27:12)
    at LocalDictionaryBuilder.newNote (eval at <anonymous> (app.js:1), <anonymous>:4549:16)
    at Array.click_handler (eval at <anonymous> (app.js:1), <anonymous>:3091:60)
cap @ VM147:4543
eval @ VM147:4560
eval @ VM147:4559
eval @ VM147:31
__awaiter @ VM147:27
newNote @ VM147:4549
click_handler @ VM147:3091
click_handler @ VM147:2615
async function (async)
click_handler @ VM147:3091
click_handler @ VM147:2615

Happens the moment I click "new note" (with the word हाँ on screen)

@Moonbase59
Copy link
Author

Moonbase59 commented Aug 16, 2021

What are you splitting? Remember we have a lot of languages that don’t have a word separator.

"//This really needs a refactor" 🤣

@phibr0
Copy link
Owner

phibr0 commented Aug 16, 2021

I think I was splitting the word to capitalize it correctly, but that doesnt make any sense when you just enter one word, might remove it which should fix these errors

@Moonbase59
Copy link
Author

Wonder why string was undef, though.

@phibr0
Copy link
Owner

phibr0 commented Aug 17, 2021

The undefined Strings should be fixed now

phibr0 added a commit that referenced this issue Aug 17, 2021
@phibr0
Copy link
Owner

phibr0 commented Aug 17, 2021

Japanese is also working: ありがとう
image

@phibr0
Copy link
Owner

phibr0 commented Aug 17, 2021

Btw, do we have an offline dictionary for Chinese? When selecting Chinese, it always switches to the Offline Dictionary …

Well not really, its basically an English to Chinese Dictionary..

image

What still needs to be investigated:

  • Russian
  • Portuguese
  • Arabic

@phibr0
Copy link
Owner

phibr0 commented Aug 17, 2021

I found why all these Issues just started to happen..

meetDeveloper/freeDictionaryAPI@e1a9c6c

Removed references to language other than english.
API will soon start to use wiktionary as its source for defintion and currently it provides good support for English only.

@phibr0
Copy link
Owner

phibr0 commented Aug 17, 2021

See #43

@Moonbase59
Copy link
Author

Moonbase59 commented Aug 17, 2021

Sad. Just now when you got so far …
Confirm undef not giving errors anymore in 2.15.2, Hindi "yes" note created.

@meetDeveloper
Copy link

meetDeveloper commented Aug 17, 2021

@phibr0 @Moonbase59 As I have not changed any code in Dictionary API so I do not think that this bug is caused due to any recent changes from my side. As I said on other ticket, I will keep non english languages also up but have removed it from the website and github to avoid new users to use API for non english words. Adding wiktionary support for other languages will take some time as I am sole developer of Free Dictionary API but will keep them up.

@phibr0
Copy link
Owner

phibr0 commented Aug 17, 2021

Yeah already investigating, the API works, just not in Obsidian. Thank you so much!

@phibr0
Copy link
Owner

phibr0 commented Aug 21, 2021

Russian is working again! (Tested with: Привет)

@Moonbase59
Copy link
Author

Hm. Don’t work here. Your word didn’t show anything, my list words above show "No Definitions Found". Using v2.15.5.

@Viniuau
Copy link

Viniuau commented Aug 27, 2021

Portuguese always returns "No Definitions Found", even when using previously searched words. Version 2.15.5.

@Viniuau
Copy link

Viniuau commented Sep 6, 2021

Russian is working again, but the issue still persists when using Brazilian Portuguese.
image
Version 2.16.3

@phibr0 phibr0 moved this to in progress in Obsidian Plugins Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working critical
Projects
Status: in progress
Development

No branches or pull requests

4 participants