Skip to content

Commit

Permalink
loading configuration from ticket.schema
Browse files Browse the repository at this point in the history
Signed-off-by: shewer <[email protected]>
  • Loading branch information
shewer committed Jun 4, 2024
1 parent e6b20c9 commit b41d124
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/rime/gear/script_translator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@ ScriptTranslator::ScriptTranslator(const Ticket& ticket)
: Translator(ticket), Memory(ticket), TranslatorOptions(ticket) {
if (!engine_)
return;
if (Config* config = engine_->schema()->config()) {
if (Config* config = ticket.schema->config()) {
DLOG(INFO) << "loading configuration from schema_id: " << ticket.schema->schema_id();
config->GetInt(name_space_ + "/spelling_hints", &spelling_hints_);
config->GetBool(name_space_ + "/always_show_comments",
&always_show_comments_);
Expand Down
3 changes: 2 additions & 1 deletion src/rime/gear/table_translator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ TableTranslator::TableTranslator(const Ticket& ticket)
: Translator(ticket), Memory(ticket), TranslatorOptions(ticket) {
if (!engine_)
return;
if (Config* config = engine_->schema()->config()) {
if (Config* config = ticket.schema->config()) {
DLOG(INFO) << "loading configuration from schema_id: " << ticket.schema->schema_id();
config->GetBool(name_space_ + "/enable_charset_filter",
&enable_charset_filter_);
config->GetBool(name_space_ + "/enable_sentence", &enable_sentence_);
Expand Down

0 comments on commit b41d124

Please sign in to comment.