GithubHelp home page GithubHelp logo

ealap / linguacafe Goto Github PK

View Code? Open in Web Editor NEW

This project forked from simjanos-dev/linguacafe

0.0 0.0 0.0 89.34 MB

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

Home Page: https://simjanos-dev.github.io/LinguaCafeHome/

Shell 0.04% Python 3.41% PHP 37.13% Batchfile 0.17% Vue 57.99% Blade 1.26%

linguacafe's Introduction

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 in this overview.

Library

Reader

Review

Vocabulary

Language support

Lemma: a dictionary form of a word (E.g: worked -> to work).
Gender tagging: extending nouns' lemma with additional information (E.g: hus -> et hus).

Flag Language DeepL Lemma generation Gender tagging Dictionaries
Chinese wiktionary, cc-cedict
Czech wiktionary, dict cc
Dutch dict cc
Finnish inaccurate wiktionary, dict cc
French wiktionary, dict cc
German wiktionary, dict cc
Italian wiktionary, dict cc
Japanese jmdict, wiktionary
Korean wiktionary, kengdic
Norwegian wiktionary, dict cc
Russian wiktionary, dict cc
Spanish wiktionary, dict cc
Swedish dict cc
Ukrainian wiktionary
Welsh wiktionary, eurfa

Chinese: Mandarin language with simplified Chinese characters.

Supported platforms:

  • x64, which includes most desktop computers made in the last decade.
  • Macs with Apple silicon are supported, but need to uncomment the line that says platform: linux/amd64 by removing the "#" near the end of the docker-compose.ymlfile. To do this, you will need to split the chained install command, first clone the repository, then uncomment the line, then run the rest of the commands. You will also need to comment it and uncomment it again for each update to avoid git conflict error.

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

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"

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

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

I recommend making a copy of your linguacafe folder before updating, to make sure you will have a backup if anything goes wrong.

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

Kengdic

Languages: Korean

Download: GitHub release

Eurfa

Languages: Welsh

Download: GitHub release

Wiktionary

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

Download: GitHub release

Dict.cc

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

Download: dict.cc

This dictionary's license only allows 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, Finnish: fi, French: fr, German: de, Italian: it, Japanese: ja, Korean: ko, 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

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  

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

linguacafe's People

Contributors

simjanos-dev avatar tlaborde avatar sergiolaverde0 avatar systemcrash avatar harabat avatar mitch-briner avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.