Commit Graph

206 Commits

Author SHA1 Message Date
Sylvestre Ledru 91eff6008f add apt update before install 2026-03-27 10:08:06 +01:00
Sylvestre Ledru 3fbdfe9225 Add localized generation date at the bottom of doc pages 2026-03-26 17:49:05 +01:00
Sylvestre Ledru 42d579a161 Install babel in CI for locale display name generation 2026-03-22 20:40:44 +01:00
Sylvestre Ledru 24a8207e0a Auto-detect locales in build-docs-l10n.sh from coreutils source
Replace hardcoded FTL_TO_URL and LANG_NAMES maps with dynamic
detection. ftl_to_url() derives URL codes from FTL filenames
(e.g., fr-FR -> fr, zh-Hans -> zh-Hans). locale_display_name()
uses python3+babel for native language names with fallback to the
code itself. New locales are now picked up automatically without
editing the scripts.
2026-03-22 20:40:25 +01:00
Sylvestre Ledru 57433becaa Fix language selector regex to match zh-Hant, zh-Hans, nb-NO, etc.
The URL matching regex only accepted two-letter codes or two-letter
plus two uppercase (e.g., pt-BR), missing codes like zh-Hant with
longer suffixes. Use [a-zA-Z]+ after the hyphen to match all codes.
2026-03-22 20:00:48 +01:00
Sylvestre Ledru 0f38d27854 Fall back to English tldr examples when translation is missing
Merge translated tldr zips with the English one so that utilities
without translated examples (e.g., cut in French) still show the
English examples instead of having no Examples section at all.
Add a notice on affected pages linking to the tldr-pages project
for contributors to help translate the examples.
2026-03-22 19:52:08 +01:00
Sylvestre Ledru 50a4a9de74 Fix set -e compatibility in build-docs-l10n.sh
Use a global variable (MERGE_HAD_FALLBACK) instead of return codes
for merge_ftl, and use if/fi instead of [ ] && cmd in restore_en.
Both patterns caused silent script abortion under set -euo pipefail
when returning non-zero exit codes.
2026-03-22 18:40:01 +01:00
Sylvestre Ledru 59e691e8e1 Exclude en-US.ftl when copying l10n locales into coreutils
The l10n repo contains en-US.ftl files that can overwrite the
coreutils English originals, causing translated docs to show text
from the wrong language. Skip en-US.ftl during the copy to preserve
the authoritative English strings.
2026-03-22 18:40:01 +01:00
Sylvestre Ledru 346b919a8c Add Weblate translation notice on pages with untranslated strings
When a utility page has strings that fell back to English, inject a
notice linking to the corresponding Weblate translation page so
contributors can help complete the translation.
2026-03-22 18:40:01 +01:00
Sylvestre Ledru f108503f5a Merge translated FTL with English fallback instead of replacing
When building translated docs, the script was replacing en-US.ftl
entirely with the translated file. This caused raw FTL identifiers
(e.g. mknod-help-mode) to appear in the docs when translations were
empty or partial. Now merges translated keys with English so that
untranslated keys fall back to English text.
2026-03-22 18:40:01 +01:00
Sylvestre Ledru eb5433425b Fix stale uucore locales path in build-docs-l10n.sh 2026-03-22 18:40:01 +01:00
Sylvestre Ledru d03e51d3a7 Fix build-docs-l10n.sh: resolve coreutils dir to absolute path
The script uses cd then references the dir again, so a relative
path like 'coreutils' breaks. Resolve to absolute at startup.
2026-03-22 09:42:33 +01:00
Sylvestre Ledru 337375bb49 Pass coreutils-l10n dir to theme patch script in CI 2026-03-22 09:35:17 +01:00
Sylvestre Ledru 3fb2289988 Auto-detect locales in build-docs-l10n.sh from coreutils source
Scan coreutils/src/uu/ls/locales/*.ftl to discover available
translations instead of maintaining a hardcoded language list.
2026-03-22 09:35:10 +01:00
Sylvestre Ledru f0c206ab48 Improve theme patch: dynamic locale list, fix local file:// URLs
- Scan coreutils-l10n for available locales instead of hardcoding
- Fix language switcher to use relative path replacement so it works
  with both deployed and local file:// URLs
- Move links into the existing .additional div for better layout
2026-03-22 09:35:02 +01:00
Sylvestre Ledru 7f9102ed0c Replace manpage build with multi-language mdbook docs in CI
- Remove manpage generation step and man2html dependency
- Add mdbook theme patching for language selector and utility links
- Repack tldr zip with pages/ prefix (uudoc expects this structure)
- Build translated docs via build-docs-l10n.sh for 18 languages
- Collect translated docs to /coreutils/docs-{lang}/
2026-03-22 09:13:57 +01:00
Sylvestre Ledru 6e9e149052 Add build-docs-l10n.sh for multi-language mdbook docs
Generates translated documentation by swapping locale .ftl files
into en-US.ftl (since uudoc hardcodes that filename), re-running
uudoc with translated tldr examples, and building mdbook per language.
2026-03-22 09:13:28 +01:00
Sylvestre Ledru 3d55b20997 Add mdbook theme patch with language selector and utility links
Injects a dropdown language selector and "Source code" / "Report an
issue" links into utility pages via head.hbs JavaScript.
2026-03-22 09:13:19 +01:00
Sylvestre Ledru f3ff4f42a3 Remove manpage generation in favor of mdbook docs
The existing mdbook docs at /coreutils/docs/ already provide utility
documentation. Remove the redundant manpage HTML generation scripts
and templates.
2026-03-22 09:13:11 +01:00
Sylvestre Ledru 96cc48809d Fix l10n copy: only copy locales into existing coreutils utilities
The l10n repo contains utilities (e.g. hashsum) that don't exist in
the coreutils workspace. Copying entire directories created phantom
workspace members that broke Cargo.
2026-03-21 23:07:49 +01:00
Sylvestre Ledru f16fe412fd Fix CI: copy l10n before docs build, handle manpage build failures
- Move l10n locale copy to a separate workflow step before docs build
  to avoid triggering uudoc rebuilds with different cargo features
- Build uudoc once, then reuse for all languages
- Handle per-language build failures gracefully (skip and continue)
- Remove unused L10N_DIR parameter from build-all-manpages.sh
2026-03-21 23:03:03 +01:00
Sylvestre Ledru 59735c57a6 Wire up multi-language manpage build in CI workflow
- Checkout coreutils-l10n repo for translations
- Replace inline manpage generation with build-all-manpages.sh
- Fix tldr download URL to use GitHub releases
- Collect translated manpages into /coreutils/manpages-{lang}/
2026-03-21 22:23:22 +01:00
Sylvestre Ledru f04cdb2e69 Add build-all-manpages.sh for multi-language manpage generation
Orchestrates manpage builds for 19 languages: downloads per-language
tldr archives, copies l10n locales into coreutils, generates manpages
with the appropriate LANG setting, and invokes build-manpages.sh with
English tldr fallback for each language.
2026-03-21 22:23:18 +01:00
Sylvestre Ledru 8f16f6bfcd Add language and fallback tldr support to build-manpages.sh
Accept optional lang and fallback-tldr-dir parameters. When a
translated tldr page is missing, fall back to the English version
with a notice linking to the tldr translation contributing guide.
2026-03-21 22:23:13 +01:00
Sylvestre Ledru c3a54b0a9c Add language support to manpage templates
Add language navigation bar, html lang attribute, and template
placeholders ({{LANG_CODE}}, {{LANG_NAME}}, {{MANPAGES_PATH}})
to both the individual manpage and index templates.
2026-03-21 22:23:08 +01:00