Skip to content

Commit 6463cca

Browse files
CopilotDawoudIOgithub-code-quality[bot]
authored
Remove locale:missing; standardise on locale:download:missing (#8204)
The local-diff approach (`locale-build-missing.js` / `locale:missing`) was redundant — POEditor's own `filters=untranslated` export API already computes missing terms server-side with no prior full download required. This removes the old script and wires everything to `locale:download:missing`. ## Changes - **Deleted** `locale/scripts/locale-build-missing.js` - **`package.json`** — removed `locale:missing` script - **`locale/scripts/locale-translate.js`** — updated fallback hint to `locale:download:missing` - **`locale/scripts/poeditor-missing-downloader.js`** — cleaned up JSDoc (dropped cross-references to deleted file) - **`locale/README.md`** — collapsed two-option workflow to single canonical approach; removed `locale:missing` from scripts table and quick-reference block - **`.github/workflows/locale-poeditor-download.yml`** — replaced `npm run locale:missing` step with `npm run locale:download:missing`; updated commit step paths from `locale/missing-terms/poeditor-*.json` → `locale/terms/missing/` - **`.agents/skills/churchcrm/locale-ai-translation.md`** and **`.claude/commands/locale-release.md`** — Quick Start and scripts table updated to `locale:download:missing` <!-- START COPILOT CODING AGENT TIPS --> --- 💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: DawoudIO <554959+DawoudIO@users.noreply.github.com> Co-authored-by: George Dawoud <george@dawouds.com> Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
1 parent ce4431e commit 6463cca

File tree

8 files changed

+413
-282
lines changed

8 files changed

+413
-282
lines changed

.agents/skills/churchcrm/locale-ai-translation.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ No API key or external service is required — translations run directly inside
1818

1919
Every new UI string added to ChurchCRM creates a translation gap in 45+ languages. The AI translation system bridges that gap at release time by:
2020

21-
1. Reading empty batch files from `locale/terms/missing/{locale}/*.json` (generated by `npm run locale:missing`)
21+
1. Reading empty batch files from `locale/terms/missing/{locale}/*.json` (generated by `npm run locale:download:missing`)
2222
2. Translating missing values with Claude Code, applying denomination-aware church vocabulary
2323
3. Writing translated values back into the same batch files
2424
4. User uploads those files to POEditor (source of truth), then pulls down via `npm run locale:download`
@@ -33,8 +33,8 @@ Every new UI string added to ChurchCRM creates a translation gap in 45+ language
3333
## Quick Start
3434

3535
```bash
36-
# 1. Regenerate missing terms list
37-
npm run locale:missing
36+
# 1. Download untranslated terms from POEditor
37+
npm run locale:download:missing
3838

3939
# 2. Preview what needs translation
4040
npm run locale:translate:list
@@ -67,7 +67,7 @@ npm run locale:download
6767

6868
| Script | What it does |
6969
|--------|-------------|
70-
| `npm run locale:missing` | Regenerate missing-terms batch files |
70+
| `npm run locale:download:missing` | Download untranslated terms per locale from POEditor |
7171
| `npm run locale:translate:list` | List locales with untranslated terms |
7272
| `npm run locale:audit` | Show translation coverage report |
7373
| `npm run locale:download` | Pull approved translations from POEditor |

.claude/commands/locale-release.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ Run the full localization pipeline before a release: regenerate missing terms, t
44

55
## Steps
66

7-
### Step 1 — Regenerate missing terms
7+
### Step 1 — Download missing terms from POEditor
88

99
```bash
10-
npm run locale:missing
10+
npm run locale:download:missing
1111
```
1212

13-
This compares `locale/messages.json` against all installed `src/locale/i18n/*.json` files and writes fresh empty batch files to `locale/terms/missing/{locale}/`.
13+
This queries POEditor with `filters=untranslated` for each locale and writes fresh empty batch files to `locale/terms/missing/{locale}/`.
1414

1515
### Step 2 — Preview what needs translation
1616

.github/workflows/locale-poeditor-download.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -224,22 +224,22 @@ jobs:
224224
git config user.name "github-actions[bot]"
225225
git config user.email "github-actions[bot]@users.noreply.github.com"
226226
227-
- name: Generate missing terms for all locales
227+
- name: Download missing terms for all locales from POEditor
228228
if: inputs.operation_mode != 'audit-only'
229229
run: |
230-
echo "📋 Generating missing translation terms for all locales..."
231-
npm run locale:missing
232-
echo "✅ Missing terms files generated"
230+
echo "📋 Downloading missing translation terms for all locales from POEditor..."
231+
npm run locale:download:missing
232+
echo "✅ Missing terms files downloaded"
233233
234234
- name: Commit missing terms for POEditor
235235
if: inputs.operation_mode != 'audit-only'
236236
run: |
237-
if [ -d "locale/missing-terms" ] && [ -n "$(find locale/missing-terms -name 'poeditor-*.json' -type f 2>/dev/null)" ]; then
237+
if [ -d "locale/terms/missing" ] && [ -n "$(find locale/terms/missing -name '*.json' -type f 2>/dev/null)" ]; then
238238
echo "📝 Committing missing terms files..."
239-
git add locale/missing-terms/poeditor-*.json
239+
git add locale/terms/missing/
240240
# Check if there are staged changes to commit
241241
if ! git diff --cached --quiet; then
242-
git commit -m "📊 Missing translation terms: Updated for all locales from master list"
242+
git commit -m "locale: update missing translation terms from POEditor"
243243
echo "✅ Missing terms files committed"
244244
else
245245
echo "ℹ️ No new missing terms to commit"
@@ -278,11 +278,11 @@ jobs:
278278
**What's included:**
279279
- Updated translation files from POEditor
280280
- Generated locale JSON files
281-
- 📊 Missing terms for all locales (in `locale/missing-terms/poeditor-*.json`)
281+
- 📊 Missing terms for all locales (in `locale/terms/missing/`)
282282
- Locale audit results
283283
284284
**Missing Terms Reports:**
285-
For each incomplete locale, a `poeditor-{locale}.json` file contains all missing/untranslated terms from the master English list. These can be imported into POEditor to help translators complete the translations.
285+
For each incomplete locale, batch files under `locale/terms/missing/{locale}/` contain all untranslated terms downloaded directly from POEditor. These can be used with `/locale-translate` or uploaded directly to POEditor.
286286
287287
This PR was automatically created by the POEditor workflow.
288288

locale/README.md

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ locale/
2424
### Locale Management
2525
- `npm run locale:audit` - Generate locale completeness report
2626
- `npm run locale:download` - Download latest translations from POEditor
27+
- `npm run locale:download:missing` - Download **only untranslated (missing) terms** per locale from POEditor
2728
- `npm run locale:term-extract` - Extract all translatable terms for POEditor upload
2829

2930
### Manual Scripts (require parameters)
@@ -63,33 +64,27 @@ ChurchCRM uses [POEditor](https://poeditor.com) as the primary translation manag
6364

6465
### Missing Terms Workflow
6566

66-
For identifying and prioritizing untranslated terms:
67+
Uses POEditor's `filters=untranslated` export filter to download only the missing terms
68+
directly from the API — no prior `locale:download` needed.
6769

68-
1. **Generate Missing Terms**: `npm run locale:missing`
69-
- Compares POEditor terms against each locale's translated terms
70-
- Creates JSON files in `locale/terms/missing/{locale}/`
71-
- Files are batched (default 150 terms per file) for easy POEditor import
72-
73-
2. **Upload to POEditor**:
74-
- Go to POEditor → Your Project → Import
75-
- Select language and upload the JSON files from `locale/terms/missing/{locale}/`
76-
- POEditor will highlight these as needing translation
70+
```bash
71+
npm run locale:download:missing # All locales
72+
npm run locale:download:missing -- --locale fr # French only
73+
```
7774

78-
3. **Translation Priority**:
79-
- Files are named `{locale}-1.json`, `{locale}-2.json`, etc.
80-
- Lower numbers = higher priority (most common terms)
81-
- Translators should complete batch 1 before moving to batch 2
75+
Output: `locale/terms/missing/{poEditorCode}/{code}-N.json`
8276

83-
4. **Download Updates**: After translators complete work, run `npm run locale:download`
77+
Batch files contain at most 150 terms each. Locales with fewer than 10 missing terms are
78+
skipped automatically. Files are ready for `/locale-translate` or direct upload to POEditor.
8479

8580
### Quick Reference Commands
8681

8782
```bash
8883
# Full translation workflow
89-
npm run locale:build # Extract all terms from source code
90-
npm run locale:download # Download translations from POEditor
91-
npm run locale:audit # Generate completeness report
92-
npm run locale:missing # Generate missing term files for each locale
84+
npm run locale:build # Extract all terms from source code
85+
npm run locale:download # Download translations from POEditor
86+
npm run locale:audit # Generate completeness report
87+
npm run locale:download:missing # Fetch untranslated terms from POEditor
9388
```
9489

9590
## 📝 Gettext System

locale/scripts/locale-build-missing.js

Lines changed: 0 additions & 245 deletions
This file was deleted.

locale/scripts/locale-translate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ function countUntranslated(terms) {
8686
function cmdList(localeMap) {
8787
const missingDir = config.terms.missing;
8888
if (!fs.existsSync(missingDir)) {
89-
console.log('No missing terms directory found. Run: npm run locale:missing');
89+
console.log('No missing terms directory found. Run: npm run locale:download:missing');
9090
return;
9191
}
9292

0 commit comments

Comments
 (0)