Skip to content

Replace hardcoded English strings with localization keys in menu components#10441

Open
Higamato wants to merge 4 commits intoFacepunch:masterfrom
Higamato:master
Open

Replace hardcoded English strings with localization keys in menu components#10441
Higamato wants to merge 4 commits intoFacepunch:masterfrom
Higamato:master

Conversation

@Higamato
Copy link
Copy Markdown

@Higamato Higamato commented Apr 10, 2026

Summary

Replace hardcoded English strings with localization keys (#menu.*) across 7 razor files in Components/New/. Added 11 new keys to en/menu.json with Turkish translations in tr/menu.json, and restructured the Turkish translation file to match the English key ordering.

Motivation & Context

Several UI strings in the menu components (Navbar hover menu, GameCard, AchievementDeck, LiveLobbies, LiveLobbyCard, News) were hardcoded in English, making them untranslatable for non-English users. This PR extends the existing #menu.* localization pattern already used in Navbar to cover all remaining user-facing strings in the Components/New/ directory.

Fixes:

Implementation Details

  • Used the existing #key prefix localization system (resolved by Label.csLanguage.GetPhrase())
  • Strings in razor markup use #menu.* directly as text content or attribute values
  • Strings in @code blocks (e.g. GameCard.VotePercentage(), LiveLobbyCard.OpenContextMenu()) also use #menu.* — these work because the values are passed to Label/Button components that handle the # prefix resolution
  • menu.achievements.of is translated as / in Turkish since "3 of 10" reads more naturally as "3 / 10" in Turkish UI context
  • tr/menu.json was restructured to match en/menu.json key ordering for easier maintenance

Screenshots / Videos (if applicable)

N/A

Checklist

  • Code follows existing style and conventions
  • No unnecessary formatting or unrelated changes
  • Public APIs are documented (if applicable)
  • Unit tests added where applicable and all passing
  • I'm okay with this PR being rejected or requested to change 🙂

Higamato and others added 4 commits April 11, 2026 01:30
…onents

Extracted 15 hardcoded UI strings from 7 razor files under
Components/New/ and replaced them with #menu.* localization keys.

Updated files:
- Navbar: hover menu items (Discover, Favourites, Search)
- GameCard: "Invalid Package", "Unrated", package not found message
- AchievementDeck/Summary: empty state message, "of" separator
- LiveLobbies: "Quick Join" label
- LiveLobbyCard: context menu options (Join Game, View Game Details, etc.)
- News: "Latest Update" label, loading placeholders

Added 11 new keys to en/menu.json and provided Turkish translations
in tr/menu.json. Also restructured tr/menu.json to match en/menu.json
key ordering.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant