From 160ad3b5a916f9f9b00a837ec5d90a345a3d8e7b Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Thu, 24 Jan 2019 20:34:28 +0100 Subject: [PATCH] locale: Replace file filters with file types The filters are always the same for every language and should not be translated, instead only the file type should be translated. This way bad translations will not affect the options that the user can select. --- data/locale/en-US.ini | 12 +++++++++++- source/filter-blur.cpp | 4 ++-- source/strings.hpp | 16 +++++++++++++++- 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/data/locale/en-US.ini b/data/locale/en-US.ini index 2525671d..fb3fda2d 100644 --- a/data/locale/en-US.ini +++ b/data/locale/en-US.ini @@ -1,5 +1,15 @@ # Generic Advanced="Advanced" +FileType.Image="Image" +FileType.Images="Images" +FileType.Video="Video" +FileType.Videos="Videos" +FileType.Sound="Sound" +FileType.Sounds="Sounds" +FileType.Effect="Effect" +FileType.Effects="Effects" + +# Mip Generator MipGenerator="Mipmap Generator" MipGenerator.Description="Which mip generator should be used?" MipGenerator.Point="Point" @@ -9,7 +19,7 @@ MipGenerator.Smoothen="Smoothen" MipGenerator.Bicubic="Bicubic" MipGenerator.Lanczos="Lanczos" MipGenerator.Intensity="Intensity" -FileFilters.Images="Images (*.bmp *.png *.tga *.tiff *.jpg *.jpeg)" +MipGenerator.Intensity.Description="Intensity of the Generator" # Custom Shader CustomShader.Type="Type" diff --git a/source/filter-blur.cpp b/source/filter-blur.cpp index c7a817e3..7bb9da98 100644 --- a/source/filter-blur.cpp +++ b/source/filter-blur.cpp @@ -337,8 +337,8 @@ obs_properties_t* filter::blur::blur_instance::get_properties() p = obs_properties_add_bool(pr, P_MASK_REGION_INVERT, P_TRANSLATE(P_MASK_REGION_INVERT)); obs_property_set_long_description(p, P_TRANSLATE(P_DESC(P_MASK_REGION_INVERT))); /// Image - p = obs_properties_add_path(pr, P_MASK_IMAGE, P_TRANSLATE(P_MASK_IMAGE), OBS_PATH_FILE, - P_TRANSLATE(S_FILEFILTERS_IMAGES), nullptr); + p = obs_properties_add_path(pr, P_MASK_IMAGE, P_TRANSLATE(P_MASK_IMAGE), OBS_PATH_FILE, P_TRANSLATE(""), + nullptr); obs_property_set_long_description(p, P_TRANSLATE(P_DESC(P_MASK_IMAGE))); /// Source p = obs_properties_add_list(pr, P_MASK_SOURCE, P_TRANSLATE(P_MASK_SOURCE), OBS_COMBO_TYPE_LIST, diff --git a/source/strings.hpp b/source/strings.hpp index b6cacc6f..040d6541 100644 --- a/source/strings.hpp +++ b/source/strings.hpp @@ -23,8 +23,22 @@ #define P_TRANSLATE(x) obs_module_text(x) #define P_DESC(x) x ".Description" +#define T_FILEFILTERS_IMAGE "*.png *.webp *.tga *.tiff *.jpeg *.jpg *.bmp" +#define T_FILEFILTERS_VIDEO "*.mkv *.webm *.mp4 *.mov *.flv" +#define T_FILEFILTERS_SOUND "*.ogg *.flac *.mp3 *.wav" +#define T_FILEFILTERS_EFFECT "*.effect *.txt" +#define T_FILEFILTERS_ANY "*.*" + #define S_ADVANCED "Advanced" -#define S_FILEFILTERS_IMAGES "FileFilters.Images" + +#define S_FILETYPE_IMAGE "FileType.Image" +#define S_FILETYPE_IMAGES "FileType.Images" +#define S_FILETYPE_VIDEO "FileType.Video" +#define S_FILETYPE_VIDEOS "FileType.Videos" +#define S_FILETYPE_SOUND "FileType.Sound" +#define S_FILETYPE_SOUNDS "FileType.Sounds" +#define S_FILETYPE_EFFECT "FileType.Effect" +#define S_FILETYPE_EFFECTS "FileType.Effects" #define S_MIPGENERATOR "MipGenerator" #define S_MIPGENERATOR_POINT "MipGenerator.Point"