1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#![allow(missing_docs)]
#![cfg_attr(rustfmt, rustfmt_skip)]
#[cfg(feature = "isolang")]
extern crate isolang;
pub mod belarusian;
pub mod chinese;
pub mod english;
pub mod german;
pub mod japanese;
pub mod polish;
pub mod portuguese;
pub mod romanian;
pub mod russian;
pub mod swedish;
pub mod turkish;
pub mod french;
pub mod spanish;
pub mod danish;
pub mod italian;
pub mod ukrainian;
pub fn boxup<L: super::Language + Send + Sync + 'static>(x: L) -> super::BoxedLanguage {
Box::new(x) as super::BoxedLanguage
}
#[cfg(feature = "isolang")]
pub use self::isolang::Language as IsolangLanguage;
#[cfg(feature = "isolang")]
pub fn from_isolang(x: isolang::Language) -> Option<super::BoxedLanguage> {
Some(match x {
x if x.to_name() == "English" => boxup(english::English),
x if x.to_name() == "Chinese" => boxup(chinese::Chinese),
x if x.to_name() == "Japanese" => boxup(japanese::Japanese),
x if x.to_name() == "Russian" => boxup(russian::Russian),
x if x.to_name() == "German" => boxup(german::German),
x if x.to_name() == "Belarusian" => boxup(belarusian::Belarusian),
x if x.to_name() == "Polish" => boxup(polish::Polish),
x if x.to_name() == "Swedish" => boxup(swedish::Swedish),
x if x.to_name() == "Romanian" => boxup(romanian::Romanian),
x if x.to_name() == "Turkish" => boxup(turkish::Turkish),
x if x.to_name() == "French" => boxup(french::French),
x if x.to_name() == "Spanish" => boxup(spanish::Spanish),
x if x.to_name() == "Danish" => boxup(danish::Danish),
x if x.to_name() == "Portuguese" => boxup(portuguese::Portuguese),
x if x.to_name() == "Italian" => boxup(italian::Italian),
x if x.to_name() == "Ukrainian" => boxup(ukrainian::Ukrainian),
_ => return None,
})
}