chinese-words-separator / chinese-words-separator.github.io

5 stars 1 forks source link

Sync #6

Open chinese-words-separator opened 1 year ago

chinese-words-separator commented 1 year ago

From a language learner:

1.) Wordlist Sync? Maybe I haven't figured it out but how do I get to sync my known words list across different devices ? I have a windows laptop at work and mac at home. I am logged in with the same google account but I don't think there is a way to sync the word list? I managed to copy the associated file in the extensions folder manually, but that is obviously not very practical. Is there an option somewhere that I missed? If not, any chance to add automatic sync somehow ?

"As Google documentation puts it, in a somewhat tongue-in-cheek fashion:

chrome.storage is not a big truck. It's a series of tubes. And if you don't understand, those tubes can be filled, and if they are filled when you put your message in, it gets in line, and it's going to be delayed by anyone that puts into that tube enormous amounts of material.

Sync storage requires support from Google's infrastructure - and they are not willing to give it out for free in unlimited amounts." -- https://stackoverflow.com/questions/29732514/storage-quota-for-chrome-storage-sync/29732624#29732624

Will add sync functionality for words that are marked learned, as well as words in Recall, and Rewrite. Sync will be a subscription option, the subscription cost will be priced reasonably.

  1. Is there a way to show my current learned/unknown word list similar to the 'recall' UI? That might be another way of solving the sync issue above (if sync is not possible). Letting users export/import known word lists to a csv or txt file.

Yes there is a way, this is in Options' statistics screen. In Options screen, click the button that resembles a chart:

image

After clicking the chart button, this will be shown:

image

You can export the list of words that you've already marked as learned, this can be accomplished by clicking the button labeled Copy learned to clipboard, then you save it to a text file, or even just paste it to your chat app (e.g., FB messenger, Skype). Then when you arrived home (or vice versa), to import, copy the list back, and then click the button labeled Restore learned from clipboard

To see the high frequency words that you haven't learned yet, you can click the All HSK. Accordingly, you can select between Gray-out learned and Hide learned, the option is at the bottom of the screen. Screenshot:

image
ignosticism commented 1 year ago

I am that language learner. Thank you for your response! While automatic sync would be more convenient obviously, the workaround with the clipboard will do for the time being, thanks for pointing that out! It is well hidden XD, I would suggest adding it to the right-click main menu ( or the more tools section).

chinese-words-separator commented 1 year ago

I would suggest adding it to the right-click main menu ( or the more tools section).

I think the functionality on the page itself would suffice. The menus are not available on Safari, as well as on Kiwi mobile browser

ignosticism commented 1 year ago

Hey! So I've been trying to manually sync my list but have run into some issues.

  1. There is currently no way to 'delete all' on the learned list ?
  2. I tried restoring my list from my main device (macos laptop) on my secondary device (PC). Does it replace the old list? or simply add all word to that list creating duplicates? Anyway right now I seem to see the words in the learned list, but when reading content those words still appear colored (unknown). I have set the 'exclude learned words from colors option'. Any Idea what might be causing this?

For instance, I know that 90% of the words in the paragraphs below are in my ' learned list".

example1 example2

chinese-words-separator commented 1 year ago

There is currently no way to 'delete all' on the learned list ?

Yes there is no 'delete all'

I tried restoring my list from my main device (macos laptop) on my secondary device (PC). Does it replace the old list? or simply add all word to that list creating duplicates?

Restoring keeps the existing list intact and will simply add all words, but it won't create duplicates

Anyway right now I seem to see the words in the learned list, but when reading content those words still appear colored (unknown). I have set the 'exclude learned words from colors option'. Any Idea what might be causing this?

What's the URL of the chicken site, I'll check what might be causing it

On your screenshot, do you have the following marked as learned? Hence having the original (black) color?

的
和
在
多

Paste here the 為了 from your clipboard, I'll compare it against the 為了 in your screenshot (chicken). They might be looking the same but they maybe have different unicode value

mayblu commented 4 months ago

hi, i've been having the same issue with the copy-paste manual sync thing and i'm pretty sure i know why. neither the pinyin, hsk lv or frequency show up on the table of learned words after you copy paste it, so i guess for some reason that might make it confused and not mark the words as already learned/greyed out. :( i've been having to re-mark words i already marked on my seperate computer as learned on my current computer because of this.

chinese-words-separator commented 4 months ago

I think your CWS is at very old version. It's been long ago since the pinyin is not showing up when its initial data comes from restored learned instead of from visiting a Chinese website. On newer version, the pinyin is always in the listing, whether it comes from a visited Chinese website or from a restored learned from clipboard, as the pinyin is now always retrieved from the up-to-date data regardless of visiting a site or not, likewise with HSK level. The frequency is expected to be at zero initially when you restore learned on second computer if you haven't visited a Chinese website even once after installing CWS on the second computer

image

I tried to reproduce the problem on two separate and newly installed CWS, I copied the learned from the first one, and restored the learned on second one, can't reproduce the problem, it's working as intended

Here's the page on second one after restoring the learned from the first one

image

mayblu commented 4 months ago

ah, okay, thanks!! also, how would i get an updated version? i very recently downloaded it on both of my computers so i am unsure why it would be an old version, but maybe it is a chrome web store issue. should i reinstall and just hope it'll be updated, or is there something else i should do?

chinese-words-separator commented 4 months ago

Copy this and paste this in the address bar of Google Chrome. After pasting this in the address bar, press Enter key

chrome://extensions/?id=gacfacdpfimbkgcnlegknnmcccjgcbnp

You should see a latest version like this:

image

mayblu commented 4 months ago

I'm on version 8.24.84.2170, which i believe is the newest version (?) but it's still not working. :(

mayblu commented 4 months ago

i've included an image showing the version as well as a video of the issue. image

chinese-words-separator commented 4 months ago

I tried to repro the problem, the same steps as in your video, copy then delete then restore, all on same computer, it restores the learned correctly. There's pinyin and HSK level after restoring from clipboard

What browser are you using? The browser you are using might not be supporting the functionalities needed by CWS to work correctly. I'll install the browser you are using and try to reproduce the problem on my computer

chinese-words-separator commented 4 months ago

Try using Chrome or Edge, let me know if it exhibits the same problem

mayblu commented 4 months ago

What browser are you using? The browser you are using might not be supporting the functionalities needed by CWS to work correctly. I'll install the browser you are using and try to reproduce the problem on my computer

im using opera gx, which might be the problem, although it allows chrome extensions. i tried edge just now though, and it didn't work on edge either. here's the video. i don't know if it works on chrome, but chrome makes my computer run extremely slow and often crashes, so i don't think it would be a good idea to download chrome to try on there haha

chinese-words-separator commented 4 months ago

Thanks for reporting this problem. I was able to repro the problem on Chrome.. on Windows

The problem does not occur on Chrome on macOS and Linux. Windows for some reasons, does not keep clipboard things as-is. That is, Windows replaces '\n' in clipboard with '\r\n'

image

Hence the data that gets being restored in Windows was 英雄\r not 英雄, which makes the learned marker not be able to match all the 英雄 in the page against the learned 英雄\r from the database

Need to change this code, from this:

const text = await navigator.clipboard.readText();
const learnedHanzis = text.split('\n');

Into this:

const text = (await navigator.clipboard.readText()).replaceAll('\r\n', '\n');
const learnedHanzis = text.split('\n');

No more problem in Windows after that change in the code

Will publish the fix as soon as possible

The fix should also work on other browsers on Windows (e.g., Opera, Edge), unless there's some corner cases behavior on other browsers that make things go wonky on those browsers