Framework for embedding localizations into Rust types
use std::path::{Path, PathBuf};

use crate::Localize;

use camino::{Utf8Path, Utf8PathBuf};
use icu_locale::Locale;

macro_rules! impl_std_path {
    ($path_type:ty) => {
        impl Localize for $path_type {
            fn localize_for(&self, _locale: &Locale) -> String {
                self.to_string_lossy().to_string()
            }
        }
    };
}

macro_rules! impl_camino_path {
    ($path_type:ty) => {
        impl Localize for $path_type {
            fn localize_for(&self, _locale: &Locale) -> String {
                self.to_string()
            }
        }
    };
}

impl_std_path!(PathBuf);
impl_std_path!(Path);

impl_camino_path!(Utf8PathBuf);
impl_camino_path!(Utf8Path);