Added KLocalizedString Wrapper.
Only added applicationDomain related methods.
This commit is contained in:
parent
5cf6a34302
commit
cb934ff6dc
4 changed files with 53 additions and 2 deletions
|
|
@ -1,4 +1,4 @@
|
|||
use ki18n_rs::KLocalizedContext;
|
||||
use ki18n_rs::klocalizedcontext::KLocalizedContext;
|
||||
use qmetaobject::prelude::*;
|
||||
mod common;
|
||||
|
||||
|
|
|
|||
14
tests/klocalizedstring_tests.rs
Normal file
14
tests/klocalizedstring_tests.rs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
use ki18n_rs::klocalizedstring::KLocalizedString;
|
||||
use std::ffi::CString;
|
||||
|
||||
#[test]
|
||||
fn application_domain() {
|
||||
const APPLICATION_DOMAIN: &str = "KI18n";
|
||||
let domain = CString::new(APPLICATION_DOMAIN).unwrap();
|
||||
|
||||
KLocalizedString::set_application_domain(&domain);
|
||||
let domain = KLocalizedString::application_domain();
|
||||
println!("{:#?}", domain);
|
||||
|
||||
assert_eq!(domain.to_str().unwrap(), "KI18n");
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue