Add locale for modules
This commit is contained in:
@@ -13,3 +13,4 @@ target_link_libraries(linux-v4l2
|
||||
)
|
||||
|
||||
install_obs_plugin(linux-v4l2)
|
||||
install_obs_plugin_data(linux-v4l2 ../../build/data/obs-plugins/linux-v4l2)
|
||||
|
@@ -17,6 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#include <obs-module.h>
|
||||
|
||||
OBS_DECLARE_MODULE()
|
||||
OBS_MODULE_USE_DEFAULT_LOCALE("linux-v4l2", "en-US")
|
||||
|
||||
extern struct obs_source_info v4l2_input;
|
||||
|
||||
@@ -26,3 +27,8 @@ bool obs_module_load(uint32_t obs_version)
|
||||
obs_register_source(&v4l2_input);
|
||||
return true;
|
||||
}
|
||||
|
||||
void obs_module_unload(void)
|
||||
{
|
||||
OBS_MODULE_FREE_DEFAULT_LOCALE();
|
||||
}
|
||||
|
@@ -32,7 +32,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#include <util/threading.h>
|
||||
#include <util/bmem.h>
|
||||
#include <util/dstr.h>
|
||||
#include <obs.h>
|
||||
#include <obs-module.h>
|
||||
|
||||
#define V4L2_DATA(voidptr) struct v4l2_data *data = voidptr;
|
||||
|
||||
@@ -268,8 +268,7 @@ exit:
|
||||
|
||||
static const char* v4l2_getname(void)
|
||||
{
|
||||
/* TODO: locale */
|
||||
return "V4L2 Capture Input";
|
||||
return obs_module_text("V4L2Input");
|
||||
}
|
||||
|
||||
static void v4l2_defaults(obs_data_t settings)
|
||||
@@ -465,16 +464,23 @@ static obs_properties_t v4l2_properties(void)
|
||||
{
|
||||
/* TODO: locale */
|
||||
obs_properties_t props = obs_properties_create();
|
||||
obs_property_t device_list = obs_properties_add_list(props, "device_id",
|
||||
"Device", OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_STRING);
|
||||
|
||||
obs_property_t device_list = obs_properties_add_list(props,
|
||||
"device_id", obs_module_text("Device"),
|
||||
OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_STRING);
|
||||
|
||||
obs_property_t format_list = obs_properties_add_list(props,
|
||||
"pixelformat", "Image Format", OBS_COMBO_TYPE_LIST,
|
||||
OBS_COMBO_FORMAT_INT);
|
||||
obs_property_t resolution_list = obs_properties_add_list(props,
|
||||
"resolution", "Resolution", OBS_COMBO_TYPE_LIST,
|
||||
OBS_COMBO_FORMAT_INT);
|
||||
obs_properties_add_list(props, "framerate", "Frame Rate",
|
||||
"pixelformat", obs_module_text("VideoFormat"),
|
||||
OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_INT);
|
||||
|
||||
obs_property_t resolution_list = obs_properties_add_list(props,
|
||||
"resolution", obs_module_text("Resolution"),
|
||||
OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_INT);
|
||||
|
||||
obs_properties_add_list(props,
|
||||
"framerate", obs_module_text("FrameRate"),
|
||||
OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_INT);
|
||||
|
||||
v4l2_device_list(device_list, NULL);
|
||||
obs_property_set_modified_callback(device_list, device_selected);
|
||||
obs_property_set_modified_callback(format_list, format_selected);
|
||||
|
Reference in New Issue
Block a user