Add Phase 5 enhancements: security, i18n, analysis, backup, notifications
- Database v8 migration: tags, pinned, avg_startup_ms columns - Security scanning with CVE matching and batch scan - Bundled library extraction and vulnerability reports - Desktop notification system for security alerts - Backup/restore system for AppImage configurations - i18n framework with gettext support - Runtime analysis and Wayland compatibility detection - AppStream metadata and Flatpak-style build support - File watcher module for live directory monitoring - Preferences panel with GSettings integration - CLI interface for headless operation - Detail view: tabbed layout with ViewSwitcher in title bar, health score, sandbox controls, changelog links - Library view: sort dropdown, context menu enhancements - Dashboard: system status, disk usage, launch history - Security report page with scan and export - Packaging: meson build, PKGBUILD, metainfo
This commit is contained in:
34
src/i18n.rs
Normal file
34
src/i18n.rs
Normal file
@@ -0,0 +1,34 @@
|
||||
/// Mark a string for translation.
|
||||
/// Currently a passthrough; will use gettext when locale support is wired up.
|
||||
pub fn i18n(msgid: &str) -> String {
|
||||
msgid.to_string()
|
||||
}
|
||||
|
||||
/// Translate a string with singular/plural forms.
|
||||
pub fn ni18n(singular: &str, plural: &str, n: u32) -> String {
|
||||
if n == 1 {
|
||||
singular.to_string()
|
||||
} else {
|
||||
plural.to_string()
|
||||
}
|
||||
}
|
||||
|
||||
/// Translate a string and replace named placeholders.
|
||||
pub fn i18n_f(msgid: &str, args: &[(&str, &str)]) -> String {
|
||||
let mut result = msgid.to_string();
|
||||
for (key, value) in args {
|
||||
result = result.replace(key, value);
|
||||
}
|
||||
result
|
||||
}
|
||||
|
||||
/// Translate a string with singular/plural forms and named placeholders.
|
||||
#[allow(dead_code)]
|
||||
pub fn ni18n_f(singular: &str, plural: &str, n: u32, args: &[(&str, &str)]) -> String {
|
||||
let base = if n == 1 { singular } else { plural };
|
||||
let mut result = base.to_string();
|
||||
for (key, value) in args {
|
||||
result = result.replace(key, value);
|
||||
}
|
||||
result
|
||||
}
|
||||
Reference in New Issue
Block a user