Closed vtexier closed 2 years ago
In the RUST-crate I see support for several languages (including French) and to retrieve it by a language-code string, so that would be possible:
pub fn from_language_code(language_code: &str) -> Option<Self> {
match &language_code.to_ascii_lowercase()[..] {
"en" => Some(Language::English),
#[cfg(feature = "chinese-simplified")]
"zh-hans" => Some(Language::ChineseSimplified),
#[cfg(feature = "chinese-traditional")]
"zh-hant" => Some(Language::ChineseTraditional),
#[cfg(feature = "french")]
"fr" => Some(Language::French),
#[cfg(feature = "italian")]
"it" => Some(Language::Italian),
#[cfg(feature = "japanese")]
"ja" => Some(Language::Japanese),
#[cfg(feature = "korean")]
"ko" => Some(Language::Korean),
#[cfg(feature = "spanish")]
"es" => Some(Language::Spanish),
_ => None,
}
}
I'll look into it later this week, shouldn't be too much effort.
The library does only handle english mnemonic. When I supply a valid 128bits Bip39 french mnemonic of 12 words, the function
bip39_to_mini_secret
fails with "Invalid mnemonic".Because it is hard coded with english:
Could it be possible to handle multi-language, adding an optional language argument with
Language::English
default to all functions?