feat(localization): add localization generation step and update l10n configuration
This commit is contained in:
@@ -8,6 +8,9 @@ RUN flutter pub get
|
|||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
|
# Generate localizations (ARB -> Dart) before the main build.
|
||||||
|
RUN flutter gen-l10n
|
||||||
|
|
||||||
# Inject API base URL at build time via --dart-define.
|
# Inject API base URL at build time via --dart-define.
|
||||||
# Default to same-origin /api to avoid mixed-content in HTTPS deployments.
|
# Default to same-origin /api to avoid mixed-content in HTTPS deployments.
|
||||||
ARG API_BASE_URL=/api
|
ARG API_BASE_URL=/api
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
arb-dir: lib/l10n
|
arb-dir: lib/l10n
|
||||||
template-arb-file: app_en.arb
|
template-arb-file: app_en.arb
|
||||||
output-localization-file: app_localizations.dart
|
output-localization-file: app_localizations.dart
|
||||||
|
output-dir: lib/l10n/generated
|
||||||
|
synthetic-package: false
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
import 'package:recipe_flutter/l10n/generated/app_localizations.dart';
|
||||||
|
|
||||||
|
export 'package:recipe_flutter/l10n/generated/app_localizations.dart';
|
||||||
|
|
||||||
extension AppLocalizationsX on BuildContext {
|
extension AppLocalizationsX on BuildContext {
|
||||||
AppLocalizations get l10n => AppLocalizations.of(this)!;
|
AppLocalizations get l10n => AppLocalizations.of(this)!;
|
||||||
|
|||||||
Reference in New Issue
Block a user