pub fn add_language(&mut self, language: String) -> anyhow::Result<()> {
        if self.languages.contains(&language) {
            return Err(anyhow::Error::msg(format!(
                "The language `{}` already exists.",
                language
            )));
        }

        self.languages.push(language);
        Ok(())
    }
/// Add a new language to the languages list if it does not exist.
///
/// # Example
/// ```rust, ignore
/// use languages_rs::Config;
///
/// let mut config = Config::default().unwrap();
/// assert_eq!(config.get_languages(), Vec::<String>::new());
/// assert!(config.add_language(String::from("en")).is_ok());
/// assert_eq!(config.get_languages(), vec![String::from("en")]);
/// ```
Add a new language to the languages list if it does not exist.
Add a new language to the languages list if it does not exist .
pub fn add_language(&mut self, language: String) -> anyhow::Result<()> {
        if self.languages.contains(&language) {
            return Err(anyhow::Error::msg(format!(
                "The language `{}` already exists.",
                language
            )));
        }
        self.languages.push(language);
        Ok(())
    }
pub fn add_language ( & mut self , language : String ) -> anyhow :: Result < ( ) > { if self . languages . contains ( & language ) { return Err ( anyhow :: Error :: msg ( format ! ( " " language ) ) ) ; } self . languages . push ( language ) ; Ok ( ( ) ) }
Add a new language to the languages list if it does not exist.
Add a new language to the languages list if it does not exist .
&mut self
language
String
&mut self
language
String
example
```rust, ignore
use languages_rs::Config.

let mut config = Config::default().unwrap();
assert_eq!(config.get_languages(), Vec::::new());
assert!(config.add_language(String::from("en")).is_ok());
assert_eq!(config.get_languages(), vec![String::from("en")]);
```
` ` ` rust ignore use languages_rs :: Config . let mut config = Config :: default () . unwrap () ; assert_eq! ( config . get_languages () Vec :::: new () ) ; assert! ( config . add_language ( String :: from ( " en " )) . is_ok () ) ; assert_eq! ( config . get_languages () vec! [ String :: from ( " en " ) ] ) ; ` ` `