diff --git a/zero.Backoffice.UI/vite.config.js b/zero.Backoffice.UI/vite.config.js index adfb1e04..960ec24c 100644 --- a/zero.Backoffice.UI/vite.config.js +++ b/zero.Backoffice.UI/vite.config.js @@ -106,9 +106,9 @@ let config = defineConfig({ rollupOptions: { output: { format: 'es', - entryFileNames: `[name].js`, - chunkFileNames: `[name].js`, - assetFileNames: `[name].[ext]` + entryFileNames: `[name].[hash].js`, + chunkFileNames: `[name].[hash].js`, + assetFileNames: `[name].[hash].[ext]` } } } diff --git a/zero.Backoffice/Services/Resources/ResourceService.cs b/zero.Backoffice/Services/Resources/ResourceService.cs index 08c4f315..908aaa01 100644 --- a/zero.Backoffice/Services/Resources/ResourceService.cs +++ b/zero.Backoffice/Services/Resources/ResourceService.cs @@ -62,14 +62,26 @@ public class ResourceService : IResourceService Dictionary CreateTranslationsForFile(string path, string culture) { Dictionary items = new(); - culture = culture.ToLower(); + culture = culture.Or("en-us").ToLower(); if (path.Contains("{lang}")) { path = path.Replace("{lang}", culture); } - string fullpath = Env.IsDevelopment() ? Path.Combine(AppContext.BaseDirectory, path) : ResourceFileSystem.Map(path); + string fullpath = Path.Combine(AppContext.BaseDirectory, path); + + if (!Env.IsDevelopment()) + { + try + { + fullpath = ResourceFileSystem.Map(path); + } + catch { } + } + + Logger.LogInformation("translation path [0]: " + Path.Combine(AppContext.BaseDirectory, path)); + Logger.LogInformation("translation path [1]: " + fullpath); if (!File.Exists(fullpath)) {