Skip to content

[main.tpl] Translate Site List in main template#10467

Open
driusan wants to merge 1 commit intoaces:mainfrom
driusan:TranslateSiteListMain
Open

[main.tpl] Translate Site List in main template#10467
driusan wants to merge 1 commit intoaces:mainfrom
driusan:TranslateSiteListMain

Conversation

@driusan
Copy link
Copy Markdown
Collaborator

@driusan driusan commented Apr 24, 2026

Translate the site names in the main.tpl template based on the logged in user's locale.

There are multiple functions in the user class that get a list of sites.

  1. getSiteNames
  2. getSiteNamesList
  3. getSites

Option 1 was used to populate the site list in the main template. However, it can not be updated to be translated without breaking the API and making it user specific, as it's also used in the API.
Option 3 returns a site singleton, which can be used to get the site name with an array_map, so is the most powerful option. The middleware is updated to use that.
Option 2 did not have any references in the code, so it is deleted here as it's redundant.

Translate the site names in the main.tpl template based on the
logged in user's locale.
@github-actions github-actions Bot added the Language: PHP PR or issue that update PHP code label Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Language: PHP PR or issue that update PHP code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants