diff --git a/assets/voxygen/i18n/PL/_root.ron b/assets/voxygen/i18n/PL/_root.ron index 545eae7ce1..415e236d91 100644 --- a/assets/voxygen/i18n/PL/_root.ron +++ b/assets/voxygen/i18n/PL/_root.ron @@ -27,6 +27,7 @@ scale_ratio: 1.0, ), }, + sub_directories: [], string_map: { /// Start Common section // Texts used in multiple locations with the same formatting diff --git a/assets/voxygen/i18n/de_DE/_root.ron b/assets/voxygen/i18n/de_DE/_root.ron index 79a82a388f..02f81f3753 100644 --- a/assets/voxygen/i18n/de_DE/_root.ron +++ b/assets/voxygen/i18n/de_DE/_root.ron @@ -39,6 +39,7 @@ scale_ratio: 1.0, ), }, + sub_directories: [], string_map: { /// Start Common section /// Texts used in multiple locations with the same formatting diff --git a/assets/voxygen/i18n/es_ES/_root.ron b/assets/voxygen/i18n/es_ES/_root.ron index a78e33a4b9..3c3b3905d6 100644 --- a/assets/voxygen/i18n/es_ES/_root.ron +++ b/assets/voxygen/i18n/es_ES/_root.ron @@ -40,6 +40,7 @@ scale_ratio: 1.0, ), }, + sub_directories: [], string_map: { /// Start Common section // Texts used in multiple locations with the same formatting diff --git a/assets/voxygen/i18n/es_la/_root.ron b/assets/voxygen/i18n/es_la/_root.ron index 43d8297186..26eb3c3078 100644 --- a/assets/voxygen/i18n/es_la/_root.ron +++ b/assets/voxygen/i18n/es_la/_root.ron @@ -41,6 +41,7 @@ scale_ratio: 1.0, ), }, + sub_directories: [], string_map: { /// Start Common section // Texts used in multiple locations with the same formatting diff --git a/assets/voxygen/i18n/fr_FR/_root.ron b/assets/voxygen/i18n/fr_FR/_root.ron index e2830950d4..8fe307b634 100644 --- a/assets/voxygen/i18n/fr_FR/_root.ron +++ b/assets/voxygen/i18n/fr_FR/_root.ron @@ -27,6 +27,7 @@ scale_ratio: 0.9, ), }, + sub_directories: [], string_map: { // Common texts used in multiple locations "common.username": "pseudo", diff --git a/assets/voxygen/i18n/it_IT/_root.ron b/assets/voxygen/i18n/it_IT/_root.ron index 5a37d39d36..1d06e11ded 100644 --- a/assets/voxygen/i18n/it_IT/_root.ron +++ b/assets/voxygen/i18n/it_IT/_root.ron @@ -42,6 +42,8 @@ scale_ratio: 1.0, ), }, + + sub_directories: [], string_map: { /// Start Common section // Texts used in multiple locations with the same formatting diff --git a/assets/voxygen/i18n/nl/_root.ron b/assets/voxygen/i18n/nl/_root.ron index ed2c33f119..c8b0611d08 100644 --- a/assets/voxygen/i18n/nl/_root.ron +++ b/assets/voxygen/i18n/nl/_root.ron @@ -41,6 +41,7 @@ scale_ratio: 1.0, ), }, + sub_directories: [], string_map: { /// Start Common section // Texts used in multiple locations with the same formatting diff --git a/assets/voxygen/i18n/no/_root.ron b/assets/voxygen/i18n/no/_root.ron index de01c4a6d6..a2c7c1f520 100644 --- a/assets/voxygen/i18n/no/_root.ron +++ b/assets/voxygen/i18n/no/_root.ron @@ -41,6 +41,7 @@ scale_ratio: 1.0, ), }, + sub_directories: [], string_map: { /// Start Common section // Texts used in multiple locations with the same formatting diff --git a/assets/voxygen/i18n/pt_BR/_root.ron b/assets/voxygen/i18n/pt_BR/_root.ron index f0d4d64eb1..dd791304cc 100644 --- a/assets/voxygen/i18n/pt_BR/_root.ron +++ b/assets/voxygen/i18n/pt_BR/_root.ron @@ -27,6 +27,7 @@ scale_ratio: 1.0, ), }, + sub_directories: [], string_map: { /// Start Common section // Texts used in multiple locations with the same formatting diff --git a/assets/voxygen/i18n/pt_PT/_root.ron b/assets/voxygen/i18n/pt_PT/_root.ron index 87bd22bcc7..7aa830fd9b 100644 --- a/assets/voxygen/i18n/pt_PT/_root.ron +++ b/assets/voxygen/i18n/pt_PT/_root.ron @@ -27,6 +27,7 @@ scale_ratio: 1.0, ), }, + sub_directories: [], string_map: { /// Start Common section // Texts used in multiple locations with the same formatting diff --git a/assets/voxygen/i18n/ru_RU/_root.ron b/assets/voxygen/i18n/ru_RU/_root.ron index a663e12cf9..1931b3bdc6 100644 --- a/assets/voxygen/i18n/ru_RU/_root.ron +++ b/assets/voxygen/i18n/ru_RU/_root.ron @@ -41,6 +41,7 @@ scale_ratio: 1.0, ), }, + sub_directories: [], string_map: { /// Start Common section // Texts used in multiple locations with the same formatting diff --git a/assets/voxygen/i18n/sv/_root.ron b/assets/voxygen/i18n/sv/_root.ron index 45071db229..f7ab658926 100644 --- a/assets/voxygen/i18n/sv/_root.ron +++ b/assets/voxygen/i18n/sv/_root.ron @@ -40,6 +40,7 @@ scale_ratio: 1.0, ), }, + sub_directories: [], string_map: { /// Start Common section diff --git a/assets/voxygen/i18n/tr_TR/_root.ron b/assets/voxygen/i18n/tr_TR/_root.ron index 522b9c2ab1..1ede09e42c 100644 --- a/assets/voxygen/i18n/tr_TR/_root.ron +++ b/assets/voxygen/i18n/tr_TR/_root.ron @@ -41,6 +41,7 @@ scale_ratio: 1.0, ), }, + sub_directories: [], string_map: { /// Start Common section // Texts used in multiple locations with the same formatting diff --git a/assets/voxygen/i18n/uk_UA/_root.ron b/assets/voxygen/i18n/uk_UA/_root.ron index d5106cbef7..8bcadaf3ce 100644 --- a/assets/voxygen/i18n/uk_UA/_root.ron +++ b/assets/voxygen/i18n/uk_UA/_root.ron @@ -41,6 +41,7 @@ scale_ratio: 1.0, ), }, + sub_directories: [], string_map: { /// Start Common section // Texts used in multiple locations with the same formatting diff --git a/assets/voxygen/i18n/zh_CN/_root.ron b/assets/voxygen/i18n/zh_CN/_root.ron index 9273541188..b0ae3c75f4 100644 --- a/assets/voxygen/i18n/zh_CN/_root.ron +++ b/assets/voxygen/i18n/zh_CN/_root.ron @@ -41,6 +41,7 @@ scale_ratio: 0.75, ), }, + sub_directories: [], string_map: { /// Start Common section // Texts used in multiple locations with the same formatting diff --git a/assets/voxygen/i18n/zh_TW/_root.ron b/assets/voxygen/i18n/zh_TW/_root.ron index 493e6bf423..45b8d3d95a 100644 --- a/assets/voxygen/i18n/zh_TW/_root.ron +++ b/assets/voxygen/i18n/zh_TW/_root.ron @@ -27,6 +27,7 @@ scale_ratio: 0.75, ), }, + sub_directories: [], string_map: { /// Start Common section // Texts used in multiple locations with the same formatting diff --git a/voxygen/src/i18n.rs b/voxygen/src/i18n.rs index 3ce211ac8b..92c1f169b5 100644 --- a/voxygen/src/i18n.rs +++ b/voxygen/src/i18n.rs @@ -242,11 +242,19 @@ pub fn init_localization_expect(asset_key: &str) -> Localization { /// Load all the available languages located in the voxygen asset directory pub fn list_localizations() -> Vec<LanguageMetadata> { - assets::load_dir::<Localization>("voxygen.i18n") - .unwrap() - .iter_all() - .filter_map(|(_, lang)| lang.ok().map(|e| e.read().metadata.clone())) - .collect() + let mut languages = vec![]; + // list language directories + for l18n_directory in std::fs::read_dir("assets/voxygen/i18n").unwrap() { + if let Ok(l18n_entry) = l18n_directory { + if let Some(l18n_key) = l18n_entry.file_name().to_str() { + // load the root file of all the subdirectories + if let Ok(localization) = Localization::load(&("voxygen.i18n.".to_string() + l18n_key + "._root")) { + languages.push(localization.read().metadata.clone()); + } + } + } + } + languages } /// Return the asset associated with the language_id