Fix sorting labels (translated)

This commit is contained in:
Aurora Lahtela 2022-09-09 19:15:31 +03:00
parent f4aaa72f4c
commit 9654e4a8d3
3 changed files with 12 additions and 6 deletions

View File

@ -69,11 +69,14 @@ public enum HtmlLang implements Lang {
TITLE_LAST_7_DAYS("html.label.last7days", "Last 7 days"),
TITLE_LAST_30_DAYS("html.label.last30days", "Last 30 days"),
LABEL_UNIQUE_PLAYERS("html.label.uniquePlayers", "Unique Players"),
LABEL_UNIQUE_PLAYERS_7_DAYS("html.label.uniquePlayers7days", "Unique Players (7 days)"),
LABEL_NEW_PLAYERS("html.label.newPlayers", "New Players"),
LABEL_NEW_PLAYERS_7_DAYS("html.label.newPlayers7days", "New Players (7 days)"),
LABEL_REGULAR_PLAYERS("html.label.regularPlayers", "Regular Players"),
LABEL_TOTAL_PLAYERS("html.label.totalPlayers", "Total Players"),
TITLE_NETWORK_AS_NUMBERS("html.label.networkAsNumbers", "Network as Numbers"),
LABEL_PLAYERS_ONLINE("html.label.playersOnline", "Players Online"),
LABEL_PLAYERS_ONLINE_NOW("html.label.playersOnlineNow", "Players Online (Now)"),
LABEL_TOTAL_PLAYTIME("html.label.totalPlaytime", "Total Playtime"),
LABEL_PLAYTIME("html.label.playtime", "Playtime"),
LABEL_ACTIVE_PLAYTIME("html.label.activePlaytime", "Active Playtime"),
@ -94,6 +97,7 @@ public enum HtmlLang implements Lang {
TITLE_30_DAYS("html.label.thirtyDays", "30 days"),
TITLE_AS_NUMBERS("html.label.asNumbers", "as Numbers"),
LABEL_AVG_TPS("html.label.averageTps", "Average TPS"),
LABEL_AVG_TPS_7_DAYS("html.label.averageTps7days", "Average TPS (7 days)"),
LABEL_AVG_PLAYERS("html.label.averagePlayers", "Average Players"),
LABEL_CPU("html.label.cpu", "CPU"),
LABEL_CPU_USAGE("html.label.cpuUsage", "CPU Usage"),
@ -104,6 +108,7 @@ public enum HtmlLang implements Lang {
LABEL_AVG_ENTITIES("html.label.averageEntities", "Average Entities"),
LABEL_AVG_CHUNKS("html.label.averageChunks", "Average Chunks"),
LABEL_LOW_TPS("html.label.lowTpsSpikes", "Low TPS Spikes"),
LABEL_LOW_TPS_7_DAYS("html.label.lowTpsSpikes", "Low TPS Spikes (7 days)"),
LABEL_DOWNTIME("html.label.downtime", "Downtime"),
// Sessions tab #tab-sessions-overview
TITLE_RECENT_SESSIONS("html.label.recentSessions", "Recent Sessions"),
@ -245,6 +250,7 @@ public enum HtmlLang implements Lang {
LABEL_CURRENT_UPTIME("html.label.currentUptime", "Current Uptime"),
LABEL_TOTAL("html.label.total", "Total"),
LABEL_ALPHABETICAL("html.label.alphabetical", "Alphabetical"),
LABEL_SORT_BY("html.label.sortBy", "Sort By"),
LOGIN_LOGIN("html.login.login", "Login"),
LOGIN_LOGOUT("html.login.logout", "Logout"),

View File

@ -44,7 +44,7 @@ const SortDropDown = ({sortBy, sortReversed, setSortBy}) => {
</DropdownToggle>
<DropdownMenu>
<h6 className="dropdown-header">Sort by</h6>
<h6 className="dropdown-header">{t('html.label.sortBy')}</h6>
{sortOptions.map((option, i) => (
<DropdownItem key={i} onClick={() => setSortBy(option)}>
{t(option)}

View File

@ -74,13 +74,13 @@ const sort = (servers, sortBy, sortReversed) => {
export const ServerSortOption = {
ALPHABETICAL: 'html.label.alphabetical',
AVERAGE_TPS: 'html.label.averageTps',
AVERAGE_TPS: 'html.label.averageTps7days',
// DOWNTIME: 'html.label.downtime',
LOW_TPS_SPIKES: 'html.label.lowTpsSpikes',
NEW_PLAYERS: 'html.label.newPlayers',
PLAYERS_ONLINE: 'html.label.playersOnline',
LOW_TPS_SPIKES: 'html.label.lowTpsSpikes7days',
NEW_PLAYERS: 'html.label.newPlayers7days',
PLAYERS_ONLINE: 'html.label.playersOnlineNow',
REGISTERED_PLAYERS: 'html.label.registeredPlayers',
UNIQUE_PLAYERS: 'html.label.uniquePlayers',
UNIQUE_PLAYERS: 'html.label.uniquePlayers7days',
}
const ServersTable = ({servers, onSelect, sortBy, sortReversed}) => {