Skip to content

Commit 45bbb5b

Browse files
authored
Merge pull request #126 from Hack23/copilot/analyze-news-article-generator
Complete multi-language localization for news indexes with dynamic content support
2 parents fe18194 + ae355ff commit 45bbb5b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+8087
-3999
lines changed

.github/workflows/news-article-generator.md

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ on:
1414
type: boolean
1515
required: false
1616
default: false
17+
languages:
18+
description: 'Languages to generate (en,sv | nordic | eu-core | all | custom comma-separated)'
19+
required: false
20+
default: en,sv
1721

1822
permissions:
1923
contents: read
@@ -46,7 +50,9 @@ steps:
4650
run: |
4751
npm ci --prefer-offline --no-audit
4852
49-
engine: copilot
53+
engine:
54+
id: copilot
55+
model: claude-opus-4-6
5056
---
5157

5258
# 📰 News Article Generator Agent
@@ -62,6 +68,16 @@ Generate news articles based on the latest data from riksdag-regering-mcp server
6268
Check the GitHub event inputs:
6369
- **article_types**: Available from `github.event.inputs.article_types` (default: week-ahead if not provided)
6470
- **force_generation**: Available from `github.event.inputs.force_generation` (default: false if not provided)
71+
- **languages**: Available from `github.event.inputs.languages` (default: en,sv if not provided)
72+
73+
### Language Options
74+
75+
The `languages` input supports:
76+
- **en,sv** (default) - English and Swedish only
77+
- **nordic** - Nordic languages: en,sv,da,no,fi
78+
- **eu-core** - EU core languages: en,sv,de,fr,es,nl
79+
- **all** - All 14 languages: en,sv,da,no,fi,de,fr,es,nl,ar,he,ja,ko,zh
80+
- **custom** - Any comma-separated list (e.g., "en,sv,de,fr")
6581

6682
### Article Types to Generate
6783

@@ -215,9 +231,12 @@ For each article type with significant updates:
215231
- Reference MCP tool calls
216232
- Include data timestamps
217233

218-
5. **Generate both languages**:
219-
- English version (`-en.html`)
220-
- Swedish version (`-sv.html`)
234+
5. **Generate requested languages**:
235+
- Parse the `languages` input
236+
- Expand presets: "nordic" → "en,sv,da,no,fi", "eu-core" → "en,sv,de,fr,es,nl", "all" → all 14
237+
- Generate article for each language with proper title/subtitle
238+
- Use language-specific Schema.org markup
239+
- Include RTL support for Arabic (ar) and Hebrew (he)
221240

222241
### Step 5: Regenerate News Indexes
223242

.github/workflows/news-generation.yml

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ on:
1616
type: string
1717
default: 'week-ahead'
1818
required: false
19+
languages:
20+
description: 'Languages to generate (en,sv | nordic | eu-core | all | custom comma-separated)'
21+
type: string
22+
default: 'en,sv'
23+
required: false
1924

2025
permissions:
2126
contents: write
@@ -99,15 +104,37 @@ jobs:
99104
id: generate
100105
env:
101106
ARTICLE_TYPES: ${{ github.event.inputs.article_types || 'week-ahead' }}
107+
LANGUAGES: ${{ github.event.inputs.languages || 'en,sv' }}
102108
run: |
103109
echo "📰 Generating news articles..."
110+
echo "📋 Article types: $ARTICLE_TYPES"
111+
echo "🌐 Languages: $LANGUAGES"
104112
105113
# Create metadata directory
106114
mkdir -p news/metadata
107115
108-
# Run news generation script
109-
if [ -f "scripts/generate-news.js" ]; then
110-
node scripts/generate-news.js --types="$ARTICLE_TYPES"
116+
# Expand language presets
117+
case "$LANGUAGES" in
118+
"nordic")
119+
LANG_ARG="en,sv,da,no,fi"
120+
echo "🌍 Expanding 'nordic' to: $LANG_ARG"
121+
;;
122+
"eu-core")
123+
LANG_ARG="en,sv,de,fr,es,nl"
124+
echo "🌍 Expanding 'eu-core' to: $LANG_ARG"
125+
;;
126+
"all")
127+
LANG_ARG="en,sv,da,no,fi,de,fr,es,nl,ar,he,ja,ko,zh"
128+
echo "🌍 Expanding 'all' to all 14 languages"
129+
;;
130+
*)
131+
LANG_ARG="$LANGUAGES"
132+
;;
133+
esac
134+
135+
# Run news generation script (use enhanced version with multi-language support)
136+
if [ -f "scripts/generate-news-enhanced.js" ]; then
137+
node scripts/generate-news-enhanced.js --types="$ARTICLE_TYPES" --languages="$LANG_ARG"
111138
112139
# Check results
113140
if [ -f "news/metadata/generation-result.json" ]; then

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,7 @@ cypress/downloads/
4343
# pnpm-lock.yaml
4444
test-libraries.html
4545
news-*-screenshot.png
46+
47+
# News metadata (runtime state, not versioned)
48+
news/metadata/generation-result.json
49+
news/metadata/last-generation.json

0 commit comments

Comments
 (0)