mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Update doc-strings
This commit is contained in:
parent
79cb7a5826
commit
8fd1037bf3
@ -99,9 +99,6 @@ pub struct LocalizationFragment {
|
|||||||
|
|
||||||
impl Language {
|
impl Language {
|
||||||
/// Get a localized text from the given key
|
/// Get a localized text from the given key
|
||||||
///
|
|
||||||
/// If the key is not present in the localization object
|
|
||||||
/// then the key is returned.
|
|
||||||
pub fn get<'a>(&'a self, key: &'a str) -> Option<&str> {
|
pub fn get<'a>(&'a self, key: &'a str) -> Option<&str> {
|
||||||
self.string_map.get(key).map(|s| s.as_str())
|
self.string_map.get(key).map(|s| s.as_str())
|
||||||
}
|
}
|
||||||
@ -242,6 +239,8 @@ pub type Localization = LocalizationGuard;
|
|||||||
impl LocalizationGuard {
|
impl LocalizationGuard {
|
||||||
/// Get a localized text from the given key
|
/// Get a localized text from the given key
|
||||||
///
|
///
|
||||||
|
/// First lookup is done in the active language, second in
|
||||||
|
/// the fallback (if present).
|
||||||
/// If the key is not present in the localization object
|
/// If the key is not present in the localization object
|
||||||
/// then the key is returned.
|
/// then the key is returned.
|
||||||
pub fn get<'a>(&'a self, key: &'a str) -> &str {
|
pub fn get<'a>(&'a self, key: &'a str) -> &str {
|
||||||
|
Loading…
Reference in New Issue
Block a user