diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/apply-translations.sh | 12 | ||||
-rwxr-xr-x | scripts/assert-spelling.sh | 35 | ||||
-rwxr-xr-x | scripts/extract-translations.sh | 15 | ||||
-rw-r--r-- | scripts/spelling/en.txt | 70 | ||||
-rw-r--r-- | scripts/spelling/eo.txt | 11 | ||||
-rw-r--r-- | scripts/spelling/fr.txt | 8 | ||||
-rw-r--r-- | scripts/spelling/international.txt | 264 | ||||
-rw-r--r-- | scripts/spelling/pt.txt | 134 |
8 files changed, 549 insertions, 0 deletions
diff --git a/scripts/apply-translations.sh b/scripts/apply-translations.sh new file mode 100755 index 0000000..5920717 --- /dev/null +++ b/scripts/apply-translations.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu + +for f in $(git ls-files | grep -E '.(md|slides)$' | grep -Ev '^(vendor/reveal.js|TODOs.md|aux/)'); do + l="$(grep '^lang: ..$' "$f" | awk '{print $2}')" + if [ "$l" != 'en' ]; then + ref="$(grep '^ref: ' "$f" | awk '{print $2}')" + # shellcheck disable=2046 + FROM=$(find $(find . -type f -name '*.md' -exec grep -l "^ref: $ref$" {} \;) -type f -exec grep -l '^lang: en$' {} \;) + po2md "$FROM" --pofiles "locale/$l/LC_MESSAGES/${FROM%.md}.po" --quiet --save "$f" + fi +done diff --git a/scripts/assert-spelling.sh b/scripts/assert-spelling.sh new file mode 100755 index 0000000..f0053b4 --- /dev/null +++ b/scripts/assert-spelling.sh @@ -0,0 +1,35 @@ +#!/bin/sh +set -eu + +export LANG=C.UTF-8 +export JEKYLL_ENV=production + +for DICT in scripts/spelling/*.txt; do + sort "$DICT" | diff - "$DICT" || { + echo "The $DICT dictionary is unsorted. To fix it, run:" >&2 + echo " LANG=C.UTF-8 sort $DICT | sponge $DICT" >&2 + exit 1 + } +done + +OUT="$(mktemp)" +jekyll build --future --trace +# shellcheck disable=2044 +for f in $(find _site -type f -name '*.html'); do + if ! echo "$f" | grep -qE '(/vendor/|TODOs.html)'; then + l="$(head -n2 "$f" | tail -n1 | cut -d\" -f2)" + CURR_DICT="$(mktemp)" + cat scripts/spelling/international.txt "scripts/spelling/$l.txt" > "$CURR_DICT" + hunspell -u3 -H -d "$l" -p "$CURR_DICT" "$f" | tee -a "$OUT" + fi +done + +if [ -s "$OUT" ]; then + printf "\nvvv Mispelled words detected by hunspell.\n\n" + cut -d\ -f2- < "$OUT" | sort | uniq + printf "\n^^^\n" >&2 + exit 1 +else + echo "No spelling errors detected" + exit 0 +fi diff --git a/scripts/extract-translations.sh b/scripts/extract-translations.sh new file mode 100755 index 0000000..2333865 --- /dev/null +++ b/scripts/extract-translations.sh @@ -0,0 +1,15 @@ +#!/bin/sh +set -eu + +TRANSLATIONS='pt fr eo' + +for f in $(git ls-files | grep -E '.(md|slides)$' | grep -v '^vendor/reveal.js$'); do + file_lang="$(grep '^lang: ..$' "$f" | awk '{print $2}')" + if [ "$file_lang" = 'en' ]; then + for l in $TRANSLATIONS; do + OUT="locale/$l/LC_MESSAGES/${f%.md}.po" + mkdir -p "$(dirname "$OUT")" + md2po "$f" --include-codeblocks --quiet --save --po-filepath "$OUT" + done + fi +done diff --git a/scripts/spelling/en.txt b/scripts/spelling/en.txt new file mode 100644 index 0000000..d54b934 --- /dev/null +++ b/scripts/spelling/en.txt @@ -0,0 +1,70 @@ +Bashisms +Patches +Rollout +Slides +acyclic +analytics +aren +autocommit +backend +balancer +barcode +behaviour +centric +chargeback +combinators +config +couldn +cronjobs +culting +curation +dataset +declaratively +decrypting +definitionally +demoer +didactical +didn +differentiator +directionality +doesn +duplications +dynamicity +embeddable +english +exps +filesystem +filesystems +influent +isn +iteratively +maintainence +oday +parameterization +parameterizing +performant +podcatcher +portuguese +pre +preventively +programmatically +realising +reimplementation +repo +reproducibility +reusability +sandboxed +scriptable +shouldn +symlinks +syncable +só +tradeoffs +unintuitive +unmastered +untrusted +unwatched +ve +wasn +whiteboarding +wouldn diff --git a/scripts/spelling/eo.txt b/scripts/spelling/eo.txt new file mode 100644 index 0000000..8629511 --- /dev/null +++ b/scripts/spelling/eo.txt @@ -0,0 +1,11 @@ +- +CC +CD +EC +H +HML +L +M +Podkastaĵoj +ernis +odiaŭ diff --git a/scripts/spelling/fr.txt b/scripts/spelling/fr.txt new file mode 100644 index 0000000..aa09184 --- /dev/null +++ b/scripts/spelling/fr.txt @@ -0,0 +1,8 @@ +' +AJA +dimanche +earned +oday +ppris +só +ujourd'hui diff --git a/scripts/spelling/international.txt b/scripts/spelling/international.txt new file mode 100644 index 0000000..d87507e --- /dev/null +++ b/scripts/spelling/international.txt @@ -0,0 +1,264 @@ +144p +1D +250GB +2D +2nix +32GB +500GB +81F90EC3CD356060 +8GB +ABloibce +AGPLv +AGPLv3 +APIs +Agustín +AliceBob +André +Anna +Atom +Awk +B1 +BN +BSON +BY +BY-SA +Barrios +Binet +Bitbucket +BobAlice +CDN +CI +CLI +CRDT +CRDTs +Canhoto +Cantrill +Choro +Clojure +CoreData +CouchDB +DIY +DOM +DVCS +Datomic +Dengoso +EuAndreh +F +FFI +FP +FTS +Fastmail +Feldman +Forsgren +Freenode +GADTs +GTK +GitLab +Gmail +GoCD +GuixSD +HN +HTML +HTTPS +Halloway +Hardenberg +Haskell +Henney +Hodgson +I +IPs +ImmutableJS +IndexedDB +JS +JSON +Joyent +João +Kevlin +Kleppmann +L1 +LSM +LTS +LaTeX +Lerna +LilyPond +LiquidHaskell +MTA +Mailutils +Makefile +Marcha +Marinheiros +Matroska +McGranaghan +Mentat +Merkle +NPM +Neomutt +Nextcloud +NixOS +Nixpkgs +OOP +OTP +PNG +POSIX +ParsecC +Pastebin +Pavlo +Pernambuco +Petrov +Pittet +PoC +PouchDB +RDF +README +RPC +RPN +RSS +Raku +Reddit +Redux +SA +SMTP +SSD +SSMTP +STDIN +STDOUT +SVG +Saudade +Screencast +Screencasts +ShellCheck +Slava +Sourcehut +Spacemacs +StackOverflow +Staltz +Sten +T +TAB +TBs +TILs +TOML +Théodore +TypeScript +UI +URL +VPN +WebAssembly +WebTorrent +Wollrath +Wyant +Yandex +YouTube +Zig +apk +automerge +awk +bindgen +blockchain +boneco +br +brainer +buildGoModule +cURL +cargo2nix +carte +cbindgen +cgit +ci +clojure +cronjob +da +datalog +datom +datoms +divoplade +dl +dmenu +dos +e +earned +edn +en +eo +euandre +euandreh +eval +executables +favicon +ffi +fi +fr +frontend +fzf +gPodder +gcrypt +ge +getopts +gt +guix +guixbuild +h1 +h6 +html +https +i5 +i7 +ify +immer +intbytes +ios +ish +jekyll +jemoji +js +k8s +kramdown +kubernetes +libedn +lockfile +lockfiles +lt +memtable +memtables +merkle +myrepos +nixos +no-brainer +node2nix +noinform +npm +oday +org +pastebin +pastebins +plaintext +positionally +pouchdb +progn +pt +rollout +rollouts +sbcl +screencast +screencasts +sed +songbooks +sourcehut +sr +swift2nix +systemd +só +torrent +touchpad +troff +txt +v0 +v8 +vlog +webtorrent +www +xp +xyz +yeganesh +youtube +à diff --git a/scripts/spelling/pt.txt b/scripts/spelling/pt.txt new file mode 100644 index 0000000..c7da56d --- /dev/null +++ b/scripts/spelling/pt.txt @@ -0,0 +1,134 @@ +Abaixo +Agosto +Aprendi +Atualizado +Blog +Comente +Cópia +H +HEA +I +L +Lista +Me +Patches +Podcast +Postado +Postagens +Quando +T +Usar +Visite +Website +achar +arquivo +artigos +buscar +categoria +chegar +comece +comentário +como +completar +conhecimentos +contatar +criar +código +da +dados +de +desta +diretamente +direto +discussão +discussões +distribuir +do +dobráveis +dou eu +e +earned +email +empacotá +encontra +engasgo +entrada +envelope +escreva +escrever +escrevo +esforço +estou +eu +exemplo +existentes +extra +fazer +ficou +formatos +gerar +impressão +inglês +interessantes +internet +intervalos +jeito +las +licenciado +licença +log +los +mandar +mande +me +mensagem +mostrar +na +navegador +no +nome +normalmente +novo +o +oday +oje +ordená +os +padrão +para +parar +pessoal +podcast +por +post +postagens +prendi +procurando +procure +produção +projetos +pública +público +relacionados +reler +religioso +se +shell +significa +simples +sobre +tempo +teste +texto +timestamp +transpor +u +usando +usar +veja +versão +versões +vindas +Ícone +é +úteis |