Files
Olivier Meunier 887d0028d1 Moved locales to BCP47 codes
This is a big change, as it renames locale and documentation folders.

- renamed translation folders following BCP47 codes
- improved display of available translations
  Each translation is now displayed in its own language and in the
  current user's language.
- the default language is now "en" instead of "en-US"
- renamed folders in docs/src and docs/translations
- don't copy images from docs/src when they don't contain an index.md
  file
- added a user.Lang() method that returns a code that is guaranteed to
  be available in the locale list
2025-12-16 15:22:05 +01:00

56 lines
1.1 KiB
Makefile

# SPDX-FileCopyrightText: © 2025 Olivier Meunier <olivier@neokraft.net>
#
# SPDX-License-Identifier: AGPL-3.0-only
ifneq ($(shell command -v uv),)
PYRUN=$(shell command -v uv) run
else ifeq ($(shell python3 -c "import babel" 2>/dev/null && echo ok),ok)
PYRUN=$(shell command -v python3)
endif
GO ?= go
all: compile
# Extract all the messages
extract:
ifneq ($(PYRUN),)
$(PYRUN) messages.py extract
else
@echo "ERROR: python with babel not found"
@false
endif
# Update po files
update:
ifneq ($(PYRUN),)
$(PYRUN) messages.py update
else
@echo "ERROR: python with babel not found"
@false
endif
# Generate markdown from po files.
generate:
ifneq ($(PYRUN),)
$(PYRUN) messages.py generate
else
@echo "WARNING: python with babel not found, not translating docs"
endif
check:
ifneq ($(PYRUN),)
$(PYRUN) messages.py check
else
@echo "ERROR: python with babel not found"
@false
endif
build: generate
$(GO) run ../tools/docs src assets
$(GO) run ../tools/yaml-compose api/api.yaml assets/api.json
clean:
rm -rf assets/*
find src -name '*.md' -not -regex "src/en/.*" -delete