From 8c9fc952d8eb309e8fcfd01099eaf40f1da890e2 Mon Sep 17 00:00:00 2001 From: hishamco Date: Sun, 6 Dec 2020 19:28:12 +0300 Subject: [PATCH 1/4] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5a7477a6..c8cfec4e 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ There is a separate [Documentation repository](https://github.com/oqtane/oqtane. This project is a work in progress and the schedule for implementing enhancements is dependent upon the availability of community members who are willing/able to assist. V.2.1.0 ( Q1 2021 ) -- [ ] Complete Static Localization of Admin UI +- [x] Complete Static Localization of Admin UI - [ ] Cross Platform Database Support ( ie. SQLite ) - [ ] EF Core Migrations for Database Installation/Upgrade From f05b955c340476eff01ced1af7e1d6befc4c0614 Mon Sep 17 00:00:00 2001 From: hishamco Date: Mon, 28 Dec 2020 18:15:28 +0300 Subject: [PATCH 2/4] Show LanguageSwitcher if more than one culture --- Oqtane.Client/Themes/Controls/ControlPanel.razor | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Oqtane.Client/Themes/Controls/ControlPanel.razor b/Oqtane.Client/Themes/Controls/ControlPanel.razor index 931f3ff3..8018be30 100644 --- a/Oqtane.Client/Themes/Controls/ControlPanel.razor +++ b/Oqtane.Client/Themes/Controls/ControlPanel.razor @@ -10,6 +10,7 @@ @inject ILogService logger @inject ISettingService SettingService @inject IStringLocalizer Localizer +@inject ILocalizationService LocalizationService @if (_moduleDefinitions != null && UserSecurity.IsAuthorized(PageState.User, PermissionNames.Edit, PageState.Page.Permissions)) { @@ -317,6 +318,12 @@ _allModuleDefinitions = await ModuleDefinitionService.GetModuleDefinitionsAsync(PageState.Site.SiteId); _moduleDefinitions = _allModuleDefinitions.Where(item => item.Categories.Contains(Category)).ToList(); _categories = _allModuleDefinitions.SelectMany(m => m.Categories.Split(',')).Distinct().ToList(); + + var cultures = await LocalizationService.GetCulturesAsync(); + if (cultures.Count() < 2) + { + ShowLanguageSwitcher = false; + } } } From 56e86edf9f71162113724b15bc36cf6f8192e376 Mon Sep 17 00:00:00 2001 From: hishamco Date: Mon, 28 Dec 2020 19:59:58 +0300 Subject: [PATCH 3/4] Address feedback --- Oqtane.Client/Themes/Controls/ControlPanel.razor | 7 ------- Oqtane.Client/Themes/Controls/LanguageSwitcher.razor | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/Oqtane.Client/Themes/Controls/ControlPanel.razor b/Oqtane.Client/Themes/Controls/ControlPanel.razor index 8018be30..931f3ff3 100644 --- a/Oqtane.Client/Themes/Controls/ControlPanel.razor +++ b/Oqtane.Client/Themes/Controls/ControlPanel.razor @@ -10,7 +10,6 @@ @inject ILogService logger @inject ISettingService SettingService @inject IStringLocalizer Localizer -@inject ILocalizationService LocalizationService @if (_moduleDefinitions != null && UserSecurity.IsAuthorized(PageState.User, PermissionNames.Edit, PageState.Page.Permissions)) { @@ -318,12 +317,6 @@ _allModuleDefinitions = await ModuleDefinitionService.GetModuleDefinitionsAsync(PageState.Site.SiteId); _moduleDefinitions = _allModuleDefinitions.Where(item => item.Categories.Contains(Category)).ToList(); _categories = _allModuleDefinitions.SelectMany(m => m.Categories.Split(',')).Distinct().ToList(); - - var cultures = await LocalizationService.GetCulturesAsync(); - if (cultures.Count() < 2) - { - ShowLanguageSwitcher = false; - } } } diff --git a/Oqtane.Client/Themes/Controls/LanguageSwitcher.razor b/Oqtane.Client/Themes/Controls/LanguageSwitcher.razor index 4dca37bc..16391513 100644 --- a/Oqtane.Client/Themes/Controls/LanguageSwitcher.razor +++ b/Oqtane.Client/Themes/Controls/LanguageSwitcher.razor @@ -6,7 +6,7 @@ @inject ILocalizationService LocalizationService @inject NavigationManager NavigationManager -@if (_supportedCultures != null) +@if (_supportedCultures?.Count() > 1) {