mix live_svelte_gettext.fix_references (LiveSvelteGettext v0.2.0)

View Source

Fixes POT/PO file references to point to original Svelte files.

⚠️ Note: As of v0.1.0, LiveSvelteGettext uses CustomExtractor to automatically inject correct Svelte file references during mix gettext.extract. This task is now primarily a fallback/troubleshooting tool for edge cases where automatic extraction doesn't work as expected.

When to Use This Task

You typically don't need this task because:

  • CustomExtractor automatically handles references during extraction
  • POT files will already contain correct Svelte file paths

Use this task only if:

  • You're migrating from an older version with incorrect references
  • You have existing POT files that need reference fixing
  • CustomExtractor isn't working in your specific setup (please report as bug!)
  • You're troubleshooting reference issues

Usage

mix live_svelte_gettext.fix_references

Or run both extraction and fixing in one command:

mix gettext.extract && mix live_svelte_gettext.fix_references

How it works

  1. Finds all modules that use LiveSvelteGettext
  2. Reads the extraction metadata from each module
  3. Builds a mapping of msgid -> original Svelte file:line references
  4. Updates all .pot and .po files, replacing module references with Svelte references

Options

  • --gettext-path - Path to gettext directory (default: "priv/gettext")
  • --dry-run - Show what would be changed without making changes