Dict: offline version?

ah, found two matches in Code search results · GitHub

  1. dictfmt -p wiktionary-en --locale en_US.UTF-8 --columns 0 -u http://en.wiktionary.org from nixpkgs/pkgs/servers/dict/wiktionary/wiktionary2dict.py at a29cf4aece7ed0f497f600faec9614c6feb5159b · NixOS/nixpkgs · GitHub
  2. dictfmt_index2word --locale $locale < "$base".index > "$base".word || true from nixpkgs/pkgs/servers/dict/dictd-db-collector.nix at a29cf4aece7ed0f497f600faec9614c6feb5159b · NixOS/nixpkgs · GitHub

So based on the errors from above:

/nix/store/7cni7ndy2pm18ysl5znq6znb30sxp156-stdenv-linux/setup: line 1626: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8): No such file or directory
/nix/store/m36d29gn5gm9bk0g7fcln1v8171hvn95-bash-5.2-p15/bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
awk: cmd. line:4: fatal: cannot open file `en_US.UTF-8' for reading: No such file or directory
dictfmt: option '--locale' requires an argument

I’m guessing it’s the second script that’s failing as $locale must not be set.

edit: correction: $locale is set, but some relevant file is missing (per nearby log lines). Looking at the awk error triggered by this dictfmt_index2word script and the dictfmt -i command it calls, I’m unclear on what’s happening… maybe somehow the index2word script is dropping the --locale arg and it would work if --locale=$locale was used by the nix script? reason for this hypothesis: this while loop is moving over whitespace-expansion, meaning the $locale encounters that loop all by itself lonesome, and gets consumed by that break clause?


I guess the root cause is line 1626: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8): No such file or directory but I don’t know much about setlocale or why/where that missing file logic is for me to debug… Any ideas?