Skip to content

Latest commit

 

History

History
51 lines (35 loc) · 1.19 KB

File metadata and controls

51 lines (35 loc) · 1.19 KB

Generic Project Integration Example

This directory shows how to integrate LocaleSync into any non-Python project that has locale JSON files.

Structure

my-project/
├── locales/            ← or i18n/, translations/, lang/, etc.
│   ├── en.json
│   ├── pl.json
│   └── de.json
├── Makefile            ← optional convenience commands
└── ...

Locale Files

The locales/ directory contains sample locale files with nested keys and placeholders.

Try It

# From the LocaleSync repository root:
locale-sync scan examples/generic-project/locales
locale-sync check examples/generic-project/locales --source en.json
locale-sync sync examples/generic-project/locales --source en.json --dry-run

Makefile Integration

If your project uses a Makefile:

.PHONY: locales-check locales-sync

LOCALE_DIR := locales

locales-check:
	locale-sync check $(LOCALE_DIR) --source en.json

locales-sync:
	locale-sync sync $(LOCALE_DIR) --source en.json

locales-sync-preview:
	locale-sync sync $(LOCALE_DIR) --source en.json --dry-run

CI Integration

See ci-example.yml for a GitHub Actions workflow that can be added to any project.