intl-watcher
Version:
Automated translation key extraction and dictionary management plugin for Next.js
24 lines (21 loc) • 777 B
TypeScript
import { NextConfig } from 'next';
import { CreateIntlWatcherOptions } from './types.js';
import 'type-fest';
/**
* Wraps your Next.js configuration to enable automatic scanning and syncing of i18n keys.
*
* @param options Configuration for file watching and dictionary synchronization.
* @returns A Next.js config enhancer that starts the watcher in development mode.
*
* @example
* const withIntlWatcher = createIntlWatcher({
* dictionaryPaths: ['./i18n/en.json', './i18n/de.json'],
* })
*
* export default withIntlWatcher({
* reactStrictMode: true,
* // other Next.js config options
* })
*/
declare function createIntlWatcher(options: CreateIntlWatcherOptions): (config: NextConfig) => NextConfig;
export { CreateIntlWatcherOptions, createIntlWatcher };