tauri-plugin-sys-locale 0.1.2

Tauri plugin to read the operating system's current locale/language
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::{api, LocaleInfo, Result};
use tauri::command;

/// Thin Tauri-command wrapper around `api::get_locale`, so it can be
/// called from the frontend via `invoke('plugin:sys-locale|get_locale')`.
#[command]
pub fn get_locale() -> Result<String> {
    api::get_locale()
}

/// Thin Tauri-command wrapper around `api::get_locale_info`.
#[command]
pub fn get_locale_info() -> Result<LocaleInfo> {
    api::get_locale_info()
}