From b2a2cb7e037065d25b91a7e9f109f2765c293a87 Mon Sep 17 00:00:00 2001 From: Justin McCandless Date: Mon, 15 Jun 2020 09:45:25 -0700 Subject: [PATCH] Add instructions for updating a localized string (#59273) * Add instructions for updating a localized string * gem_missing_localizations does nothing when I test this out, seems to not be required * Explain generation of new locale strings --- .../src/material/material_localizations.dart | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/packages/flutter/lib/src/material/material_localizations.dart b/packages/flutter/lib/src/material/material_localizations.dart index 5f65f50801..12cf8e1a72 100644 --- a/packages/flutter/lib/src/material/material_localizations.dart +++ b/packages/flutter/lib/src/material/material_localizations.dart @@ -49,6 +49,33 @@ import 'typography.dart'; // // 5. If you are a Google employee, you should then also follow the instructions // at go/flutter-l10n. If you're not, don't worry about it. +// +// UPDATING AN EXISTING STRING +// +// If you (someone contributing to the Flutter framework) want to modify an +// existing string in the MaterialLocalizations objects, follow these steps: +// +// 1. Modify the default value of the relevant getter(s) in +// DefaultMaterialLocalizations below. +// +// 2. Update the flutter_localizations package. Modify the out-of-date English +// strings in lib/src/l10n/material_en.arb. +// +// You also need to re-generate lib/src/l10n/localizations.dart by running: +// ``` +// dart dev/tools/localization/bin/gen_localizations.dart --overwrite +// ``` +// +// This script may result in your updated getters being created in newer +// locales and set to the old value of the strings. This is to be expected. +// Leave them as they were generated, and they will be picked up for +// translation. +// +// There is a README file with further information in the lib/src/l10n/ +// directory. +// +// 3. If you are a Google employee, you should then also follow the instructions +// at go/flutter-l10n. If you're not, don't worry about it. /// Defines the localized resource values used by the Material widgets. ///