Skip to content

feat(SOSO-446): auto-detect locale from AppSheet API response data in CLI#20

Merged
wagnert merged 1 commit intodevelopfrom
feature/SOSO-446-cli-locale-detection
Mar 12, 2026
Merged

feat(SOSO-446): auto-detect locale from AppSheet API response data in CLI#20
wagnert merged 1 commit intodevelopfrom
feature/SOSO-446-cli-locale-detection

Conversation

@wagnert
Copy link
Member

@wagnert wagnert commented Mar 12, 2026

Summary

Implements automatic locale detection in CLI inspect and add-table commands (SOSO-446 / #19).

Changes

  • src/types/schema.ts: Added locale?: string to TableInspectionResult
  • src/cli/SchemaInspector.ts:
    • Extended inferType() to recognize locale-formatted dates (DD.MM.YYYY, MM/DD/YYYY, YYYY/MM/DD)
    • New detectLocale() method: analyzes separator + part order from Date/DateTime/ChangeTimestamp values
    • Locale mapping: DMY+.→de-DE, DMY+/→en-GB, MDY+/→en-US, YMD+/→ja-JP
    • Ambiguous defaults: /→en-US, .→de-DE (with warning)
    • inspectTable() now returns detected locale in result
    • generateSchema() sets locale on both connection and table level
    • New mostFrequent() helper for connection-level locale
  • src/cli/commands.ts: inspect and add-table propagate locale, output hints updated

Tests

  • 47 new tests in tests/cli/SchemaInspector.locale.test.ts
  • All 464 tests pass, 0 lint errors, build clean

Concept

See docs/SOSO-446/FEATURE_CONCEPT.md for full design document.

Closes #19

… CLI

- Add locale field to TableInspectionResult interface
- Extend inferType() to recognize locale-formatted dates (DD.MM.YYYY, MM/DD/YYYY, etc.)
- Implement detectLocale() algorithm: separator + part order analysis
  - de-DE: DMY with dot (25.03.2026)
  - en-US: MDY with slash (03/25/2026)
  - en-GB: DMY with slash (25/03/2026)
  - ja-JP: YMD with slash (2026/03/12)
  - Ambiguous defaults: slash→en-US, dot→de-DE
- Integrate locale detection in inspectTable() and generateSchema()
- Set locale on both connection and table level in generated schema
- Update add-table command to propagate detected locale
- Add locale hints to CLI output
- 47 new tests covering all detection scenarios

Closes #19
@wagnert wagnert merged commit 5ca002d into develop Mar 12, 2026
4 checks passed
@wagnert wagnert deleted the feature/SOSO-446-cli-locale-detection branch March 12, 2026 16:30
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.

1 participant