refactor: /command hints add tooltips, test for missing hints, script to generate glue code, hints for dm, create, clearcache, discardsession
This commit is contained in:
parent
adba445c33
commit
3c14cbe017
32 changed files with 863 additions and 770 deletions
30
scripts/generate_command_hints_glue.sh
Executable file
30
scripts/generate_command_hints_glue.sh
Executable file
|
|
@ -0,0 +1,30 @@
|
|||
#!/usr/bin/env bash
|
||||
# Generates some glue code for translation of /command hints.
|
||||
|
||||
# How to use this:
|
||||
# - Add any new hints to assets/l10n/intl_en.arb
|
||||
# They must be of the form commandHint_<command> with <command> in lowercase.
|
||||
# - Run this script to regenerate the glue code
|
||||
# - Run flutter test to see if you did everything right
|
||||
|
||||
# Looking to add descriptions for a new command, but don't know what it does?
|
||||
# It is likely defined here (in registerDefaultCommands()):
|
||||
# https://gitlab.com/famedly/company/frontend/famedlysdk/-/blob/main/lib/src/utils/commands_extension.dart
|
||||
|
||||
echo "\
|
||||
// This file is auto-generated using scripts/generate_command_hints_glue.sh.
|
||||
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
|
||||
String commandHint(L10n l10n, String command) {
|
||||
switch (command) {
|
||||
$(sed -n \
|
||||
's/[[:blank:]]*\"\(commandHint_\([[:lower:]]*\)\)\".*/ case "\2":\
|
||||
return l10n.\1;/p' \
|
||||
assets/l10n/intl_en.arb
|
||||
)
|
||||
default:
|
||||
return \"\";
|
||||
}
|
||||
}\
|
||||
" > lib/pages/chat/command_hints.dart
|
||||
Loading…
Add table
Add a link
Reference in a new issue