Adds menuBarMenuLabel, and removes unneeded key localizations (#102100)

When I added localizations for shortcut keys, I added some that actually can't be shortcut keys, so I'm removing them again. These are mostly Japanese-specific keys that don't even appear on modern keyboards for the most part.

Also, added menuBarMenuLabel for an accessibility label for menu bar menus.

I modified the code for the localization generation scripts to add a --remove-undefined flag that will remove any localizations that don't appear in the canonical locale.
This commit is contained in:
Greg Spencer
2022-05-09 09:25:52 -07:00
committed by GitHub
parent 84ffdad368
commit 6504f2896c
86 changed files with 527 additions and 4209 deletions

View File

@@ -229,9 +229,19 @@ void checkCwdIsRepoRoot(String commandName) {
GeneratorOptions parseArgs(List<String> rawArgs) {
final argslib.ArgParser argParser = argslib.ArgParser()
..addFlag(
'help',
abbr: 'h',
help: 'Print the usage message for this command',
)
..addFlag(
'overwrite',
abbr: 'w',
help: 'Overwrite existing localizations',
)
..addFlag(
'remove-undefined',
help: 'Remove any localizations that are not defined in the canonical locale.',
)
..addFlag(
'material',
@@ -242,21 +252,33 @@ GeneratorOptions parseArgs(List<String> rawArgs) {
help: 'Whether to print the generated classes for the Cupertino package only. Ignored when --overwrite is passed.',
);
final argslib.ArgResults args = argParser.parse(rawArgs);
if (args.wasParsed('help') && args['help'] == true) {
stderr.writeln(argParser.usage);
exit(0);
}
final bool writeToFile = args['overwrite'] as bool;
final bool removeUndefined = args['remove-undefined'] as bool;
final bool materialOnly = args['material'] as bool;
final bool cupertinoOnly = args['cupertino'] as bool;
return GeneratorOptions(writeToFile: writeToFile, materialOnly: materialOnly, cupertinoOnly: cupertinoOnly);
return GeneratorOptions(
writeToFile: writeToFile,
materialOnly: materialOnly,
cupertinoOnly: cupertinoOnly,
removeUndefined: removeUndefined,
);
}
class GeneratorOptions {
GeneratorOptions({
required this.writeToFile,
required this.removeUndefined,
required this.materialOnly,
required this.cupertinoOnly,
});
final bool writeToFile;
final bool removeUndefined;
final bool materialOnly;
final bool cupertinoOnly;
}