Skip to content

What happens if the strings in log_levels are localized? #486

@0tkl

Description

@0tkl

Aegisub/src/preferences.cpp

Lines 461 to 466 in 39f6912

#ifdef WITH_FFMS2
auto ffms = p->PageSizer("FFmpegSource");
const wxString log_levels[] = { _("Quiet"), _("Panic"), _("Fatal"), _("Error"), _("Warning"), _("Info"), _("Verbose"), _("Debug") };
wxArrayString log_levels_choice(8, log_levels);
p->OptionChoice(ffms, _("Debug log verbosity"), log_levels_choice, "Provider/FFmpegSource/Log Level");

void FFmpegSourceProvider::SetLogLevel() {
auto LogLevel = OPT_GET("Provider/FFmpegSource/Log Level")->GetString();
boost::to_lower(LogLevel);
if (LogLevel == "panic")
FFMS_SetLogLevel(FFMS_LOG_PANIC);
else if (LogLevel == "fatal")
FFMS_SetLogLevel(FFMS_LOG_FATAL);
else if (LogLevel == "error")
FFMS_SetLogLevel(FFMS_LOG_ERROR);
else if (LogLevel == "warning")
FFMS_SetLogLevel(FFMS_LOG_WARNING);
else if (LogLevel == "info")
FFMS_SetLogLevel(FFMS_LOG_INFO);
else if (LogLevel == "verbose")
FFMS_SetLogLevel(FFMS_LOG_VERBOSE);
else if (LogLevel == "debug")
FFMS_SetLogLevel(FFMS_LOG_DEBUG);
else
FFMS_SetLogLevel(FFMS_LOG_QUIET);
}

Could this result in “no matter which option is set, the final effect is always quiet”?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions