What is String Extraction?
String extraction is the step that collects translatable strings from source code into whatever the translation workflow consumes: lang files, a POT template, or a TMS. An extractor statically scans the code for translation calls, __() and trans_choice() in Laravel, _() in gettext projects, and records each key with its file and line.
gettext's xgettext is the classic implementation, and every ecosystem has grown equivalents. Extraction keeps code as the source of truth for which keys exist: run it in CI and you can diff the extracted set against your translation files, catching keys used in code but missing from translations, and orphaned translations no code references anymore.
The hard cases are dynamic keys, __('errors.' . $code) defeats static analysis, and strings that should be translatable but are not wrapped in any call at all. The first needs conventions or annotations; the second is the hardcoded-string problem, which needs a scanner that looks for raw literals rather than translation calls.