Skip to content

Conversation

@MrHinsh
Copy link
Member

@MrHinsh MrHinsh commented Jul 28, 2025

This pull request introduces a set of tools and features for managing Hugo i18n YAML translation files and adds a new feature flag for conditional rendering in the navigation menu. Key changes include the addition of PowerShell scripts for translation management, updates to project documentation, and conditional logic for a "Guide Details" link in navigation.

Translation Management Enhancements:

  • New Script: Compare-YamlTranslations.ps1: A PowerShell script for comparing two YAML translation files to identify missing keys, differing values, and extra keys. It includes options to add missing keys automatically or preview changes with a -WhatIf flag.
  • New Script: Sync-Translations.ps1: A wrapper script for syncing translations between default module/site files or custom YAML files. It supports bidirectional sync, flexible file paths, and safe operations with a -WhatIf preview.
  • Documentation Update: .powershell/README.md: Comprehensive documentation for the new scripts, including usage examples, features, and workflow guidance.

Feature Flag and Conditional Rendering:

  • Feature Flag Addition: Introduced a features.guideDetails parameter in both module/hugo.yaml (set to true) and site/hugo.yaml (set to false) to control the visibility of the "Guide Details" link. [1] [2]
  • Conditional Rendering in Navigation: Updated module/layouts/_partials/components/guide-nav-menu.html to conditionally render the "Guide Details" link based on the features.guideDetails flag.

MrHinsh added 2 commits July 28, 2025 10:04
Introduces comprehensive scripts to compare and synchronize YAML translation files between Hugo modules and sites.

Compare-YamlTranslations.ps1 provides detailed analysis of translation differences, identifies missing keys, and can automatically add missing translations with proper YAML formatting.

Sync-Translations.ps1 offers a convenient wrapper with preset configurations for common workflows, supporting both default module-to-site syncing and custom file comparisons.

Features include dry-run capabilities, bidirectional synchronization, flexible path handling, and comprehensive error reporting to streamline translation maintenance workflows.
Introduces a configurable feature flag system to control the visibility of the guide details navigation link.

The module configuration enables the feature by default while the site configuration disables it, allowing selective deployment of the guide details functionality across different environments.
@MrHinsh MrHinsh self-assigned this Jul 28, 2025
Copilot AI review requested due to automatic review settings July 28, 2025 09:09
@MrHinsh MrHinsh enabled auto-merge July 28, 2025 09:10
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request introduces translation management tools for Hugo i18n YAML files and adds a feature flag system for conditional navigation rendering. The primary goal is to provide developers with utilities to synchronize translation files between module and site configurations while enabling selective display of navigation elements.

  • New PowerShell scripts for comparing and syncing YAML translation files with safety features
  • Feature flag implementation to control "Guide Details" link visibility in navigation
  • Comprehensive documentation for the translation management workflow

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
.powershell/Compare-YamlTranslations.ps1 Core script for comparing YAML translation files and identifying differences
.powershell/Sync-Translations.ps1 Wrapper script providing convenient interface for translation synchronization
.powershell/README.md Documentation for the PowerShell translation tools and usage examples
module/hugo.yaml Adds feature flag configuration with guideDetails set to true
site/hugo.yaml Adds feature flag configuration with guideDetails set to false
module/layouts/_partials/components/guide-nav-menu.html Implements conditional rendering for Guide Details link based on feature flag

@MrHinsh MrHinsh added this pull request to the merge queue Jul 28, 2025
Merged via the queue into main with commit 37d0324 Jul 28, 2025
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants