mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Follow-up from i18n-helpers MR
This commit is contained in:
parent
dd5523785c
commit
9dc07a38db
@ -1,6 +1,16 @@
|
||||
#!/bin/bash
|
||||
# cargo clippy is a superset of cargo check, so we don't check manually
|
||||
time cargo clippy --all-targets --locked --features="bin_cmd_doc_gen,bin_compression,bin_csv,bin_graphviz,bin_bot,bin_asset_migrate,asset_tweak" -- -D warnings &&
|
||||
|
||||
time cargo clippy \
|
||||
--all-targets \
|
||||
--locked \
|
||||
--features="bin_cmd_doc_gen,bin_compression,bin_csv,bin_graphviz,bin_bot,bin_asset_migrate,asset_tweak,bin,stat" \
|
||||
-- -D warnings &&
|
||||
|
||||
# Ensure that the veloren-voxygen default-publish feature builds as it excludes some default features
|
||||
time cargo clippy -p veloren-voxygen --locked --no-default-features --features="default-publish" -- -D warnings &&
|
||||
time cargo clippy -p \
|
||||
veloren-voxygen --locked \
|
||||
--no-default-features \
|
||||
--features="default-publish" \
|
||||
-- -D warnings &&
|
||||
time cargo fmt --all -- --check
|
||||
|
@ -99,7 +99,7 @@ fn main() {
|
||||
"{}",
|
||||
localize_chat_message(
|
||||
m,
|
||||
|msg| client.lockup_msg_context(msg),
|
||||
|msg| client.lookup_msg_context(msg),
|
||||
&localisation.read(),
|
||||
SHOW_NAME,
|
||||
)
|
||||
|
@ -1,6 +1,6 @@
|
||||
use clap::{Arg, Command};
|
||||
use common_assets::find_root;
|
||||
use veloren_voxygen_i18n::{
|
||||
use veloren_client_i18n::{
|
||||
analysis::{Language, ReferenceLanguage},
|
||||
REFERENCE_LANG,
|
||||
};
|
||||
|
@ -1,6 +1,6 @@
|
||||
use common_assets::find_root;
|
||||
use std::{fs, io::Write, path::Path};
|
||||
use veloren_voxygen_i18n::{
|
||||
use veloren_client_i18n::{
|
||||
analysis::{Language, ReferenceLanguage},
|
||||
list_localizations, REFERENCE_LANG,
|
||||
};
|
||||
@ -26,7 +26,7 @@ fn main() {
|
||||
.and_then(|s| s.to_str())
|
||||
.unwrap_or("<err>");
|
||||
|
||||
format!("{file}")
|
||||
file.to_string()
|
||||
};
|
||||
for meta in list {
|
||||
let code = meta.language_identifier;
|
||||
|
@ -2643,7 +2643,7 @@ impl Client {
|
||||
|
||||
/// Get important information from client that is necessary for message
|
||||
/// localisation
|
||||
pub fn lockup_msg_context(&self, msg: &comp::ChatMsg) -> ChatTypeContext {
|
||||
pub fn lookup_msg_context(&self, msg: &comp::ChatMsg) -> ChatTypeContext {
|
||||
let mut result = ChatTypeContext {
|
||||
you: self.uid().expect("Client doesn't have a Uid!!!"),
|
||||
player_alias: HashMap::new(),
|
||||
@ -2861,7 +2861,7 @@ mod tests {
|
||||
let msg: comp::ChatMsg = msg;
|
||||
let _s: String = localize_chat_message(
|
||||
msg,
|
||||
|msg| client.lockup_msg_context(msg),
|
||||
|msg| client.lookup_msg_context(msg),
|
||||
&localisation.read(),
|
||||
true,
|
||||
)
|
||||
|
@ -421,7 +421,7 @@ impl<'a> Widget for Chat<'a> {
|
||||
.map(|m| {
|
||||
localize_chat_message(
|
||||
m.clone(),
|
||||
|msg| self.client.lockup_msg_context(msg),
|
||||
|msg| self.client.lookup_msg_context(msg),
|
||||
self.localized_strings,
|
||||
show_char_name,
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user