1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-08 06:08:20 -05:00

Using Humaniser instead of fixed string... (#335)

Update tooltip text generation in MetaRegistration

The tooltip text generation in MetaRegistration.cs is updated to use Humanizer's 'HumanizeForCurrentCulture' method with 'TimeUnit.Hour' as maxUnit. This change leverages the Humanizer library to provide more precise and localized time formatting.
This commit is contained in:
Amos 2024-07-24 18:52:02 +01:00 committed by GitHub
parent 5dca8717b9
commit 27a9a2eebf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7,6 +7,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Humanizer.Localisation;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using ILogger = Microsoft.Extensions.Logging.ILogger; using ILogger = Microsoft.Extensions.Logging.ILogger;
@ -118,7 +119,7 @@ namespace IW4MAdmin.Application.Meta
ClientId = client.ClientId, ClientId = client.ClientId,
Key = _transLookup["WEBFRONT_PROFILE_META_PLAY_TIME"], Key = _transLookup["WEBFRONT_PROFILE_META_PLAY_TIME"],
Value = friendlyTime.HumanizeForCurrentCulture(), Value = friendlyTime.HumanizeForCurrentCulture(),
ToolTipText = $"{friendlyTime.TotalHours:N1} hour(s)", ToolTipText = friendlyTime.HumanizeForCurrentCulture(maxUnit: TimeUnit.Hour),
ShouldDisplay = true, ShouldDisplay = true,
Order = 8, Order = 8,
Type = MetaType.Information Type = MetaType.Information