From 3456dfb10fca5f1b85a4dba52de549379b6aefaf Mon Sep 17 00:00:00 2001 From: Kaito Udagawa Date: Mon, 13 Mar 2023 11:54:56 +0900 Subject: [PATCH 1/2] Create en-US.ini --- data/locale/en-US.ini | 21 +++++++++++++++++++++ src/background-filter.cpp | 18 +++++++++--------- src/plugin-main.cpp | 2 +- 3 files changed, 31 insertions(+), 10 deletions(-) diff --git a/data/locale/en-US.ini b/data/locale/en-US.ini index e69de29b..f02efb44 100644 --- a/data/locale/en-US.ini +++ b/data/locale/en-US.ini @@ -0,0 +1,21 @@ +BackgroundRemoval=Background Removal +PortraitBackgroundFilterPlugin=Portrait background filter plugin +Threshold=Threshold +ContourFilterPercentOfImage=Contour Filter (% of image) +SmoothSilhouette=Smooth silhouette +FeatherBlendSilhouette=Feather blend silhouette +BackgroundColor=Background Color +InferenceDevice=Inference device +CPU=CPU +GPUCUDA=GPU - CUDA +GPUDirectML=GPU - DirectML +CoreML=CoreML +SegmentationModel=Segmentation model +SINet=SINet +MODNet=MODNet +MediaPipe=MediaPipe +SelfieSegmentation=Selfie Segmentation +PPHumanSeg=PPHumanSeg +RobustVideoMatting=Robust Video Matting +CalculateMaskEveryXFrame=Calculate mask every X frame +BlurBackgroundDactor0NoBlurUseColor=Blur background factor (0 - no blur, use color) \ No newline at end of file diff --git a/src/background-filter.cpp b/src/background-filter.cpp index 1c18b4f4..80884658 100644 --- a/src/background-filter.cpp +++ b/src/background-filter.cpp @@ -90,7 +90,7 @@ struct background_removal_filter { static const char *filter_getname(void *unused) { UNUSED_PARAMETER(unused); - return "Background Removal"; + return obs_module_text("BackgroundRemoval"); } /** PROPERTIES */ @@ -103,33 +103,33 @@ static obs_properties_t *filter_properties(void *data) 0.025); obs_properties_add_float_slider(props, "contour_filter", - obs_module_text("Contour Filter (% of image)"), 0.0, 1.0, 0.025); + obs_module_text("ContourFilterPercentOfImage"), 0.0, 1.0, 0.025); - obs_properties_add_float_slider(props, "smooth_contour", obs_module_text("Smooth silhouette"), + obs_properties_add_float_slider(props, "smooth_contour", obs_module_text("SmoothSilhouette"), 0.0, 1.0, 0.05); - obs_properties_add_float_slider(props, "feather", obs_module_text("Feather blend silhouette"), + obs_properties_add_float_slider(props, "feather", obs_module_text("FeatherBlendSilhouette"), 0.0, 1.0, 0.05); - obs_properties_add_color(props, "replaceColor", obs_module_text("Background Color")); + obs_properties_add_color(props, "replaceColor", obs_module_text("BackgroundColor")); obs_property_t *p_use_gpu = obs_properties_add_list(props, "useGPU", - obs_module_text("Inference device"), + obs_module_text("InferenceDevice"), OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_STRING); obs_property_list_add_string(p_use_gpu, obs_module_text("CPU"), USEGPU_CPU); #ifdef WITH_CUDA - obs_property_list_add_string(p_use_gpu, obs_module_text("GPU - CUDA"), USEGPU_CUDA); + obs_property_list_add_string(p_use_gpu, obs_module_text("GPUCUDA"), USEGPU_CUDA); #endif #if _WIN32 - obs_property_list_add_string(p_use_gpu, obs_module_text("GPU - DirectML"), USEGPU_DML); + obs_property_list_add_string(p_use_gpu, obs_module_text("GPUDirectML"), USEGPU_DML); #endif #if defined(__APPLE__) obs_property_list_add_string(p_use_gpu, obs_module_text("CoreML"), USEGPU_COREML); #endif obs_property_t *p_model_select = - obs_properties_add_list(props, "model_select", obs_module_text("Segmentation model"), + obs_properties_add_list(props, "model_select", obs_module_text("SegmentationModel"), OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_STRING); obs_property_list_add_string(p_model_select, obs_module_text("SINet"), MODEL_SINET); diff --git a/src/plugin-main.cpp b/src/plugin-main.cpp index 47333b8d..61c48bf8 100644 --- a/src/plugin-main.cpp +++ b/src/plugin-main.cpp @@ -25,7 +25,7 @@ OBS_MODULE_USE_DEFAULT_LOCALE(PLUGIN_NAME, "en-US") MODULE_EXPORT const char *obs_module_description(void) { - return "Portrait background filter plugin"; + return obs_module_text("PortraitBackgroundFilterPlugin"); } extern struct obs_source_info background_removal_filter_info; From 1e9c767eba7da3e97eb07c3886a06c87a515aa01 Mon Sep 17 00:00:00 2001 From: Kaito Udagawa Date: Mon, 13 Mar 2023 11:58:23 +0900 Subject: [PATCH 2/2] Format --- src/background-filter.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/background-filter.cpp b/src/background-filter.cpp index 80884658..ad09f246 100644 --- a/src/background-filter.cpp +++ b/src/background-filter.cpp @@ -105,11 +105,11 @@ static obs_properties_t *filter_properties(void *data) obs_properties_add_float_slider(props, "contour_filter", obs_module_text("ContourFilterPercentOfImage"), 0.0, 1.0, 0.025); - obs_properties_add_float_slider(props, "smooth_contour", obs_module_text("SmoothSilhouette"), - 0.0, 1.0, 0.05); + obs_properties_add_float_slider(props, "smooth_contour", obs_module_text("SmoothSilhouette"), 0.0, + 1.0, 0.05); - obs_properties_add_float_slider(props, "feather", obs_module_text("FeatherBlendSilhouette"), - 0.0, 1.0, 0.05); + obs_properties_add_float_slider(props, "feather", obs_module_text("FeatherBlendSilhouette"), 0.0, + 1.0, 0.05); obs_properties_add_color(props, "replaceColor", obs_module_text("BackgroundColor"));