Skip to content

The Luxembourgish Online Dictionary made available to Dictionary.app on MacOS

License

Notifications You must be signed in to change notification settings

AlainVagner/LOD4Mac

Repository files navigation

LOD4Mac

What is this?

LOD is the Luxembourgish Online Dictionary, it is available on lod.lu. The purpose of this project is to package the definitions from LOD into a dictionary file compatible with Dictionary.app on MacOS, thus enabling the user to right-click with a mouse or to force tap with a trackpad on any word in Luxembourgish in most of the apps and get a direct access to its definition.

Screenshot of TextEdit showing the definition of a luxembourgish word

Installation

  1. Download the latest installation package from the release page. The name of the package looks like LOD4Mac-Installer-vX.Y.Z.pkg.
  2. Install this package.

Configuration

  1. Open Dictionary.app
  2. Go to the menu "Dictionary" > "Preferences"
  3. In the list at the top of the window, find in it the "Lëtzebuerger Online Dictionnaire (LOD)" and activate it.
  4. Go to the "System preferences" > "Keyboard" > "Text". In the "Spelling" drop-down, select "Set up..." at the bottom of the list and then activate "Lëtzebuergesch (Library)".
  5. Congratulations, the dictionaries are now installed on your system! 🎉

Usage

Short demo

Demo of LOD4Mac on Youtube

Get access to the definition of a word in most apps

When in an application supporting it (ex: Safari, TextEdit, Notes, ...), to get the definition of a word, you can force-click on it if you have a trackpad or right-click then select "Look Up" in the menu. The first time you use this feature, you will need to configure it to display information coming from dictionaries.

With Dictionary.app

You can select the LOD dictionary in the tabs on top of the window, then use the search field. For now, you can only search words in Luxembourgish.

Screenshot of Dictionary.app showing the definition of the word Squirrel in Luxembourgish

With Spotlight

It is possible to search the definition of a word with Spotlight. You can type the first letters of a word and Spotlight will try to automatically complete the word. In the results list, in the "definition" section, you can select the item corresponding to the word you are looking for and access its definition directly in the Spotlight window.

Screenshot of a Spotlight window with a luxembourgish word in the search field and the definition is shown

To enable this feature, you may need to configure it in the "System Preferences" then "Spotlight" and activate "Definition" in the "search results" tab.

Spell checking

The dictionary-lb-lu project from Spellchecker.lu is a HunSpell dictionary for the Luxembourgish language. This dictionary is included in the LOD4Mac package. MacOS can use HunSpell dictionaries for spell checking. Once you have installed this dictionary onto your system, you will be able to use it for spell checking in most applications.

Screenshot of a text field in Safari containing some text with spelling errors and a pop-up showing correction proposals

In the compatible apps, you can find the spell checker by right-clicking on a text input area and selecting "Spelling and grammar" then "Show spelling and grammar".

When using the MacOS spell checker, it seems to be more reliable to select the spelling dictionary than to rely on automatic language detection.

Screenshot of the MacOS spellchecker window

Development

The dictionary is produced using Apple's Dictionary Development Kit. A conversion script from the data coming from LOD and the format needed by the Dictionary Development is available in this repository.

To be able to generate the dictionary, please follow these steps:

  1. Clone the Dictionary Development Kit
  2. Clone this repository
  3. Adjust if necessary the variable DICT_BUILD_TOOL_DIR in ddk_lod_project/Makefile
  4. Install the required npm packages with npm install
  5. The HTML from the definitions comes from lod.lu, all the pages from the site will be crawled locally. To do this, run npm run crawl (duration: ~ 10 hours)
  6. Build the dictionary with npm run build. The resulting package is then available in the project folder.

Open Data

This dictionary is a reuse of the open data published by ZLS on data.public.lu:

License

This software is licensed under the MIT license. The dictionary produced by this software is published under Creative Commons Zero (public domain). The distribution package includes the files from the dictionary-lb-lu project from Spellchecker.lu which are distributed under the EUPL license.