This commit is contained in:
2022-01-19 02:28:21 +01:00
parent c741df6b15
commit 33bf8f6448
2 changed files with 17 additions and 5 deletions
+3 -3
View File
@@ -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]`
}
}
}
@@ -62,14 +62,26 @@ public class ResourceService : IResourceService
Dictionary<string, string> CreateTranslationsForFile(string path, string culture)
{
Dictionary<string, string> 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))
{