diff --git a/.gitlab/scripts/unittest.sh b/.gitlab/scripts/unittest.sh index a4193d3914..4bb46b4995 100755 --- a/.gitlab/scripts/unittest.sh +++ b/.gitlab/scripts/unittest.sh @@ -1,7 +1,7 @@ #!/bin/bash export VELOREN_ASSETS="$(pwd)/assets" rm -r target/debug/incremental/veloren_* || echo "all good" # TMP FIX FOR 2021-03-22-nightly -time cargo test --package veloren-i18n --lib test_all_localizations -- --nocapture --ignored && +time cargo test --package veloren-voxygen-i18n --lib test_all_localizations -- --nocapture --ignored && time cargo test --package veloren-common-assets asset_tweak::tests --features asset_tweak --lib && ( rm -r target/debug/incremental* || echo "all good" ) && # TMP FIX FOR 2021-03-22-nightly time cargo test \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 0274d8ca78..3132f6e3fc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6017,20 +6017,6 @@ dependencies = [ "veloren-common-net", ] -[[package]] -name = "veloren-i18n" -version = "0.10.0" -dependencies = [ - "clap", - "deunicode", - "git2", - "hashbrown 0.11.2", - "ron", - "serde", - "tracing", - "veloren-common-assets", -] - [[package]] name = "veloren-network" version = "0.3.0" @@ -6236,10 +6222,10 @@ dependencies = [ "veloren-common-net", "veloren-common-state", "veloren-common-systems", - "veloren-i18n", "veloren-server", "veloren-voxygen-anim", "veloren-voxygen-egui", + "veloren-voxygen-i18n", "veloren-world", "wgpu", "wgpu-profiler", @@ -6295,6 +6281,20 @@ dependencies = [ "veloren-voxygen-egui", ] +[[package]] +name = "veloren-voxygen-i18n" +version = "0.10.0" +dependencies = [ + "clap", + "deunicode", + "git2", + "hashbrown 0.11.2", + "ron", + "serde", + "tracing", + "veloren-common-assets", +] + [[package]] name = "veloren-world" version = "0.10.0" diff --git a/voxygen/Cargo.toml b/voxygen/Cargo.toml index 924be04100..c7504d5890 100644 --- a/voxygen/Cargo.toml +++ b/voxygen/Cargo.toml @@ -46,7 +46,7 @@ common-systems = {package = "veloren-common-systems", path = "../common/systems" common-state = {package = "veloren-common-state", path = "../common/state"} anim = {package = "veloren-voxygen-anim", path = "anim"} -i18n = {package = "veloren-i18n", path = "i18n"} +i18n = {package = "veloren-voxygen-i18n", path = "i18n"} voxygen-egui = {package = "veloren-voxygen-egui", path = "egui", optional = true } # Graphics diff --git a/voxygen/i18n/Cargo.toml b/voxygen/i18n/Cargo.toml index 388586679b..5ebbbb05d1 100644 --- a/voxygen/i18n/Cargo.toml +++ b/voxygen/i18n/Cargo.toml @@ -1,7 +1,7 @@ [package] authors = ["juliancoffee ", "Rémy Phelipot"] edition = "2018" -name = "veloren-i18n" +name = "veloren-voxygen-i18n" description = "Crate for internalization and diagnostic of existing localizations." version = "0.10.0" diff --git a/voxygen/i18n/src/bin/i18n-check.rs b/voxygen/i18n/src/bin/i18n-check.rs index f9062b7b46..6a868a950f 100644 --- a/voxygen/i18n/src/bin/i18n-check.rs +++ b/voxygen/i18n/src/bin/i18n-check.rs @@ -1,5 +1,5 @@ use clap::{App, Arg}; -use veloren_i18n::{analysis, verification}; +use veloren_voxygen_i18n::{analysis, verification, BasePath}; fn main() { let matches = App::new("i18n-check") @@ -36,7 +36,7 @@ fn main() { // Generate paths let root_path = common_assets::find_root().expect("Failed to find root of repository"); - let path = veloren_i18n::BasePath::new(&root_path); + let path = BasePath::new(&root_path); let be_verbose = matches.is_present("verbose"); let csv_enabled = matches.is_present("csv"); diff --git a/voxygen/src/hud/bag.rs b/voxygen/src/hud/bag.rs index 343df2f232..4a21b416db 100644 --- a/voxygen/src/hud/bag.rs +++ b/voxygen/src/hud/bag.rs @@ -7,7 +7,6 @@ use super::{ }; use crate::{ game_input::GameInput, - i18n::Localization, ui::{ fonts::Fonts, slot::{ContentSize, SlotMaker}, @@ -31,6 +30,7 @@ use conrod_core::{ widget::{self, Button, Image, Rectangle, Scrollbar, State as ConrodState, Text}, widget_ids, Color, Colorable, Positionable, Scalar, Sizeable, UiCell, Widget, WidgetCommon, }; +use i18n::Localization; use crate::hud::slots::SlotKind; use specs::Entity as EcsEntity; diff --git a/voxygen/src/hud/buffs.rs b/voxygen/src/hud/buffs.rs index 5fc82242df..393dd06fc0 100644 --- a/voxygen/src/hud/buffs.rs +++ b/voxygen/src/hud/buffs.rs @@ -4,10 +4,10 @@ use super::{ }; use crate::{ hud::{self, BuffPosition}, - i18n::Localization, ui::{fonts::Fonts, ImageFrame, Tooltip, TooltipManager, Tooltipable}, GlobalState, }; +use i18n::Localization; use common::comp::{BuffKind, Buffs, Energy, Health}; use conrod_core::{ diff --git a/voxygen/src/hud/buttons.rs b/voxygen/src/hud/buttons.rs index 79bde0effd..d046c8a783 100644 --- a/voxygen/src/hud/buttons.rs +++ b/voxygen/src/hud/buttons.rs @@ -4,7 +4,6 @@ use super::{ }; use crate::{ game_input::GameInput, - i18n::Localization, ui::{fonts::Fonts, ImageFrame, Tooltip, TooltipManager, Tooltipable}, window::KeyMouse, GlobalState, @@ -15,6 +14,7 @@ use conrod_core::{ widget::{self, Button, Image, Text}, widget_ids, Color, Colorable, Positionable, Sizeable, UiCell, Widget, WidgetCommon, }; +use i18n::Localization; widget_ids! { struct Ids { bag, diff --git a/voxygen/src/hud/chat.rs b/voxygen/src/hud/chat.rs index c05177e1ca..8a48c212e7 100644 --- a/voxygen/src/hud/chat.rs +++ b/voxygen/src/hud/chat.rs @@ -2,7 +2,7 @@ use super::{ img_ids::Imgs, ChatTab, ERROR_COLOR, FACTION_COLOR, GROUP_COLOR, INFO_COLOR, KILL_COLOR, OFFLINE_COLOR, ONLINE_COLOR, REGION_COLOR, SAY_COLOR, TELL_COLOR, TEXT_COLOR, WORLD_COLOR, }; -use crate::{i18n::Localization, settings::chat::MAX_CHAT_TABS, ui::fonts::Fonts, GlobalState}; +use crate::{settings::chat::MAX_CHAT_TABS, ui::fonts::Fonts, GlobalState}; use client::{cmd, Client}; use common::comp::{ chat::{KillSource, KillType}, @@ -22,6 +22,7 @@ use conrod_core::{ widget_ids, Color, Colorable, Labelable, Positionable, Sizeable, Ui, UiCell, Widget, WidgetCommon, }; +use i18n::Localization; use std::collections::{HashSet, VecDeque}; widget_ids! { diff --git a/voxygen/src/hud/crafting.rs b/voxygen/src/hud/crafting.rs index 79093537ac..dd2e917b9c 100644 --- a/voxygen/src/hud/crafting.rs +++ b/voxygen/src/hud/crafting.rs @@ -4,12 +4,9 @@ use super::{ item_imgs::{animate_by_pulse, ItemImgs, ItemKey::Tool}, Show, TEXT_COLOR, TEXT_DULL_RED_COLOR, TEXT_GRAY_COLOR, UI_HIGHLIGHT_0, UI_MAIN, }; -use crate::{ - i18n::Localization, - ui::{ - fonts::Fonts, ImageFrame, ItemTooltip, ItemTooltipManager, ItemTooltipable, Tooltip, - TooltipManager, Tooltipable, - }, +use crate::ui::{ + fonts::Fonts, ImageFrame, ItemTooltip, ItemTooltipManager, ItemTooltipable, Tooltip, + TooltipManager, Tooltipable, }; use client::{self, Client}; use common::{ @@ -29,6 +26,7 @@ use conrod_core::{ widget::{self, Button, Image, Rectangle, Scrollbar, Text, TextEdit}, widget_ids, Color, Colorable, Labelable, Positionable, Sizeable, Widget, WidgetCommon, }; +use i18n::Localization; use std::sync::Arc; use strum::IntoEnumIterator; diff --git a/voxygen/src/hud/diary.rs b/voxygen/src/hud/diary.rs index 8112d784d1..da5af98b50 100644 --- a/voxygen/src/hud/diary.rs +++ b/voxygen/src/hud/diary.rs @@ -3,16 +3,14 @@ use super::{ item_imgs::{animate_by_pulse, ItemImgs, ItemKey::Tool}, Show, CRITICAL_HP_COLOR, HP_COLOR, TEXT_COLOR, UI_HIGHLIGHT_0, UI_MAIN, XP_COLOR, }; -use crate::{ - i18n::Localization, - ui::{fonts::Fonts, ImageFrame, Tooltip, TooltipManager, Tooltipable}, -}; +use crate::ui::{fonts::Fonts, ImageFrame, Tooltip, TooltipManager, Tooltipable}; use conrod_core::{ color, image::Id, widget::{self, button, Button, Image, Rectangle, Text}, widget_ids, Color, Colorable, Labelable, Positionable, Sizeable, UiCell, Widget, WidgetCommon, }; +use i18n::Localization; use client::{self, Client}; use common::comp::{ diff --git a/voxygen/src/hud/esc_menu.rs b/voxygen/src/hud/esc_menu.rs index 5573cf3ad6..92f989ad68 100644 --- a/voxygen/src/hud/esc_menu.rs +++ b/voxygen/src/hud/esc_menu.rs @@ -1,9 +1,10 @@ use super::{img_ids::Imgs, settings_window::SettingsTab, TEXT_COLOR}; -use crate::{i18n::Localization, ui::fonts::Fonts}; +use crate::ui::fonts::Fonts; use conrod_core::{ widget::{self, Button, Image}, widget_ids, Color, Labelable, Positionable, Sizeable, Widget, WidgetCommon, }; +use i18n::Localization; widget_ids! { struct Ids { diff --git a/voxygen/src/hud/group.rs b/voxygen/src/hud/group.rs index 74ee3ed8b2..71fb4a5f56 100644 --- a/voxygen/src/hud/group.rs +++ b/voxygen/src/hud/group.rs @@ -9,7 +9,6 @@ use super::{ use crate::{ game_input::GameInput, hud, - i18n::Localization, settings::Settings, ui::{fonts::Fonts, ImageFrame, Tooltip, TooltipManager, Tooltipable}, GlobalState, @@ -27,6 +26,7 @@ use conrod_core::{ widget::{self, Button, Image, Rectangle, Scrollbar, Text}, widget_ids, Color, Colorable, Labelable, Positionable, Sizeable, Widget, WidgetCommon, }; +use i18n::Localization; use specs::{saveload::MarkerAllocator, WorldExt}; widget_ids! { diff --git a/voxygen/src/hud/loot_scroller.rs b/voxygen/src/hud/loot_scroller.rs index 676291465b..53e88d6820 100644 --- a/voxygen/src/hud/loot_scroller.rs +++ b/voxygen/src/hud/loot_scroller.rs @@ -4,10 +4,7 @@ use super::{ item_imgs::ItemImgs, Show, Windows, TEXT_COLOR, }; -use crate::{ - i18n::Localization, - ui::{fonts::Fonts, ImageFrame, ItemTooltip, ItemTooltipManager, ItemTooltipable}, -}; +use crate::ui::{fonts::Fonts, ImageFrame, ItemTooltip, ItemTooltipManager, ItemTooltipable}; use client::Client; use common::comp::inventory::item::{ItemDef, MaterialStatManifest, Quality}; use conrod_core::{ @@ -16,6 +13,7 @@ use conrod_core::{ widget::{self, Image, List, Rectangle, Scrollbar, Text}, widget_ids, Color, Colorable, Positionable, Sizeable, Widget, WidgetCommon, }; +use i18n::Localization; use std::{collections::VecDeque, sync::Arc}; widget_ids! { diff --git a/voxygen/src/hud/map.rs b/voxygen/src/hud/map.rs index 3742f2565c..9039add9b4 100644 --- a/voxygen/src/hud/map.rs +++ b/voxygen/src/hud/map.rs @@ -4,7 +4,6 @@ use super::{ TEXT_BG, TEXT_BLUE_COLOR, TEXT_COLOR, TEXT_GRAY_COLOR, TEXT_VELORITE, UI_HIGHLIGHT_0, UI_MAIN, }; use crate::{ - i18n::Localization, session::settings_change::{Interface as InterfaceChange, Interface::*}, ui::{fonts::Fonts, img_ids, ImageFrame, Tooltip, TooltipManager, Tooltipable}, GlobalState, @@ -17,6 +16,7 @@ use conrod_core::{ widget::{self, Button, Image, Rectangle, Text}, widget_ids, Color, Colorable, Labelable, Positionable, Sizeable, Widget, WidgetCommon, }; +use i18n::Localization; use specs::{saveload::MarkerAllocator, WorldExt}; use vek::*; diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index af9304279d..4a3b4693ba 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -55,7 +55,6 @@ use crate::{ ecs::{comp as vcomp, comp::HpFloaterList}, game_input::GameInput, hud::{img_ids::ImgsRot, prompt_dialog::DialogOutcomeEvent}, - i18n::Localization, render::UiDrawer, scene::camera::{self, Camera}, session::{ @@ -100,6 +99,7 @@ use conrod_core::{ widget_ids, Color, Colorable, Labelable, Positionable, Sizeable, Widget, }; use hashbrown::{HashMap, HashSet}; +use i18n::Localization; use rand::Rng; use specs::{Entity as EcsEntity, Join, WorldExt}; use std::{ diff --git a/voxygen/src/hud/overhead.rs b/voxygen/src/hud/overhead.rs index 4d58d7aef0..c0c191e50d 100644 --- a/voxygen/src/hud/overhead.rs +++ b/voxygen/src/hud/overhead.rs @@ -5,7 +5,6 @@ use super::{ }; use crate::{ hud::{get_buff_image, get_buff_info}, - i18n::Localization, settings::InterfaceSettings, ui::{fonts::Fonts, Ingameable}, }; @@ -16,6 +15,7 @@ use conrod_core::{ widget::{self, Image, Rectangle, Text}, widget_ids, Color, Colorable, Positionable, Sizeable, Widget, WidgetCommon, }; +use i18n::Localization; const MAX_BUBBLE_WIDTH: f64 = 250.0; widget_ids! { diff --git a/voxygen/src/hud/overitem.rs b/voxygen/src/hud/overitem.rs index 368350389b..7522e04f06 100644 --- a/voxygen/src/hud/overitem.rs +++ b/voxygen/src/hud/overitem.rs @@ -1,6 +1,5 @@ use crate::{ game_input::GameInput, - i18n::Localization, settings::ControlSettings, ui::{fonts::Fonts, Ingameable}, }; @@ -9,6 +8,7 @@ use conrod_core::{ widget::{self, RoundedRectangle, Text}, widget_ids, Color, Colorable, Positionable, Widget, WidgetCommon, }; +use i18n::Localization; use std::borrow::Cow; use keyboard_keynames::key_layout::KeyLayout; diff --git a/voxygen/src/hud/popup.rs b/voxygen/src/hud/popup.rs index 843bc57baf..a87feaecb2 100644 --- a/voxygen/src/hud/popup.rs +++ b/voxygen/src/hud/popup.rs @@ -1,11 +1,12 @@ use super::Show; -use crate::{i18n::Localization, ui::fonts::Fonts}; +use crate::ui::fonts::Fonts; use client::{self, Client}; use common_net::msg::Notification; use conrod_core::{ widget::{self, Text}, widget_ids, Color, Colorable, Positionable, Widget, WidgetCommon, }; +use i18n::Localization; use std::{collections::VecDeque, time::Instant}; widget_ids! { diff --git a/voxygen/src/hud/prompt_dialog.rs b/voxygen/src/hud/prompt_dialog.rs index 599eca1953..769100fc86 100644 --- a/voxygen/src/hud/prompt_dialog.rs +++ b/voxygen/src/hud/prompt_dialog.rs @@ -2,7 +2,6 @@ use super::{img_ids::Imgs, TEXT_COLOR, UI_HIGHLIGHT_0}; use crate::{ game_input::GameInput, hud::{Event, PromptDialogSettings}, - i18n::LocalizationHandle, settings::Settings, ui::fonts::Fonts, }; @@ -10,6 +9,7 @@ use conrod_core::{ widget::{self, Button, Image, Text}, widget_ids, Colorable, Labelable, Positionable, Sizeable, Widget, WidgetCommon, }; +use i18n::LocalizationHandle; use keyboard_keynames::key_layout::KeyLayout; widget_ids! { diff --git a/voxygen/src/hud/settings_window/chat.rs b/voxygen/src/hud/settings_window/chat.rs index 60c540d8fd..6f74fcd20b 100644 --- a/voxygen/src/hud/settings_window/chat.rs +++ b/voxygen/src/hud/settings_window/chat.rs @@ -2,7 +2,6 @@ use super::{RESET_BUTTONS_HEIGHT, RESET_BUTTONS_WIDTH}; use crate::{ hud::{img_ids::Imgs, ChatTab, Show, TEXT_COLOR, TEXT_GRAY_COLOR, UI_HIGHLIGHT_0, UI_MAIN}, - i18n::Localization, session::settings_change::{Chat as ChatChange, Chat::*}, settings::chat::MAX_CHAT_TABS, ui::{fonts::Fonts, ImageSlider, ToggleButton}, @@ -14,6 +13,7 @@ use conrod_core::{ widget::{self, Button, DropDownList, Image, Rectangle, Text, TextEdit}, widget_ids, Colorable, Labelable, Positionable, Sizeable, Widget, WidgetCommon, }; +use i18n::Localization; use std::cmp::Ordering; widget_ids! { diff --git a/voxygen/src/hud/settings_window/controls.rs b/voxygen/src/hud/settings_window/controls.rs index 51b842f936..005ba006b6 100644 --- a/voxygen/src/hud/settings_window/controls.rs +++ b/voxygen/src/hud/settings_window/controls.rs @@ -3,7 +3,6 @@ use super::{RESET_BUTTONS_HEIGHT, RESET_BUTTONS_WIDTH}; use crate::{ game_input::GameInput, hud::{img_ids::Imgs, ERROR_COLOR, TEXT_BIND_CONFLICT_COLOR, TEXT_COLOR}, - i18n::Localization, session::settings_change::{Control as ControlChange, Control::*}, ui::fonts::Fonts, GlobalState, @@ -14,6 +13,7 @@ use conrod_core::{ widget::{self, Button, Rectangle, Scrollbar, Text}, widget_ids, Borderable, Colorable, Labelable, Positionable, Sizeable, Widget, WidgetCommon, }; +use i18n::Localization; use strum::IntoEnumIterator; widget_ids! { diff --git a/voxygen/src/hud/settings_window/gameplay.rs b/voxygen/src/hud/settings_window/gameplay.rs index bb059f528d..010c71739b 100644 --- a/voxygen/src/hud/settings_window/gameplay.rs +++ b/voxygen/src/hud/settings_window/gameplay.rs @@ -2,7 +2,6 @@ use super::{RESET_BUTTONS_HEIGHT, RESET_BUTTONS_WIDTH}; use crate::{ hud::{img_ids::Imgs, PressBehavior, MENU_BG, TEXT_COLOR}, - i18n::Localization, session::settings_change::{Gameplay as GameplayChange, Gameplay::*}, ui::{fonts::Fonts, ImageSlider, ToggleButton}, GlobalState, @@ -13,6 +12,7 @@ use conrod_core::{ widget::{self, Button, DropDownList, Rectangle, Scrollbar, Text}, widget_ids, Colorable, Labelable, Positionable, Sizeable, Widget, WidgetCommon, }; +use i18n::Localization; widget_ids! { struct Ids { diff --git a/voxygen/src/hud/settings_window/interface.rs b/voxygen/src/hud/settings_window/interface.rs index f39def8fa6..27f4745a60 100644 --- a/voxygen/src/hud/settings_window/interface.rs +++ b/voxygen/src/hud/settings_window/interface.rs @@ -4,7 +4,6 @@ use crate::{ hud::{ img_ids::Imgs, BarNumbers, BuffPosition, CrosshairType, ShortcutNumbers, Show, TEXT_COLOR, }, - i18n::Localization, session::settings_change::{Interface as InterfaceChange, Interface::*}, ui::{fonts::Fonts, ImageSlider, ScaleMode, ToggleButton}, GlobalState, @@ -15,6 +14,7 @@ use conrod_core::{ widget::{self, Button, Image, Rectangle, Scrollbar, Text}, widget_ids, Color, Colorable, Labelable, Positionable, Sizeable, Widget, WidgetCommon, }; +use i18n::Localization; widget_ids! { struct Ids{ diff --git a/voxygen/src/hud/settings_window/language.rs b/voxygen/src/hud/settings_window/language.rs index e1cb5787c7..5745b81bca 100644 --- a/voxygen/src/hud/settings_window/language.rs +++ b/voxygen/src/hud/settings_window/language.rs @@ -1,6 +1,5 @@ use crate::{ hud::{img_ids::Imgs, TEXT_COLOR}, - i18n::{list_localizations, Localization}, session::settings_change::{Language as LanguageChange, Language::*}, ui::{fonts::Fonts, ToggleButton}, GlobalState, @@ -10,6 +9,7 @@ use conrod_core::{ widget::{self, Button, Rectangle, Scrollbar, Text}, widget_ids, Colorable, Labelable, Positionable, Sizeable, Widget, WidgetCommon, }; +use i18n::{list_localizations, Localization}; widget_ids! { struct Ids { diff --git a/voxygen/src/hud/settings_window/mod.rs b/voxygen/src/hud/settings_window/mod.rs index 73de93697a..e72101755f 100644 --- a/voxygen/src/hud/settings_window/mod.rs +++ b/voxygen/src/hud/settings_window/mod.rs @@ -8,7 +8,6 @@ mod video; use crate::{ hud::{img_ids::Imgs, Show, TEXT_COLOR, UI_HIGHLIGHT_0, UI_MAIN}, - i18n::Localization, session::settings_change::SettingsChange, ui::fonts::Fonts, GlobalState, @@ -18,6 +17,7 @@ use conrod_core::{ widget::{self, Button, Image, Rectangle, Text}, widget_ids, Colorable, Labelable, Positionable, Sizeable, Widget, WidgetCommon, }; +use i18n::Localization; use strum::IntoEnumIterator; use strum_macros::EnumIter; diff --git a/voxygen/src/hud/settings_window/sound.rs b/voxygen/src/hud/settings_window/sound.rs index f563b48f9e..ed655a0765 100644 --- a/voxygen/src/hud/settings_window/sound.rs +++ b/voxygen/src/hud/settings_window/sound.rs @@ -2,7 +2,6 @@ use super::{RESET_BUTTONS_HEIGHT, RESET_BUTTONS_WIDTH}; use crate::{ hud::{img_ids::Imgs, TEXT_COLOR}, - i18n::Localization, session::settings_change::{Audio as AudioChange, Audio::*}, ui::{fonts::Fonts, ImageSlider}, GlobalState, @@ -13,6 +12,7 @@ use conrod_core::{ widget::{self, Button, Rectangle, Scrollbar, Text}, widget_ids, Colorable, Labelable, Positionable, Sizeable, Widget, WidgetCommon, }; +use i18n::Localization; widget_ids! { struct Ids { diff --git a/voxygen/src/hud/settings_window/video.rs b/voxygen/src/hud/settings_window/video.rs index c638602f30..e577ecb6d6 100644 --- a/voxygen/src/hud/settings_window/video.rs +++ b/voxygen/src/hud/settings_window/video.rs @@ -5,7 +5,6 @@ use crate::{ img_ids::Imgs, CRITICAL_HP_COLOR, HP_COLOR, LOW_HP_COLOR, MENU_BG, STAMINA_COLOR, TEXT_COLOR, }, - i18n::Localization, render::{ AaMode, CloudMode, FluidMode, LightingMode, PresentMode, RenderMode, ShadowMapMode, ShadowMode, UpscaleMode, @@ -23,6 +22,7 @@ use conrod_core::{ widget_ids, Colorable, Labelable, Positionable, Sizeable, Widget, WidgetCommon, }; use core::convert::TryFrom; +use i18n::Localization; use itertools::Itertools; use std::iter::once; diff --git a/voxygen/src/hud/skillbar.rs b/voxygen/src/hud/skillbar.rs index debac354c9..07eae60057 100644 --- a/voxygen/src/hud/skillbar.rs +++ b/voxygen/src/hud/skillbar.rs @@ -8,7 +8,6 @@ use super::{ use crate::{ game_input::GameInput, hud::{ComboFloater, Position, PositionSpecifier}, - i18n::Localization, ui::{ fonts::Fonts, slot::{ContentSize, SlotMaker}, @@ -17,6 +16,7 @@ use crate::{ }, GlobalState, }; +use i18n::Localization; use client::{self, Client}; use common::comp::{ diff --git a/voxygen/src/hud/social.rs b/voxygen/src/hud/social.rs index 8c81cf06a7..6af6a1494e 100644 --- a/voxygen/src/hud/social.rs +++ b/voxygen/src/hud/social.rs @@ -2,11 +2,7 @@ use super::{ img_ids::{Imgs, ImgsRot}, Show, TEXT_COLOR, TEXT_COLOR_3, UI_HIGHLIGHT_0, UI_MAIN, }; - -use crate::{ - i18n::Localization, - ui::{fonts::Fonts, ImageFrame, Tooltip, TooltipManager, Tooltipable}, -}; +use crate::ui::{fonts::Fonts, ImageFrame, Tooltip, TooltipManager, Tooltipable}; use client::{self, Client}; use common::{comp::group, uid::Uid}; use conrod_core::{ @@ -14,6 +10,7 @@ use conrod_core::{ widget::{self, Button, Image, Rectangle, Scrollbar, Text, TextEdit}, widget_ids, Color, Colorable, Labelable, Positionable, Sizeable, Widget, WidgetCommon, }; +use i18n::Localization; use itertools::Itertools; use std::time::Instant; diff --git a/voxygen/src/hud/trade.rs b/voxygen/src/hud/trade.rs index 1aa46459e9..83023f4e7d 100644 --- a/voxygen/src/hud/trade.rs +++ b/voxygen/src/hud/trade.rs @@ -6,7 +6,6 @@ use super::{ }; use crate::{ hud::bag::{BackgroundIds, InventoryScroller}, - i18n::Localization, ui::{ fonts::Fonts, slot::{ContentSize, SlotMaker}, @@ -28,6 +27,7 @@ use conrod_core::{ widget::{self, Button, Image, Rectangle, State as ConrodState, Text}, widget_ids, Color, Colorable, Labelable, Positionable, Sizeable, UiCell, Widget, WidgetCommon, }; +use i18n::Localization; use specs::Entity as EcsEntity; use vek::*; diff --git a/voxygen/src/hud/util.rs b/voxygen/src/hud/util.rs index e383027404..0b7342abf1 100644 --- a/voxygen/src/hud/util.rs +++ b/voxygen/src/hud/util.rs @@ -11,10 +11,9 @@ use common::{ effect::Effect, trade::{Good, SitePrices}, }; +use i18n::Localization; use std::{borrow::Cow, fmt::Write}; -use crate::i18n::Localization; - pub fn price_desc( prices: &Option, item_definition_id: &str, diff --git a/voxygen/src/lib.rs b/voxygen/src/lib.rs index 304710c011..cf4d673534 100644 --- a/voxygen/src/lib.rs +++ b/voxygen/src/lib.rs @@ -33,10 +33,6 @@ pub mod settings; pub mod singleplayer; pub mod window; -// Reexports -pub use crate::error::Error; -pub use i18n; - #[cfg(feature = "singleplayer")] use crate::singleplayer::Singleplayer; #[cfg(feature = "egui-ui")] diff --git a/voxygen/src/main.rs b/voxygen/src/main.rs index 2a52b98e68..f7dff8f1c7 100644 --- a/voxygen/src/main.rs +++ b/voxygen/src/main.rs @@ -2,9 +2,9 @@ #![feature(bool_to_option)] #![recursion_limit = "2048"] +use i18n::{self, LocalizationHandle}; use veloren_voxygen::{ audio::AudioFrontend, - i18n::{self, LocalizationHandle}, profile::Profile, run, scene::terrain::SpriteRenderContext, diff --git a/voxygen/src/menu/char_selection/ui/mod.rs b/voxygen/src/menu/char_selection/ui/mod.rs index d48bfafe6e..b26d7c8fbe 100644 --- a/voxygen/src/menu/char_selection/ui/mod.rs +++ b/voxygen/src/menu/char_selection/ui/mod.rs @@ -1,5 +1,4 @@ use crate::{ - i18n::{Localization, LocalizationHandle}, render::UiDrawer, ui::{ self, @@ -26,6 +25,7 @@ use common::{ comp::{self, humanoid, inventory::slot::EquipSlot, Inventory, Item}, LoadoutBuilder, }; +use i18n::{Localization, LocalizationHandle}; //ImageFrame, Tooltip, use crate::settings::Settings; //use std::time::Duration; diff --git a/voxygen/src/menu/main/mod.rs b/voxygen/src/menu/main/mod.rs index 06457e5069..910174901a 100644 --- a/voxygen/src/menu/main/mod.rs +++ b/voxygen/src/menu/main/mod.rs @@ -6,7 +6,6 @@ use super::char_selection::CharSelectionState; #[cfg(feature = "singleplayer")] use crate::singleplayer::Singleplayer; use crate::{ - i18n::LocalizationHandle, render::{Drawer, GlobalsBindGroup}, settings::Settings, window::Event, @@ -20,6 +19,7 @@ use client::{ use client_init::{ClientInit, Error as InitError, Msg as InitMsg}; use common::comp; use common_base::span; +use i18n::LocalizationHandle; use scene::Scene; use std::sync::Arc; use tokio::runtime; diff --git a/voxygen/src/menu/main/ui/connecting.rs b/voxygen/src/menu/main/ui/connecting.rs index 42c090a1c6..49651fdb21 100644 --- a/voxygen/src/menu/main/ui/connecting.rs +++ b/voxygen/src/menu/main/ui/connecting.rs @@ -1,13 +1,12 @@ use super::{ConnectionState, Imgs, Message}; -use crate::{ - i18n::Localization, - ui::{ - fonts::IcedFonts as Fonts, - ice::{component::neat_button, style, widget::Image, Element, IcedUi as Ui, Id}, - Graphic, - }, + +use crate::ui::{ + fonts::IcedFonts as Fonts, + ice::{component::neat_button, style, widget::Image, Element, IcedUi as Ui, Id}, + Graphic, }; use common::assets::{self, AssetExt}; +use i18n::Localization; use iced::{button, Align, Column, Container, Length, Row, Space, Text}; use serde::{Deserialize, Serialize}; diff --git a/voxygen/src/menu/main/ui/disclaimer.rs b/voxygen/src/menu/main/ui/disclaimer.rs index b7225a0edf..885b29bc15 100644 --- a/voxygen/src/menu/main/ui/disclaimer.rs +++ b/voxygen/src/menu/main/ui/disclaimer.rs @@ -1,6 +1,6 @@ use super::Message; +use i18n::{Localization}; use crate::{ - i18n::Localization, ui::{ fonts::IcedFonts as Fonts, ice::{component::neat_button, style, Element}, diff --git a/voxygen/src/menu/main/ui/login.rs b/voxygen/src/menu/main/ui/login.rs index cb8303b951..9234e713d6 100644 --- a/voxygen/src/menu/main/ui/login.rs +++ b/voxygen/src/menu/main/ui/login.rs @@ -1,19 +1,17 @@ use super::{Imgs, LoginInfo, Message, FILL_FRAC_ONE, FILL_FRAC_TWO}; -use crate::{ - i18n::Localization, - ui::{ - fonts::IcedFonts as Fonts, - ice::{ - component::neat_button, - style, - widget::{ - compound_graphic::{CompoundGraphic, Graphic}, - BackgroundContainer, Image, Padding, - }, - Element, +use crate::ui::{ + fonts::IcedFonts as Fonts, + ice::{ + component::neat_button, + style, + widget::{ + compound_graphic::{CompoundGraphic, Graphic}, + BackgroundContainer, Image, Padding, }, + Element, }, }; +use i18n::{LanguageMetadata, Localization}; use iced::{ button, scrollable, text_input, Align, Button, Column, Container, Length, Row, Scrollable, Space, Text, TextInput, @@ -61,7 +59,7 @@ impl Screen { i18n: &Localization, is_selecting_language: bool, selected_language_index: Option, - language_metadatas: &[crate::i18n::LanguageMetadata], + language_metadatas: &[LanguageMetadata], button_style: style::button::Style, version: &str, ) -> Element { @@ -223,7 +221,7 @@ impl LanguageSelectBanner { fonts: &Fonts, imgs: &Imgs, i18n: &Localization, - language_metadatas: &[crate::i18n::LanguageMetadata], + language_metadatas: &[LanguageMetadata], selected_language_index: Option, button_style: style::button::Style, ) -> Element { diff --git a/voxygen/src/menu/main/ui/mod.rs b/voxygen/src/menu/main/ui/mod.rs index 2cb8772994..a013750891 100644 --- a/voxygen/src/menu/main/ui/mod.rs +++ b/voxygen/src/menu/main/ui/mod.rs @@ -5,7 +5,6 @@ mod login; mod servers; use crate::{ - i18n::{LanguageMetadata, LocalizationHandle}, render::UiDrawer, ui::{ self, @@ -16,6 +15,7 @@ use crate::{ }, window, GlobalState, }; +use i18n::{LanguageMetadata, LocalizationHandle}; use iced::{text_input, Column, Container, HorizontalAlignment, Length, Row, Space}; //ImageFrame, Tooltip, use crate::settings::Settings; @@ -193,7 +193,7 @@ impl Controls { .iter() .position(|f| f == &login_info.server); - let language_metadatas = crate::i18n::list_localizations(); + let language_metadatas = i18n::list_localizations(); let selected_language_index = language_metadatas .iter() .position(|f| f.language_identifier == settings.language.selected_language); @@ -256,7 +256,7 @@ impl Controls { self.imgs.bg }; - let language_metadatas = crate::i18n::list_localizations(); + let language_metadatas = i18n::list_localizations(); // TODO: make any large text blocks scrollable so that if the area is to // small they can still be read @@ -315,7 +315,7 @@ impl Controls { ui: &mut Ui, ) { let servers = &settings.networking.servers; - let mut language_metadatas = crate::i18n::list_localizations(); + let mut language_metadatas = i18n::list_localizations(); match message { Message::Quit => events.push(Event::Quit), @@ -509,7 +509,7 @@ impl MainMenuUi { self.ui.clear_fonts(font); self.controls.fonts = Fonts::load(i18n.fonts(), &mut self.ui).expect("Impossible to load fonts!"); - let language_metadatas = crate::i18n::list_localizations(); + let language_metadatas = i18n::list_localizations(); self.controls.selected_language_index = language_metadatas .iter() .position(|f| f.language_identifier == settings.language.selected_language); diff --git a/voxygen/src/menu/main/ui/servers.rs b/voxygen/src/menu/main/ui/servers.rs index b07804ee63..4e4f20343f 100644 --- a/voxygen/src/menu/main/ui/servers.rs +++ b/voxygen/src/menu/main/ui/servers.rs @@ -1,11 +1,9 @@ use super::{Imgs, Message, FILL_FRAC_ONE}; -use crate::{ - i18n::Localization, - ui::{ - fonts::IcedFonts as Fonts, - ice::{component::neat_button, style, Element}, - }, +use crate::ui::{ + fonts::IcedFonts as Fonts, + ice::{component::neat_button, style, Element}, }; +use i18n::Localization; use iced::{ button, scrollable, Align, Button, Column, Container, Length, Row, Scrollable, Space, Text, }; diff --git a/voxygen/src/session/mod.rs b/voxygen/src/session/mod.rs index f64aed6221..3e7bda0b77 100644 --- a/voxygen/src/session/mod.rs +++ b/voxygen/src/session/mod.rs @@ -35,6 +35,7 @@ use common_net::{ use crate::{ audio::sfx::SfxEvent, + error::Error, game_input::GameInput, hud::{DebugInfo, Event as HudEvent, Hud, HudInfo, LootMessage, PromptDialogSettings}, key_state::KeyState, @@ -43,7 +44,7 @@ use crate::{ scene::{camera, terrain::Interaction, CameraMode, DebugShapeId, Scene, SceneData}, settings::Settings, window::{AnalogGameInput, Event}, - Direction, Error, GlobalState, PlayState, PlayStateResult, + Direction, GlobalState, PlayState, PlayStateResult, }; use hashbrown::HashMap; use settings_change::Language::ChangeLanguage; diff --git a/voxygen/src/session/settings_change.rs b/voxygen/src/session/settings_change.rs index 6f8239c141..62e18e8547 100644 --- a/voxygen/src/session/settings_change.rs +++ b/voxygen/src/session/settings_change.rs @@ -6,7 +6,6 @@ use crate::{ BarNumbers, BuffPosition, ChatTab, CrosshairType, Intro, PressBehavior, ScaleChange, ShortcutNumbers, XpBar, }, - i18n::{LanguageMetadata, LocalizationHandle}, render::RenderMode, settings::{ AudioSettings, ChatSettings, ControlSettings, Fps, GamepadSettings, GameplaySettings, @@ -15,6 +14,7 @@ use crate::{ window::FullScreenSettings, GlobalState, }; +use i18n::{LanguageMetadata, LocalizationHandle}; use vek::*; #[derive(Clone)] diff --git a/voxygen/src/settings/language.rs b/voxygen/src/settings/language.rs index b8e3f8b20e..28fd1840e3 100644 --- a/voxygen/src/settings/language.rs +++ b/voxygen/src/settings/language.rs @@ -1,4 +1,3 @@ -use crate::i18n; use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, Serialize, Deserialize)] diff --git a/voxygen/src/ui/cache.rs b/voxygen/src/ui/cache.rs index dcf5041b8e..fd807d48e6 100644 --- a/voxygen/src/ui/cache.rs +++ b/voxygen/src/ui/cache.rs @@ -1,7 +1,7 @@ use super::graphic::{Graphic, GraphicCache, Id as GraphicId}; use crate::{ + error::Error, render::{Mesh, Renderer, Texture, UiTextureBindGroup, UiVertex}, - Error, }; use conrod_core::{text::GlyphCache, widget::Id}; use hashbrown::HashMap; diff --git a/voxygen/src/ui/fonts.rs b/voxygen/src/ui/fonts.rs index 1bd9ac45a1..fe3716542d 100644 --- a/voxygen/src/ui/fonts.rs +++ b/voxygen/src/ui/fonts.rs @@ -1,4 +1,4 @@ -use crate::{i18n, ui::ice::RawFont}; +use crate::ui::ice::RawFont; use common::assets::{self, AssetExt}; pub struct Font { diff --git a/voxygen/src/ui/ice/cache.rs b/voxygen/src/ui/ice/cache.rs index aeb629bc88..e7631e10a4 100644 --- a/voxygen/src/ui/ice/cache.rs +++ b/voxygen/src/ui/ice/cache.rs @@ -1,7 +1,7 @@ use super::graphic::{Graphic, GraphicCache, Id as GraphicId}; use crate::{ + error::Error, render::{Renderer, Texture, UiTextureBindGroup}, - Error, }; use common::assets::{self, AssetExt}; use glyph_brush::GlyphBrushBuilder; diff --git a/voxygen/src/ui/ice/mod.rs b/voxygen/src/ui/ice/mod.rs index 91393ad0cf..d28ef981d9 100644 --- a/voxygen/src/ui/ice/mod.rs +++ b/voxygen/src/ui/ice/mod.rs @@ -15,9 +15,9 @@ use super::{ scale::{Scale, ScaleMode}, }; use crate::{ + error::Error, render::{Renderer, UiDrawer}, window::Window, - Error, }; use common::slowjob::SlowJobPool; use common_base::span; diff --git a/voxygen/src/ui/ice/renderer/mod.rs b/voxygen/src/ui/ice/renderer/mod.rs index 51f4fbf494..2c6ff6014c 100644 --- a/voxygen/src/ui/ice/renderer/mod.rs +++ b/voxygen/src/ui/ice/renderer/mod.rs @@ -14,11 +14,11 @@ use super::{ Font, FontId, RawFont, Rotation, }; use crate::{ + error::Error, render::{ create_ui_quad, create_ui_quad_vert_gradient, DynamicModel, Mesh, Renderer, UiBoundLocals, UiDrawer, UiLocals, UiMode, UiVertex, }, - Error, }; use common::{slowjob::SlowJobPool, util::srgba_to_linear}; use common_base::span; diff --git a/voxygen/src/ui/mod.rs b/voxygen/src/ui/mod.rs index 574dd6ed8c..65b57fb139 100644 --- a/voxygen/src/ui/mod.rs +++ b/voxygen/src/ui/mod.rs @@ -28,12 +28,12 @@ pub use widgets::{ }; use crate::{ + error::Error, render::{ create_ui_quad, create_ui_tri, DynamicModel, Mesh, RenderError, Renderer, UiBoundLocals, UiDrawer, UiLocals, UiMode, UiVertex, }, window::Window, - Error, }; #[rustfmt::skip] use ::image::GenericImageView; diff --git a/voxygen/src/ui/widgets/item_tooltip.rs b/voxygen/src/ui/widgets/item_tooltip.rs index 4dcd6f7cf0..86c3ef1ad4 100644 --- a/voxygen/src/ui/widgets/item_tooltip.rs +++ b/voxygen/src/ui/widgets/item_tooltip.rs @@ -1,12 +1,9 @@ use super::image_frame::ImageFrame; -use crate::{ - hud::{ - get_quality_col, - img_ids::Imgs, - item_imgs::{animate_by_pulse, ItemImgs, ItemKey}, - util, - }, - i18n::Localization, +use crate::hud::{ + get_quality_col, + img_ids::Imgs, + item_imgs::{animate_by_pulse, ItemImgs, ItemKey}, + util, }; use client::Client; use common::{ @@ -22,6 +19,7 @@ use conrod_core::{ widget, widget_ids, Color, Colorable, FontSize, Positionable, Scalar, Sizeable, Ui, UiCell, Widget, WidgetCommon, WidgetStyle, }; +use i18n::Localization; use lazy_static::lazy_static; use std::time::{Duration, Instant}; diff --git a/voxygen/src/window.rs b/voxygen/src/window.rs index 3663e3443a..4f2c3da9d4 100644 --- a/voxygen/src/window.rs +++ b/voxygen/src/window.rs @@ -1,9 +1,10 @@ use crate::{ controller::*, + error::Error, game_input::GameInput, render::Renderer, settings::{ControlSettings, Settings}, - ui, Error, + ui, }; use common_base::span; use crossbeam_channel as channel;