obsidian-dictionary icon indicating copy to clipboard operation
obsidian-dictionary copied to clipboard

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

Open Moonbase59 opened this issue 3 years ago • 34 comments

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 avatar Aug 16 '21 19:08 Moonbase59

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

phibr0 avatar Aug 16 '21 19:08 phibr0

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 avatar Aug 16 '21 19:08 phibr0

Could you please try again with the newest Version?

phibr0 avatar Aug 16 '21 19:08 phibr0

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

Moonbase59 avatar Aug 16 '21 19:08 Moonbase59

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

phibr0 avatar Aug 16 '21 19:08 phibr0

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 avatar Aug 16 '21 19:08 Moonbase59

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.

Moonbase59 avatar Aug 16 '21 19:08 Moonbase59

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 avatar Aug 16 '21 19:08 phibr0

Or atleast this API is doing it

phibr0 avatar Aug 16 '21 19:08 phibr0

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

Moonbase59 avatar Aug 16 '21 19:08 Moonbase59

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

phibr0 avatar Aug 16 '21 20:08 phibr0

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!

Moonbase59 avatar Aug 16 '21 20:08 Moonbase59

Yes, the offline Dictionary works in english and chinese

phibr0 avatar Aug 16 '21 20:08 phibr0

But there’s no online directory for Chinese?

Moonbase59 avatar Aug 16 '21 20:08 Moonbase59

Just to be sure, hindi works in 2.15.1?

phibr0 avatar Aug 16 '21 20:08 phibr0

But there’s no online directory?

No, just the offline Dictionary for now.

phibr0 avatar Aug 16 '21 20:08 phibr0

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 → शब्दकोश

Moonbase59 avatar Aug 16 '21 20:08 Moonbase59

Any Console Errors?

phibr0 avatar Aug 16 '21 20:08 phibr0

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 avatar Aug 16 '21 20:08 Moonbase59

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

"//This really needs a refactor" :rofl:

Moonbase59 avatar Aug 16 '21 20:08 Moonbase59

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

phibr0 avatar Aug 16 '21 20:08 phibr0

Wonder why string was undef, though.

Moonbase59 avatar Aug 16 '21 20:08 Moonbase59

The undefined Strings should be fixed now

phibr0 avatar Aug 17 '21 07:08 phibr0

Japanese is also working: ありがとう image

phibr0 avatar Aug 17 '21 07:08 phibr0

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 avatar Aug 17 '21 07:08 phibr0

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

https://github.com/meetDeveloper/freeDictionaryAPI/commit/e1a9c6c2245b5684f9503ff6d6f51e2ac6dfeae1

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 avatar Aug 17 '21 07:08 phibr0

See #43

phibr0 avatar Aug 17 '21 08:08 phibr0

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

Moonbase59 avatar Aug 17 '21 08:08 Moonbase59

@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.

meetDeveloper avatar Aug 17 '21 17:08 meetDeveloper

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

phibr0 avatar Aug 17 '21 17:08 phibr0

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

phibr0 avatar Aug 21 '21 10:08 phibr0

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

Moonbase59 avatar Aug 23 '21 21:08 Moonbase59

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

Viniuau avatar Aug 27 '21 22:08 Viniuau

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

Viniuau avatar Sep 06 '21 19:09 Viniuau