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
#![allow(missing_docs)]
#[cfg(feature="isolang")]
extern crate isolang;
pub mod english;
pub mod russian;
pub mod belarusian;
pub mod german;
pub mod polish;
pub fn boxup<L: super::Language + 'static> (x:L) -> Box<super::Language> {
Box::new(x) as Box<super::Language>
}
#[cfg(feature="isolang")]
pub use self::isolang::Language as IsolangLanguage;
#[cfg(feature="isolang")]
pub fn from_isolang(x : isolang::Language) -> Option<Box<super::Language>> {
Some(match x {
x if x.to_name() == "English" => boxup(english::English),
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),
_ => return None,
})
}