From 1af4a0b82659288773314906c2de20bd3656f876 Mon Sep 17 00:00:00 2001 From: Linnea Gräf Date: Wed, 13 Nov 2024 14:13:53 +0100 Subject: meta: Add translation ordering pre commit check --- .pre-commit-config.yaml | 15 +++++++++++---- check-translation-ordering.sh | 7 +++++++ 2 files changed, 18 insertions(+), 4 deletions(-) create mode 100755 check-translation-ordering.sh diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6d0e52d..775137d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,14 @@ # SPDX-License-Identifier: CC0-1.0 repos: - - repo: https://github.com/fsfe/reuse-tool - rev: v3.1.0a1 - hooks: - - id: reuse + - repo: https://github.com/fsfe/reuse-tool + rev: v3.1.0a1 + hooks: + - id: reuse + - repo: local + hooks: + - id: ordered_translations + name: "Check translation ordering" + language: script + files: translations/.* + entry: ./check-translation-ordering.sh diff --git a/check-translation-ordering.sh b/check-translation-ordering.sh new file mode 100755 index 0000000..ebecb7c --- /dev/null +++ b/check-translation-ordering.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +# SPDX-FileCopyrightText: 2023 Linnea Gräf +# +# SPDX-License-Identifier: GPL-3.0-or-later + +set -euo pipefail +jq -S --tab < translations/en_us.json | diff translations/en_us.json - -- cgit