Skip to content

Commit ac790d2

Browse files
ndbroadbentclaude
andcommitted
Fix i18n-iso-countries locale and update CLAUDE.md
- Register English locale for i18n-iso-countries to fix countryToRegionCode - Add explicit rule: never remove comments to reduce file length, refactor instead 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 013f051 commit ac790d2

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ The Python prototype in `src/*.py` serves as the reference implementation:
7575

7676
| Rule | Limit |
7777
|------|-------|
78-
| File length (code) | 500 lines max |
78+
| File length (code) | 500 lines max (NEVER remove comments to reduce - REFACTOR and SPLIT the file) |
7979
| File length (tests) | 1000 lines max |
8080
| Function length | 50 lines max |
8181
| Line length | 100 chars max |

src/place-lookup/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@
66
*/
77

88
import countries from 'i18n-iso-countries'
9+
import en from 'i18n-iso-countries/langs/en.json'
910
import { generatePlaceLookupCacheKey } from '../caching/key'
1011
import type { ResponseCache } from '../caching/types'
12+
1113
import { extractGoogleMapsCoords } from '../extraction/heuristics/url-classifier'
1214
import { guardedFetch, type HttpResponse } from '../http'
15+
1316
import {
1417
type ClassifiedActivity,
1518
formatLocation,
@@ -19,6 +22,9 @@ import {
1922
type Result
2023
} from '../types'
2124

25+
// Register English locale for country name lookups
26+
countries.registerLocale(en)
27+
2228
const PLACES_TEXT_SEARCH_API = 'https://maps.googleapis.com/maps/api/place/textsearch/json'
2329
const GEOCODING_API = 'https://maps.googleapis.com/maps/api/geocode/json'
2430

0 commit comments

Comments
 (0)