use std::fs;
pub fn transform(input: String) -> Result<Vec<langcodec::Resource>, String> {
let content =
fs::read_to_string(&input).map_err(|e| format!("Error reading file {}: {}", input, e))?;
let resources: Vec<langcodec::Resource> = serde_json::from_str(&content)
.map_err(|e| format!("Error parsing JSON as Resource array: {}", e))?;
if resources.is_empty() {
return Err("Resource array is empty".to_string());
}
Ok(resources)
}