Skip to content

Commit 621e528

Browse files
committed
Use correct language in constructing bundle
1 parent 4a3b291 commit 621e528

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/i18n.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ pub fn read_from_dir<P: AsRef<Path>>(dirname: P) -> io::Result<Vec<FluentResourc
161161
Ok(result)
162162
}
163163

164-
pub fn create_bundle(resources: &'static Vec<FluentResource>) -> FluentBundle<'static> {
165-
let mut bundle = FluentBundle::new(&["en-US"]);
164+
pub fn create_bundle(lang: &str, resources: &'static Vec<FluentResource>) -> FluentBundle<'static> {
165+
let mut bundle = FluentBundle::new(&[lang]);
166166

167167
for res in resources {
168168
bundle
@@ -189,7 +189,7 @@ fn build_resources() -> HashMap<String, Vec<FluentResource>> {
189189
fn build_bundles() -> HashMap<String, FluentBundle<'static>> {
190190
let mut bundles = HashMap::new();
191191
for (ref k, ref v) in &*RESOURCES {
192-
bundles.insert(k.to_string(), create_bundle(&v));
192+
bundles.insert(k.to_string(), create_bundle(&k, &v));
193193
}
194194
bundles
195195
}

0 commit comments

Comments
 (0)