Generate translated desktop and metainfo files with xdgen
This commit is contained in:
parent
7c59e94308
commit
51454564cc
19 changed files with 98 additions and 53 deletions
38
Cargo.lock
generated
38
Cargo.lock
generated
|
|
@ -1596,6 +1596,7 @@ dependencies = [
|
||||||
"thiserror 2.0.18",
|
"thiserror 2.0.18",
|
||||||
"tokio",
|
"tokio",
|
||||||
"url",
|
"url",
|
||||||
|
"xdgen",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
@ -2520,6 +2521,16 @@ dependencies = [
|
||||||
"xdg",
|
"xdg",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "freedesktop_entry_parser"
|
||||||
|
version = "2.0.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "fc6d3a3635983a889f065aa9ce760384713f23a9b4a04f696f86c39a5d7a6a5a"
|
||||||
|
dependencies = [
|
||||||
|
"indexmap 2.13.0",
|
||||||
|
"nom 8.0.0",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "fsevent-sys"
|
name = "fsevent-sys"
|
||||||
version = "4.1.0"
|
version = "4.1.0"
|
||||||
|
|
@ -8634,6 +8645,18 @@ dependencies = [
|
||||||
"unicase",
|
"unicase",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "xdgen"
|
||||||
|
version = "0.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "25af88f104f06d5aeb80c77e5eb85e6f6f355f86f6e34307a14befd716efe4bf"
|
||||||
|
dependencies = [
|
||||||
|
"fluent",
|
||||||
|
"freedesktop_entry_parser",
|
||||||
|
"unic-langid",
|
||||||
|
"xmltree",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "xkbcommon"
|
name = "xkbcommon"
|
||||||
version = "0.7.0"
|
version = "0.7.0"
|
||||||
|
|
@ -8689,12 +8712,27 @@ dependencies = [
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "xml"
|
||||||
|
version = "1.2.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b8aa498d22c9bbaf482329839bc5620c46be275a19a812e9a22a2b07529a642a"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "xml-rs"
|
name = "xml-rs"
|
||||||
version = "0.8.28"
|
version = "0.8.28"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3ae8337f8a065cfc972643663ea4279e04e7256de865aa66fe25cec5fb912d3f"
|
checksum = "3ae8337f8a065cfc972643663ea4279e04e7256de865aa66fe25cec5fb912d3f"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "xmltree"
|
||||||
|
version = "0.12.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "cbc04313cab124e498ab1724e739720807b6dc405b9ed0edc5860164d2e4ff70"
|
||||||
|
dependencies = [
|
||||||
|
"xml",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "xmlwriter"
|
name = "xmlwriter"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,9 @@ features = ["about", "multi-window", "tokio", "winit", "surface-message"]
|
||||||
[target.'cfg(unix)'.dependencies]
|
[target.'cfg(unix)'.dependencies]
|
||||||
fork = "0.4"
|
fork = "0.4"
|
||||||
|
|
||||||
|
[build-dependencies]
|
||||||
|
xdgen = "0.1"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["dbus-config", "wgpu", "wayland", "password_manager"]
|
default = ["dbus-config", "wgpu", "wayland", "password_manager"]
|
||||||
dbus-config = ["libcosmic/dbus-config"]
|
dbus-config = ["libcosmic/dbus-config"]
|
||||||
|
|
|
||||||
24
build.rs
Normal file
24
build.rs
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
use std::{env, fs, path::PathBuf};
|
||||||
|
use xdgen::{App, Context, FluentString};
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
let id = "com.system76.CosmicTerm";
|
||||||
|
let ctx = Context::new("i18n", env::var("CARGO_PKG_NAME").unwrap()).unwrap();
|
||||||
|
let app = App::new(FluentString("cosmic-terminal"))
|
||||||
|
.comment(FluentString("comment"))
|
||||||
|
.keywords(FluentString("keywords"));
|
||||||
|
let output = PathBuf::from("target/xdgen");
|
||||||
|
fs::create_dir_all(&output).unwrap();
|
||||||
|
fs::write(
|
||||||
|
output.join(format!("{}.desktop", id)),
|
||||||
|
app.expand_desktop(format!("res/{}.desktop", id), &ctx)
|
||||||
|
.unwrap(),
|
||||||
|
)
|
||||||
|
.unwrap();
|
||||||
|
fs::write(
|
||||||
|
output.join(format!("{}.metainfo.xml", id)),
|
||||||
|
app.expand_metainfo(format!("res/{}.metainfo.xml", id), &ctx)
|
||||||
|
.unwrap(),
|
||||||
|
)
|
||||||
|
.unwrap();
|
||||||
|
}
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
cosmic-terminal = طرفية COSMIC
|
cosmic-terminal = طرفية COSMIC
|
||||||
|
comment = محاكي طرفي لسطح مكتب COSMIC
|
||||||
|
keywords = cli;طرفية;أوامر;صدفة;
|
||||||
new-terminal = طرفية جديدة
|
new-terminal = طرفية جديدة
|
||||||
|
|
||||||
# Context Pages
|
# Context Pages
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
comment = Emulátor terminálu pro pracovní prostředí COSMIC
|
||||||
|
keywords = Příkaz;Shell;Terminál;Konzole;CLI;
|
||||||
settings = Nastavení
|
settings = Nastavení
|
||||||
appearance = Vzhled
|
appearance = Vzhled
|
||||||
theme = Motiv
|
theme = Motiv
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
cosmic-terminal = COSMIC Terminal
|
cosmic-terminal = COSMIC Terminal
|
||||||
|
comment = Terminal emulator for the COSMIC desktop
|
||||||
|
keywords = Command;Shell;Terminal;CLI;
|
||||||
new-terminal = New terminal
|
new-terminal = New terminal
|
||||||
|
|
||||||
# Context Pages
|
# Context Pages
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
cosmic-terminal = Terminal COSMIC
|
cosmic-terminal = Terminal COSMIC
|
||||||
|
comment = Emulador de terminal de escritorio COSMIC
|
||||||
|
keywords = Comando;Shell;Terminal;Consola;
|
||||||
new-terminal = Nuevo terminal
|
new-terminal = Nuevo terminal
|
||||||
|
|
||||||
# Context Pages
|
# Context Pages
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
cosmic-terminal = COSMIC Terminál
|
cosmic-terminal = COSMIC Terminál
|
||||||
|
comment = Terminálemulátor a COSMIC asztali környezethez
|
||||||
|
keywords = parancssor;terminál;
|
||||||
new-terminal = Új terminál
|
new-terminal = Új terminál
|
||||||
|
|
||||||
# Context Pages
|
# Context Pages
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
cosmic-terminal = Terminale COSMIC
|
cosmic-terminal = Terminale COSMIC
|
||||||
|
comment = Emulatore di terminale di COSMIC
|
||||||
|
keywords = Comando;Shell;Terminale;Console;
|
||||||
new-terminal = Nuovo terminale
|
new-terminal = Nuovo terminale
|
||||||
|
|
||||||
# Context Pages
|
# Context Pages
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
cosmic-terminal = Terminal COSMIC
|
cosmic-terminal = Terminal COSMIC
|
||||||
|
comment = Emulator terminala dla pulpitu COSMIC
|
||||||
|
keywords = Cli;WierszPoleceń;Powłoka;Terminal;
|
||||||
new-terminal = Nowy terminal
|
new-terminal = Nowy terminal
|
||||||
|
|
||||||
# Context Pages
|
# Context Pages
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
cosmic-terminal = Terminal COSMIC
|
cosmic-terminal = Terminal COSMIC
|
||||||
|
comment = Emulador de terminal do desktop COSMIC
|
||||||
|
keywords = Comando;Shell;Terminal;
|
||||||
new-terminal = Novo terminal
|
new-terminal = Novo terminal
|
||||||
|
|
||||||
# Context Pages
|
# Context Pages
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
cosmic-terminal = Terminal COSMIC
|
cosmic-terminal = Terminal COSMIC
|
||||||
|
comment = Emulador de terminal do desktop COSMIC
|
||||||
|
keywords = Comando;Shell;Terminal;Console;
|
||||||
new-terminal = Novo terminal
|
new-terminal = Novo terminal
|
||||||
|
|
||||||
# Context Pages
|
# Context Pages
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
cosmic-terminal = Терминал COSMIC
|
cosmic-terminal = Терминал COSMIC
|
||||||
|
comment = Эмулятор терминала для рабочей среды COSMIC
|
||||||
|
keywords = Команда;Оболочка;Терминал;Консоль;
|
||||||
new-terminal = Новый терминал
|
new-terminal = Новый терминал
|
||||||
|
|
||||||
# Context Pages
|
# Context Pages
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
cosmic-terminal = Terminál COSMIC
|
cosmic-terminal = Terminál COSMIC
|
||||||
|
comment = Emulátor terminálu pre pracovné prostredie COSMIC
|
||||||
|
keywords = Príkaz;Shell;Terminál;Konzola;
|
||||||
new-terminal = Nový terminál
|
new-terminal = Nový terminál
|
||||||
|
|
||||||
# Kontextové stránky
|
# Kontextové stránky
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
cosmic-terminal = COSMIC Terminal
|
cosmic-terminal = COSMIC Terminal
|
||||||
|
comment = Terminalemulator för skribordsmiljön COSMIC
|
||||||
|
keywords = Kommando;Skal;Terminal;CLI;Konsol;
|
||||||
new-terminal = Ny terminal
|
new-terminal = Ny terminal
|
||||||
|
|
||||||
# Context Pages
|
# Context Pages
|
||||||
|
|
|
||||||
4
justfile
4
justfile
|
|
@ -13,11 +13,11 @@ bin-src := cargo-target-dir / 'release' / name
|
||||||
bin-dst := base-dir / 'bin' / name
|
bin-dst := base-dir / 'bin' / name
|
||||||
|
|
||||||
desktop := APPID + '.desktop'
|
desktop := APPID + '.desktop'
|
||||||
desktop-src := 'res' / desktop
|
desktop-src := 'target/xdgen' / desktop
|
||||||
desktop-dst := clean(rootdir / prefix) / 'share' / 'applications' / desktop
|
desktop-dst := clean(rootdir / prefix) / 'share' / 'applications' / desktop
|
||||||
|
|
||||||
metainfo := APPID + '.metainfo.xml'
|
metainfo := APPID + '.metainfo.xml'
|
||||||
metainfo-src := 'res' / metainfo
|
metainfo-src := 'target/xdgen' / metainfo
|
||||||
metainfo-dst := clean(rootdir / prefix) / 'share' / 'metainfo' / metainfo
|
metainfo-dst := clean(rootdir / prefix) / 'share' / 'metainfo' / metainfo
|
||||||
|
|
||||||
icons-src := 'res' / 'icons' / 'hicolor'
|
icons-src := 'res' / 'icons' / 'hicolor'
|
||||||
|
|
|
||||||
|
|
@ -1,26 +1,6 @@
|
||||||
#TODO: more build-out, desktop actions, translations?
|
|
||||||
[Desktop Entry]
|
[Desktop Entry]
|
||||||
Name=COSMIC Terminal
|
Name=COSMIC Terminal
|
||||||
Name[ar]=طرفية COSMIC
|
|
||||||
Name[cs]=Terminál COSMIC
|
|
||||||
Name[zh_CN]=COSMIC 终端
|
|
||||||
Name[pl]=Terminal COSMIC
|
|
||||||
Name[pt_BR]=Terminal
|
|
||||||
Name[ru]=Терминал
|
|
||||||
Name[hu]=COSMIC Terminál
|
|
||||||
Name[pt]=Terminal
|
|
||||||
Name[sk]=Terminál COSMIC
|
|
||||||
Name[es]=Terminal COSMIC
|
|
||||||
Name[it]=Terminale di COSMIC
|
|
||||||
Name[sv]=COSMIC Terminal
|
|
||||||
Comment=Terminal emulator for the COSMIC desktop
|
Comment=Terminal emulator for the COSMIC desktop
|
||||||
Comment[ar]=محاكي طرفي لسطح مكتب COSMIC
|
|
||||||
Comment[cs]=Emulátor terminálu pro pracovní prostředí COSMIC
|
|
||||||
Comment[sk]=Emulátor terminálu pre pracovné prostredie COSMIC
|
|
||||||
Comment[ru]=Эмулятор терминала для рабочей среды COSMIC
|
|
||||||
Comment[hu]=Terminálemulátor a COSMIC asztali környezethez
|
|
||||||
Comment[it]=Emulatore di terminale di COSMIC
|
|
||||||
Comment[sv]=Terminalemulator för skribordsmiljön COSMIC
|
|
||||||
Exec=cosmic-term
|
Exec=cosmic-term
|
||||||
Terminal=false
|
Terminal=false
|
||||||
Type=Application
|
Type=Application
|
||||||
|
|
@ -28,14 +8,3 @@ StartupNotify=true
|
||||||
Icon=com.system76.CosmicTerm
|
Icon=com.system76.CosmicTerm
|
||||||
Categories=COSMIC;System;TerminalEmulator;
|
Categories=COSMIC;System;TerminalEmulator;
|
||||||
Keywords=Command;Shell;Terminal;CLI;
|
Keywords=Command;Shell;Terminal;CLI;
|
||||||
Keywords[ar]=cli;طرفية;أوامر;صدفة;
|
|
||||||
Keywords[cs]=Příkaz;Shell;Terminál;Konzole;CLI;
|
|
||||||
Keywords[pl]=Cli;WierszPoleceń;Powłoka;Terminal;
|
|
||||||
Keywords[pt_BR]=Comando;Shell;Terminal;
|
|
||||||
Keywords[hu]=parancssor;terminál;
|
|
||||||
Keywords[pt]=Comando;Shell;Terminal;Console;
|
|
||||||
Keywords[sk]=Príkaz;Shell;Terminál;Konzola;
|
|
||||||
Keywords[ru]=Команда;Оболочка;Терминал;Консоль;
|
|
||||||
Keywords[es]=Comando;Shell;Terminal;Consola;
|
|
||||||
Keywords[it]=Comando;Shell;Terminale;Console;
|
|
||||||
Keywords[sv]=Kommando;Skal;Terminal;CLI;Konsol
|
|
||||||
|
|
|
||||||
|
|
@ -9,27 +9,7 @@
|
||||||
<url type="homepage">https://github.com/pop-os/cosmic-term</url>
|
<url type="homepage">https://github.com/pop-os/cosmic-term</url>
|
||||||
<url type="bugtracker">https://github.com/pop-os/cosmic-term</url>
|
<url type="bugtracker">https://github.com/pop-os/cosmic-term</url>
|
||||||
<name>COSMIC Terminal</name>
|
<name>COSMIC Terminal</name>
|
||||||
<name xml:lang="ar">طرفية COSMIC</name>
|
|
||||||
<name xml:lang="cs">Terminál COSMIC</name>
|
|
||||||
<name xml:lang="pl">Terminal COSMIC</name>
|
|
||||||
<name xml:lang="hu">COSMIC Terminál</name>
|
|
||||||
<name xml:lang="pt_BR">Terminal</name>
|
|
||||||
<name xml:lang="pt">Terminal</name>
|
|
||||||
<name xml:lang="sk">Terminál COSMIC</name>
|
|
||||||
<name xml:lang="es">Terminal COSMIC</name>
|
|
||||||
<name xml:lang="it">Terminale di COSMIC</name>
|
|
||||||
<name xml:lang="sv">COSMIC Terminal</name>
|
|
||||||
<summary>Terminal emulator for the COSMIC desktop</summary>
|
<summary>Terminal emulator for the COSMIC desktop</summary>
|
||||||
<summary xml:lang="ar">محاكي طرفي لسطح مكتب COSMIC</summary>
|
|
||||||
<summary xml:lang="cs">Emulátor terminálu pro pracovní prostředí COSMIC</summary>
|
|
||||||
<summary xml:lang="pl">Emulator terminala dla pulpitu COSMIC</summary>
|
|
||||||
<summary xml:lang="hu">Terminálemulátor a COSMIC asztali környezethez</summary>
|
|
||||||
<summary xml:lang="pt_BR">Emulador de terminal do desktop COSMIC</summary>
|
|
||||||
<summary xml:lang="pt">Emulador de terminal do desktop COSMIC</summary>
|
|
||||||
<summary xml:lang="sk">Emulátor terminálu pre pracovné prostredie COSMIC</summary>
|
|
||||||
<summary xml:lang="es">Emulador de terminal de escritorio COSMIC</summary>
|
|
||||||
<summary xml:lang="it">Emulatore di terminale di COSMIC</summary>
|
|
||||||
<summary xml:lang="sv">Terminalemulator för skrivbordsmiljön COSMIC</summary>
|
|
||||||
<description>
|
<description>
|
||||||
<p>Terminal emulator for the COSMIC desktop</p>
|
<p>Terminal emulator for the COSMIC desktop</p>
|
||||||
<p xml:lang="ar">محاكي طرفي لسطح مكتب COSMIC</p>
|
<p xml:lang="ar">محاكي طرفي لسطح مكتب COSMIC</p>
|
||||||
|
|
@ -43,6 +23,12 @@
|
||||||
<p xml:lang="it">Emulatore di terminale di COSMIC</p>
|
<p xml:lang="it">Emulatore di terminale di COSMIC</p>
|
||||||
<p xml:lang="sv">Terminalemulator för skrivbordsmiljön COSMIC</p>
|
<p xml:lang="sv">Terminalemulator för skrivbordsmiljön COSMIC</p>
|
||||||
</description>
|
</description>
|
||||||
|
<keywords>
|
||||||
|
<keyword>Command</keyword>
|
||||||
|
<keyword>Shell</keyword>
|
||||||
|
<keyword>Terminal</keyword>
|
||||||
|
<keyword>CLI</keyword>
|
||||||
|
</keywords>
|
||||||
<launchable type="desktop-id">com.system76.CosmicTerm.desktop</launchable>
|
<launchable type="desktop-id">com.system76.CosmicTerm.desktop</launchable>
|
||||||
<icon type="remote" height="256" width="256">
|
<icon type="remote" height="256" width="256">
|
||||||
https://raw.githubusercontent.com/pop-os/cosmic-term/master/res/icons/hicolor/256x256/apps/com.system76.CosmicTerm.svg</icon>
|
https://raw.githubusercontent.com/pop-os/cosmic-term/master/res/icons/hicolor/256x256/apps/com.system76.CosmicTerm.svg</icon>
|
||||||
|
|
|
||||||
|
|
@ -1761,6 +1761,7 @@ impl Application for App {
|
||||||
.icon(widget::icon::from_name(Self::APP_ID))
|
.icon(widget::icon::from_name(Self::APP_ID))
|
||||||
.version(env!("CARGO_PKG_VERSION"))
|
.version(env!("CARGO_PKG_VERSION"))
|
||||||
.author("System76")
|
.author("System76")
|
||||||
|
.comments(fl!("comment"))
|
||||||
.license("GPL-3.0-only")
|
.license("GPL-3.0-only")
|
||||||
.license_url("https://spdx.org/licenses/GPL-3.0-only")
|
.license_url("https://spdx.org/licenses/GPL-3.0-only")
|
||||||
.developers([("Jeremy Soller", "jeremy@system76.com")])
|
.developers([("Jeremy Soller", "jeremy@system76.com")])
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue