diff options
Diffstat (limited to 'build-aux')
-rwxr-xr-x | build-aux/apply-translations.sh | 12 | ||||
-rwxr-xr-x | build-aux/assert-spelling.sh | 34 | ||||
-rwxr-xr-x | build-aux/extract-translations.sh | 15 | ||||
-rw-r--r-- | build-aux/spelling/en.txt | 69 | ||||
-rw-r--r-- | build-aux/spelling/eo.txt | 11 | ||||
-rw-r--r-- | build-aux/spelling/fr.txt | 8 | ||||
-rw-r--r-- | build-aux/spelling/international.txt | 251 | ||||
-rw-r--r-- | build-aux/spelling/pt.txt | 134 | ||||
-rwxr-xr-x | build-aux/sync-translations.sh | 5 |
9 files changed, 539 insertions, 0 deletions
diff --git a/build-aux/apply-translations.sh b/build-aux/apply-translations.sh new file mode 100755 index 0000000..e1b92db --- /dev/null +++ b/build-aux/apply-translations.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu + +for f in $(git ls-files | grep -E '.(md|slides)$' | grep -v '^vendor/reveal.js$'); 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 . -name '*.md' -exec grep -l "^ref: $ref$" {} \;) -exec grep -l '^lang: en$' {} \;) + po2md "$FROM" --pofiles "locale/$l/LC_MESSAGES/${FROM%.md}.po" --quiet --save "$f" + fi +done diff --git a/build-aux/assert-spelling.sh b/build-aux/assert-spelling.sh new file mode 100755 index 0000000..0503a4b --- /dev/null +++ b/build-aux/assert-spelling.sh @@ -0,0 +1,34 @@ +#!/bin/sh +set -eu + +export LANG=C.UTF-8 + +for DICT in build-aux/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 build-aux/spelling/international.txt "build-aux/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/build-aux/extract-translations.sh b/build-aux/extract-translations.sh new file mode 100755 index 0000000..2333865 --- /dev/null +++ b/build-aux/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/build-aux/spelling/en.txt b/build-aux/spelling/en.txt new file mode 100644 index 0000000..aff474d --- /dev/null +++ b/build-aux/spelling/en.txt @@ -0,0 +1,69 @@ +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 +sandboxed +scriptable +shouldn +symlinks +syncable +só +tradeoffs +unintuitive +unmastered +untrusted +unwatched +ve +wasn +whiteboarding +wouldn diff --git a/build-aux/spelling/eo.txt b/build-aux/spelling/eo.txt new file mode 100644 index 0000000..8629511 --- /dev/null +++ b/build-aux/spelling/eo.txt @@ -0,0 +1,11 @@ +- +CC +CD +EC +H +HML +L +M +Podkastaĵoj +ernis +odiaŭ diff --git a/build-aux/spelling/fr.txt b/build-aux/spelling/fr.txt new file mode 100644 index 0000000..aa09184 --- /dev/null +++ b/build-aux/spelling/fr.txt @@ -0,0 +1,8 @@ +' +AJA +dimanche +earned +oday +ppris +só +ujourd'hui diff --git a/build-aux/spelling/international.txt b/build-aux/spelling/international.txt new file mode 100644 index 0000000..b8a8c27 --- /dev/null +++ b/build-aux/spelling/international.txt @@ -0,0 +1,251 @@ +144p +1D +250GB +2D +2nix +32GB +500GB +81F90EC3CD356060 +8GB +ABloibce +AGPLv +AGPLv3 +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 +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 +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 +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 +bindgen +blockchain +boneco +br +brainer +buildGoModule +cURL +cargo2nix +carte +cbindgen +cgit +ci +clojure +cronjob +da +datalog +datom +datoms +divoplade +dl +dos +e +earned +edn +en +eo +euandre +euandreh +eval +favicon +ffi +fi +fr +frontend +gPodder +gcrypt +ge +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 +txt +v8 +vlog +webtorrent +www +xp +xyz +youtube +à diff --git a/build-aux/spelling/pt.txt b/build-aux/spelling/pt.txt new file mode 100644 index 0000000..c7da56d --- /dev/null +++ b/build-aux/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 diff --git a/build-aux/sync-translations.sh b/build-aux/sync-translations.sh new file mode 100755 index 0000000..504fef3 --- /dev/null +++ b/build-aux/sync-translations.sh @@ -0,0 +1,5 @@ +#!/bin/sh +set -eux + +sh build-aux/extract-translations.sh +sh build-aux/apply-translations.sh |