When it comes to generating localization files in Flutter, the root of the problem depends on the approach used for localization. There are two main generators used for localization in Flutter: gen_l10n and Flutter Intl.
The most common reason why gen_l10n doesn't generate the needed localization files is that it is not properly configured. One of the common mistakes that people make is putting the l10n.yaml file in the wrong directory, like the lib folder instead of the project root. Another one is a missing generate: true line in the flutter section of the pubspec.yaml file, which is required for the generation to run. Moreover, since Flutter 3.32 gen_l10n no longer generates the localization files as a synthetic package (package:flutter_gen) but writes them into your source tree, by default into the arb-dir folder (lib/l10n) or into the folder set by output-dir in l10n.yaml. If you don't see the localization files in the project, check these folders (on older Flutter versions they were in the .dart_tool/flutter_gen/gen_l10n folder). Also, you can always manually invoke generation by running the flutter gen-l10n command and check if there are any errors in the console.
For Flutter Intl, the main reason why it may not generate localization code is after upgrading Flutter, there might be a problem with the cache. However, reactivating the globally activated intl_utils package can solve this problem.
Published Mar 29, 2023 · Last reviewed Oct 9, 2026 · Markdown version