diff --git a/Helper/TranslationHelper.cs b/Helper/TranslationHelper.cs index cbc8ed4..0933fb3 100644 --- a/Helper/TranslationHelper.cs +++ b/Helper/TranslationHelper.cs @@ -34,6 +34,7 @@ namespace CarCareTracker.Helper //create entry translationDictionary.Add(translationKey, text); File.WriteAllText(translationFilePath, JsonSerializer.Serialize(translationDictionary)); + return text; } } return create ? string.Empty : text; diff --git a/Views/Vehicle/_GasModal.cshtml b/Views/Vehicle/_GasModal.cshtml index 8d5049a..91fa8c2 100644 --- a/Views/Vehicle/_GasModal.cshtml +++ b/Views/Vehicle/_GasModal.cshtml @@ -1,9 +1,12 @@ @using CarCareTracker.Helper @inject IConfigHelper config +@inject ITranslationHelper translator @model GasRecordInputContainer @{ - var useMPG = config.GetUserConfig(User).UseMPG; - var useUKMPG = config.GetUserConfig(User).UseUKMPG; + var userConfig = config.GetUserConfig(User); + var useMPG = userConfig.UseMPG; + var useUKMPG = userConfig.UseUKMPG; + var userLanguage = userConfig.UserLanguage; var useKwh = Model.UseKwh; var useHours = Model.UseHours; var isNew = Model.GasRecord.Id == 0; @@ -34,7 +37,7 @@ } }