Skip to content

Commit

Permalink
Update readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
jzohrab committed Apr 20, 2024
1 parent 25a7251 commit 6230302
Showing 1 changed file with 31 additions and 4 deletions.
35 changes: 31 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,25 @@ This directory of languages is added as a git submodule to lute itself.

# Adding a language

## Manual method

For each new language:

1. create a directory with the name of the language (really it can be anything)
2. create `definition.yaml` from `_templates/definition.yaml.example`, fill it in. The file name **matters**.
3. create a story .txt file from `_templates/story.yaml.example`, fill it in. The file name **does not matter**.

## Verifying
## Scripted

You can export a language and the first few pages of its book in Lute itself, assuming that you have loaded the language in your db:

```
python -m scripts.dump_lang_data Afrikaans Dutch
```

These are exported to `lute/db/language_defs`. The file changes can be committed in that submodule repository, and PRs opened to the language-defs repository as usual.

# Verifying

To verify the files, run

Expand All @@ -20,10 +32,25 @@ python verify_files.py

This does a simple sanity check of the files, it's not an exhaustive check.

The file definitions are also checked during Lute's CI.

# Including the latest languages in lute-v3 itself

This project is included as a git submodule in Lute, so if this repo's `master` branch changes, just update the reference:

```
# in root directory of lute itself
pushd lute/db/language_defs
git checkout master
git fetch origin
git merge origin/master # could also do git pull
popd
git add lute/db/language_defs
git commit -m "Update language defs."
```

# Notes

## Why is this a git submodule?

This directory/repo is just data, so ideally it would be pulled in at build time, but I had problems including the data files when packaging with flit. Submodules was the easiest solution I could come up with at the time. There is probably an easier way to do it, but this way works fine.

To include the latest language data in the lute build, update the submodule ref as needed ... docs to come.
This directory/repo is just data, so ideally it would be pulled in at build time, but I had problems including the data files when packaging with flit. Submodules was the easiest solution I could come up with at the time. There is probably an easier way to do it, but this way works fine for now.

0 comments on commit 6230302

Please sign in to comment.