LinguaCafe Save

LinguaCafe is a self-hosted software that helps language learners read foreign languages.

Project README

LinguaCafe

GitHub Release Static Badge Discord Static Badge Static Badge Static Badge

LinguaCafe is a free self-hosted software that helps language learners acquire vocabulary by reading. It provides a set of tools to read, look up unknown words and review them later as effortlessly as possible.

You can read about all the features of LinguaCafe on the overview GitHub Page, and on the user manual GitHub Wiki page.

   

Library

Reader

Review

Vocabulary

Language support

Supported languages: Chinese, Croatian, Czech, Danish, Dutch, English, Finnish, French, German, Greek, Italian, Japanese, Korean, Latin, Macedonian, Norwegian, Polish, Portuguese, Romanian, Russian, Slovenian, Spanish, Swedish, Thai, Turkish, Ukrainian, Welsh.

You can find a detailed list about what level of support different languages have on the GitHub Wiki page.

Supported platforms:

  • x64, which includes most desktop computers made in the last decade.
  • Mac users with Apple silicon must perform an additional step, see the 'Installation' section for details

Other Armv8 devices such as Raspberry Pis 3 and newer do not work at the moment.

Memory usage

LinguaCafe uses RAM based on how many and which languages do you use. If you use every language, the RAM usage can be over 2GB.

Installation

The installation process may seem a bit strange to some people. It is just a simple docker compose file, except that the git pull command pulls some empty folder structure, and some default files. You might understand it better, if you take a look at the deploy branch.

Step 1: Install docker desktop and git.

Step 2: Run the following commands from the location where you want to store your files:

Linux and MacOs:
git clone -b deploy https://github.com/simjanos-dev/LinguaCafe.git linguacafe && cd linguacafe

If you want to change the default MySQL database and user, you can create a .env file and add these lines to it before starting your servers for the first time:

DB_DATABASE="linguacafe"
DB_USERNAME="linguacafe"
DB_PASSWORD="linguacafe"

MacOs users with Apple silicon must also create a .env file, and add the following line:

PLATFORM="linux/amd64"

Run the remaining commands:

chmod -R 777 ./ && docker compose up -d
Windows:

Windows install commands are the same, except it does not need permission changes:

git clone -b deploy https://github.com/simjanos-dev/LinguaCafe.git linguacafe 
cd linguacafe
docker compose up -d

Alternatively, for Windows, you can download this installation script and run it instead of running the commands yourself. Since this is a .bat file, Windows defender will warn you about it being potentially a malware.

Your server now should be running and accessible on http://localhost:9191.

Step 3: Follow the instructions on this page in the Importing dictionaries section below to import dictionaries that you want to use.

Updating to the latest version

Always check this section and the update's release notes before updating, any important changes will be here.

Please backup linguacafe before updating, otherwise you can lose your data if anything goes wrong. You can read more about backups in the user manual

If you are below v0.5.2, please use the migration guide provided here instead of this command.

v0.9 Mac changes

If you are a Mac user with Apple silicon, and you had to uncomment a line in the docker-compose.yml file before, please follow these instructions before you update:

Step 1: Comment the the line again at the end of the docker-compose.yml file :

volumes:
    - ./storage:/var/www/html/storage
networks:
    - linguacafe
# platform: linux/amd64

Step 2: Create a .env file in the linguacafe, and add the this line to it:

PLATFORM="linux/amd64"

This change will will simplify the update process, and prevent any possible conflict errors with the git pull command in the future.

Linux and MacOs:
git pull && docker compose pull && docker compose up -d --force-recreate
Windows

On Windows, you can run again the installation script to update to the latest version, or run the commands separately:

git pull
docker compose pull
docker compose up -d --force-recreate

Importing dictionaries

Step 1: Download the dictionaries that you want to use from the provided links below.

Step 2: Copy the dictionary files to your linguacafe/storage/app/dictionaries folder.

Step 3: Go to the Admin -> Dictionaries page in LinguaCafe. Click on the Import dictionary button.

Step 4: This dialog will list all your importable dictionaries that are found in your dictionaries folder. Click on the import button for the dictionary that you want to import.

After the import process is finished, your dictionary should be working.

JMDict

Languages: Japanese

Download: GitHub release

All these 4 files are required to import JMDict:

  • jmdict_processed.txt
  • kanjidic2.xml
  • radical-strokes.txt
  • radicals.txt

This dictionary contains kanji and radicals for the Japanese language. Some Japanese features do not work without importing this dictionary.

CC-CEDICT

Languages: Chinese

Download: GitHub release

HanDeDict

Languages: Chinese

Download: GitHub release

Kengdic

Languages: Korean

Download: GitHub release

Eurfa

Languages: Welsh

Download: GitHub release

Wiktionary

Languages: Chinese, Czech, Finnish, French, German, Greek, Italian, Japanese, Korean, Latin, Norwegian, Russian, Spanish, Ukrainian, Welsh

Download: GitHub release

Dict.cc

Languages: Czech, Dutch, English, Finnish, French, German, Greek, Italian, Norwegian, Russian, Spanish, Swedish

Download: dict.cc

This dictionary's license only allow personal use.

Custom dictionary

You can also import a custom dictionary file in the form of a .csv file.

DeepL translate

DeepL is a machine translation service that let's you translate up to 500.000 characters/month for free and is supported by LinguaCafe. You can set your DeepL Translate API key in the admin API settings.

You must enable DeepL translate for each language on the Admin -> Dictionaries page.

Jellyfin configuration

You can use the network configuration from this example to connect Jellyfin's network with LinguaCafe. There are probably multiple ways to do it, the only requirement is that linguacafe-webserver should be able to reach Jellyfin's server to make API requests.

version: '3.5'
networks:
    linguacafe_linguacafe:
        external: true

services:
    jellyfin:
        image: jellyfin/jellyfin
        container_name: jellyfin
        user: 1000:1000
        volumes:
            - /path/to/config:/config
            - /path/to/cache:/cache
            - /path/to/media:/media:ro
        restart: 'unless-stopped'
        ports:
            - 8096:8096
        networks:
            - linguacafe_linguacafe

You must name your subtitle files in a way that Jellyfin will recognize as languages. These worked for me:

Series Name - S01E01.ja.ass  
Series Name - S01E01.de.ass  
Movie name.es.ass  

Language codes for subtitle filenames that Jellyfin recognizes: Chinese: zh, Czech: cs, Dutch: nl, English: en, Finnish: fi, French: fr, German: de, Greek: el, Italian: it, Japanese: ja, Korean: ko, Latin: la, Norwegian: no, Russian: ru, Spanish: es, Swedish: sv, Ukrainian: uk, Welsh: cy

Jellyfin external file naming

Possible error codes in browser console while importing from Jellyfin:

unsupported language code: spa: This means that Jellyfin recognized the language of the subtitle, but it is not supported by LinguaCafe yet. If you find one of these, please open a GitHub Issue, this should be fixed.

unsupported language code: unrecognized by jellyfin: japaaaneseee: This means that Jellyfin did not recognize japaaaneseee as a language, and it can only be fixed by renaming the file following Jellyfin's naming conventions.

If you have file naming issues and renamed a file, make sure you refresh metadata in Jellyfin before reloading LinguaCafe.

Jellyfin API usage

Step 1: Create an API key in Jellyfin. You can do this on the Dashboard -> API Keys menu.

Step 2: Set the created API key in LinguaCafe on to the Admin->API menu.

Step 3: Set the Jellyfin host in LinguaCafe on to the Admin->API menu. If you used the pre-written configs, it should be the default http://jellyfin:8096.

Step 4: Save the settings.

Now you can import subtitles from Jellyfin.

Anki

Anki is supported, if your server and Anki run on the same PC (this will not be a requirement in the future) and have AnkiConnect plugin installed.

Active development disclaimer

LinguaCafe is still in active development. There are missing features, and you might encounter some bugs while using the software. Please test it before you start actively using it, and make sure it is up to your expectations.

At this time only one user/server is supported.

Contact information

Discord invite

Discord user: linguacafe_47757

Reddit user: /u/linguacafe

Subreddit: /r/linguacafe

Attributions

LinguaCafe uses many public resources. I am very thankful for these projects and for all the people who were working on them. They helped me greatly to create LinguaCafe.

Spacy tokenizer

License: MIT license

Spacy website

Spacy github

Spacy license

Pykakasi

License: License: GNU General Public License 3

Pykakasi website

Pykakasi license

Pinyin

License: MIT license

Pinyin website

Pinyin github

Pinyin license

Newspaper3k

License: MIT, Apache-2.0

Newspaper3k github

Newspaper3k license

EbookLib

License: GNU Affero General Public License v3.0

EbookLib github

EbookLib license

JMDict dictionary file

License: Creative Commons Attribution-ShareAlike 4.0 International

JMDict Project website

JMDict license information

JMDict license

KANJIDIC2 kanji file

License: Creative Commons Attribution-ShareAlike 4.0 International

JMDict Project website

KANJIDIC2 license information

KANJIDIC2 license  

CC-CEDICT dictionary file
License: Creative Commons Attribution-Share Alike 3.0 License

CC-CEDICT website CC-CEDICT license  

HanDeDict dictionary file
License: Creative Commons Attribution-ShareAlike 2.0 Germany License

HanDeDict website HanDeDict license  

Kengdic dictionary file
License: GNU Library General Public License, version 2.0

Kengdic github Kengdic license  

Eurfa dictionary file
License: The GNU General Public License 3

Eurfa download website Eurfa bitbucket Eurfa creator's website Eurfa license  

Wiktionary

License: Creative Commons Attribution-ShareAlike 3.0 Unported License

Wiktionary website

Wiktionary license

The specific wiktionary files that LinguaCafe uses have been downloaded from this GitHub repository.

Dict.cc

LinguaCafe has no dict.cc dictionaries packaged in the software. It only provides a link to the dict.cc website.

Dict.cc license

RADKFILE/KRADFILE

License: Creative Commons Attribution-ShareAlike 4.0 International

JMDict Project website

KRADKFILE license information

KRADKFILE license

DMAK kanji drawing library

License: MIT license

DMAK github project

DMAK license

KanjiVG License: Creative Commons Attribution-ShareAlike 3.0 Unported

KanjiVG website

KanjiVG github

KanjiVG license

Open Source Agenda is not affiliated with "LinguaCafe" Project. README Source: simjanos-dev/LinguaCafe

Open Source Agenda Badge

Open Source Agenda Rating