Skip to content

Commit

Permalink
Feature/improved translations (#4)
Browse files Browse the repository at this point in the history
* Added missing translation usage on menu buttons

* Update base strings after activating usage of i18n within menu entries

* Added first version of German and Romanian translation

* Activated German and Romanian translation

* Sorted i18n.json

* Added missing strings to localization

* Streamlined nearly identical description content

* Fixed typo

* Streamlined nearly identical description content

* Streamlined naming of different testnet versions

* Added new string to localization

* Added first parts of Dutch translation

* Updated German translation

* Added new base entries

* Use translated network names on settings page

* Updated/added es, fa, id, pl, ro, ru, uk, zh translations

but fa and zh not activated, require corresponding fonts

* Added missing usage of translated string

* Added/exported translation

---------

Co-authored-by: aspect <[email protected]>
  • Loading branch information
HLXEasy and aspect authored Feb 25, 2024
1 parent 977d25d commit 1d2f2b4
Show file tree
Hide file tree
Showing 11 changed files with 3,160 additions and 61 deletions.
2 changes: 1 addition & 1 deletion core/src/egui/popup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ impl<'panel> PopupPanel<'panel> {

ui.add_space(8.);
ui.vertical_centered(|ui| {
if ui.medium_button("Close").clicked() {
if ui.medium_button(i18n("Close")).clicked() {
close_popup = true;
}
});
Expand Down
2 changes: 1 addition & 1 deletion core/src/frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ fn close_maximize_minimize(ui: &mut egui::Ui, is_fullscreen: bool, is_maximized:
RichText::new(X.to_string()).size(button_height),
))
// .add(Button::new(RichText::new("❌").size(button_height)))
.on_hover_text("Close the window");
.on_hover_text(i18n("Close the window"));
if close_response.clicked() {
ui.ctx().send_viewport_cmd(egui::ViewportCommand::Close);
}
Expand Down
2 changes: 1 addition & 1 deletion core/src/modules/donations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ impl ModuleT for Donations {

ui.add_space(8.);

ui.label(i18n("The Kaspa NG software represents an ongoing effort focused on building a state-of-the-art software platform dedicated to the Kaspa BlockDAG cryptocurrency network. Ideological at its core, this software has a strong focus on security, privacy, performance, and decentralization."));
ui.label(i18n("The Kaspa NG software represents an ongoing effort focused on building a state-of-the-art software platform dedicated to the Kaspa BlockDAG cryptocurrency network. Ideological at its core, this software prioritizes security, privacy, performance, and decentralization."));
ui.label(" ");
ui.label(i18n("Because of its focus on security and performance, this software is entirely developed in Rust, demanding significantly more time and effort compared to other traditional modern web-driven software."));
ui.label(" ");
Expand Down
2 changes: 1 addition & 1 deletion core/src/modules/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ impl ModuleT for Metrics {
})
.with_min_width(240.)
.with_max_height(screen_rect_height * 0.8)
.with_caption("Settings")
.with_caption(i18n("Settings"))
.with_close_button(true)
.build(ui);

Expand Down
2 changes: 1 addition & 1 deletion core/src/modules/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ impl ModuleT for Request {

})
.with_footer(|_ctx, ui| {
if ui.large_button("Close").clicked() {
if ui.large_button(i18n("Close")).clicked() {
*close.borrow_mut() = true;
}
})
Expand Down
2 changes: 1 addition & 1 deletion core/src/modules/scanner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ impl ModuleT for Scanner {
ui.label(i18n("The node is currently syncing with the Kaspa p2p network. Please wait for the node to sync."));
ui.add_space(16.);

if ui.large_button("Close").clicked() {
if ui.large_button(i18n("Close")).clicked() {
*back.borrow_mut() = true;
}

Expand Down
8 changes: 4 additions & 4 deletions core/src/modules/settings/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,12 @@ impl Settings {

let mut node_settings_error = None;

CollapsingHeader::new("Kaspa p2p Network & Node Connection")
CollapsingHeader::new(i18n("Kaspa p2p Network & Node Connection"))
.default_open(true)
.show(ui, |ui| {


CollapsingHeader::new("Kaspa Network")
CollapsingHeader::new(i18n("Kaspa Network"))
.default_open(true)
.show(ui, |ui| {
ui.horizontal_wrapped(|ui|{
Expand All @@ -168,7 +168,7 @@ impl Settings {
});


CollapsingHeader::new("Kaspa Node")
CollapsingHeader::new(i18n("Kaspa Node"))
.default_open(true)
.show(ui, |ui| {
ui.horizontal_wrapped(|ui|{
Expand Down Expand Up @@ -218,7 +218,7 @@ impl Settings {
#[cfg(not(target_arch = "wasm32"))]
if self.settings.node.node_kind.is_config_capable() {

CollapsingHeader::new("Cache Memory Size")
CollapsingHeader::new(i18n("Cache Memory Size"))
.default_open(true)
.show(ui, |ui| {
ui.horizontal_wrapped(|ui|{
Expand Down
2 changes: 1 addition & 1 deletion core/src/modules/wallet_secret.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ impl ModuleT for WalletSecret {
ui.label(i18n("This feature requires an open wallet"));
})
.with_footer(|_,ui| {
if ui.large_button("Close").clicked() {
if ui.large_button(i18n("Close")).clicked() {
*back.borrow_mut() = true;
}
})
Expand Down
10 changes: 5 additions & 5 deletions core/src/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ pub enum Network {
impl std::fmt::Display for Network {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Network::Mainnet => write!(f, "mainnet"),
Network::Testnet10 => write!(f, "testnet-10"),
Network::Testnet11 => write!(f, "testnet-11"),
Network::Mainnet => write!(f, "{}", Network::Mainnet.name()),
Network::Testnet10 => write!(f, "{}", Network::Testnet10.name()),
Network::Testnet11 => write!(f, "{}", Network::Testnet11.name()),
}
}
}
Expand Down Expand Up @@ -130,8 +130,8 @@ impl Network {
pub fn name(&self) -> &str {
match self {
Network::Mainnet => i18n("Mainnet"),
Network::Testnet10 => i18n("Testnet-10"),
Network::Testnet11 => i18n("Testnet-11"),
Network::Testnet10 => i18n("Testnet 10"),
Network::Testnet11 => i18n("Testnet 11"),
}
}

Expand Down
2 changes: 1 addition & 1 deletion core/src/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ impl<'core> Status<'core> {
if ui
.add(
Label::new(RichText::new(i18n(
"Click to try an another server...",
"Click to try another server...",
)))
.sense(Sense::click()),
)
Expand Down
Loading

0 comments on commit 1d2f2b4

Please sign in to comment.