diff --git a/components/templates/src/global_fns/files.rs b/components/templates/src/global_fns/files.rs index a57d5d6ecd..00ddaa2846 100644 --- a/components/templates/src/global_fns/files.rs +++ b/components/templates/src/global_fns/files.rs @@ -102,10 +102,10 @@ impl TeraFn for GetUrl { // anything else let mut segments = vec![]; - if lang != self.config.default_language { - if path.is_empty() || !path[1..].starts_with(&lang) { - segments.push(lang); - } + if lang != self.config.default_language + && (path.is_empty() || !path[1..].starts_with(&lang)) + { + segments.push(lang); } segments.push(path);