Summary
Role display names (Leader, Officer, Member) are currently loaded from server.json config via FactionsConfig.getRoleDisplayName() as static strings. This means they cannot be translated per-player based on their language preference.
Current behavior
server.json:
"roles": {
"LEADER": { "displayName": "Leader" },
"OFFICER": { "displayName": "Officer" },
"MEMBER": { "displayName": "Member" }
}
ConfigManager.getRoleDisplayName(role) returns a single string regardless of the viewer's language. This affects the members list GUI, player info page, promote/demote messages, and anywhere else getRoleDisplayName() is called.
Expected behavior
Role display names should go through the .lang i18n system (e.g. role.leader, role.officer, role.member keys) so they are resolved per-player locale, just like all other user-facing strings.
Example pl-PL/hyperfactions.lang:
role.leader = Przywodca
role.officer = Oficer
role.member = Czlonek
en-US/hyperfactions.lang:
role.leader = Leader
role.officer = Officer
role.member = Member
Context
We run a Polish/English bilingual server with usePlayerLanguage: true. All HyperFactions messages respect player locale, except role names which are hardcoded from config. Setting displayName to Polish in config means English-speaking players see Polish role names, and vice versa.
Additional note
The faction_info.ui layout has #LeaderLabel with Anchor: (Width: 65) which is too narrow for longer translations like Polish Przywodca: (10 chars vs English Leader: 7 chars), causing the label to overlap with the player name. This should also be adjusted (or made dynamic) when adding i18n support for role names.
Summary
Role display names (
Leader,Officer,Member) are currently loaded fromserver.jsonconfig viaFactionsConfig.getRoleDisplayName()as static strings. This means they cannot be translated per-player based on their language preference.Current behavior
server.json:ConfigManager.getRoleDisplayName(role)returns a single string regardless of the viewer's language. This affects the members list GUI, player info page, promote/demote messages, and anywhere elsegetRoleDisplayName()is called.Expected behavior
Role display names should go through the
.langi18n system (e.g.role.leader,role.officer,role.memberkeys) so they are resolved per-player locale, just like all other user-facing strings.Example
pl-PL/hyperfactions.lang:en-US/hyperfactions.lang:Context
We run a Polish/English bilingual server with
usePlayerLanguage: true. All HyperFactions messages respect player locale, except role names which are hardcoded from config. SettingdisplayNameto Polish in config means English-speaking players see Polish role names, and vice versa.Additional note
The
faction_info.uilayout has#LeaderLabelwithAnchor: (Width: 65)which is too narrow for longer translations like PolishPrzywodca:(10 chars vs EnglishLeader:7 chars), causing the label to overlap with the player name. This should also be adjusted (or made dynamic) when adding i18n support for role names.