Skip to content

Commit

Permalink
Merge cc378ec into ac161c2
Browse files Browse the repository at this point in the history
  • Loading branch information
yjmrobert authored Oct 5, 2023
2 parents ac161c2 + cc378ec commit 78fe352
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,17 @@

private static string Language => Thread.CurrentThread.CurrentCulture.Name.ToLower().Contains("fr") ? "en-CA" : "fr-CA";
private static string LanguageDisplay => Thread.CurrentThread.CurrentCulture.Name.ToLower().Contains("fr") ? "English" : "Français";

private static List<string> UnauthenticatedPages = new() { "/login", "/register", "/terms-and-conditions", "account-setup" };

private async void ChangeLanguage(string language)
{
// if in register page, user still needs to be able to translate languages
// if in an unauthenticated page, user still needs to be able to translate languages
var currentPage = NavManager.Uri;
if (currentPage.Contains(@"/register") || currentPage.Contains(@"/terms-and-conditions")){
_userInformationService.SetLanguage(language);
if (UnauthenticatedPages.Any(x => currentPage.Contains(x)))
{
await _localStorage.SetItemAsStringAsync("language", language);
_userInformationService.SetLanguage(language);
} else {
await _userInformationService.RegisterUserLanguage(language);
await _telemetryService.LogTelemetryEvent(TelemetryEvents.UserToggleCulture);
Expand Down
2 changes: 1 addition & 1 deletion Portal/src/Datahub.Portal/Datahub.Portal.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<Version>2.11.1</Version>
<Version>2.13.1</Version>
<TargetFramework>net7.0</TargetFramework>
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
Expand Down
10 changes: 5 additions & 5 deletions Portal/src/Datahub.Portal/Pages/Public/RegisterPage.razor
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
<MudStack>
<MudForm @ref="@_form" @bind-IsValid="@_success" @bind-Errors="@_errors">
<MudStack>
<MudText>
@Localizer["Register for the Federal Science DataHub"]
</MudText>

<MudTextField T="string"
Label=@Localizer["Government of Canada Email"]
@bind-Value="_email"
Expand All @@ -42,7 +38,7 @@
<MudLink Href="/terms-and-conditions" Typo="Typo.body2">
@Localizer["Terms and conditions"]
</MudLink>
@Localizer[" of use for the FSDH Proof-of-Concept Phase 2"]
@Localizer[" of use for the FSDH Trial"]
</MudText>

</MudCheckBox>
Expand All @@ -66,6 +62,10 @@
@Localizer["Already registered?"]
<MudLink Typo="Typo.body2" Href="/login">@Localizer["Login instead"]</MudLink>
</MudText>
<MudText Typo="Typo.body2" Align="Align.Center">
<MudLink Typo="Typo.body2" Target="_blank" Href="/account-setup">@Localizer["Click here for detailed instructions"]</MudLink>
@Localizer["on setting up your account."]
</MudText>
</MudStack>
</PublicLandingDescription>

Expand Down
5 changes: 4 additions & 1 deletion Portal/src/Datahub.Portal/i18n/localization.fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -1804,5 +1804,8 @@
"Announcements": "Annonces",
"Workspaces": "Espaces de travail",
"Resource request has been successfully submitted": "La demande de ressource a été soumise avec succès",
"Resource request has failed, please contact an administrator": "La demande de ressource a échoué, veuillez contacter un administrateur"
"Resource request has failed, please contact an administrator": "La demande de ressource a échoué, veuillez contacter un administrateur",
"on setting up your account.": "sur la configuration de votre compte.",
"Click here for detailed instructions": "Cliquez ici pour des instructions détaillées",
" of use for the FSDH Trial": " d'utilisation pour l'essai FSDH"
}

0 comments on commit 78fe352

Please sign in to comment.