Skip to content

feat: centralize supported locales and rebuild .htaccess with @locale#738

Merged
darcywong00 merged 3 commits into
stagingfrom
feat/rewrite-available-locales
May 14, 2026
Merged

feat: centralize supported locales and rebuild .htaccess with @locale#738
darcywong00 merged 3 commits into
stagingfrom
feat/rewrite-available-locales

Conversation

@mcdurdin
Copy link
Copy Markdown
Member

Add locales.json with the list of available locales and language names, update Locale.php to read that, and build a preprocess stage for .htaccess to leverage that single source of truth for supported locales.

Test-bot: skip

Add locales.json with the list of available locales and language names,
update Locale.php to read that, and build a preprocess stage for
.htaccess to leverage that single source of truth for supported locales.

Test-bot: skip
@keymanapp-test-bot
Copy link
Copy Markdown

User Test Results

Test specification and instructions

User tests are not required

@keymanapp-test-bot keymanapp-test-bot Bot added this to the A19S29 milestone May 13, 2026
@mcdurdin mcdurdin requested a review from darcywong00 May 13, 2026 08:56
@github-actions github-actions Bot added the feat label May 13, 2026
Copy link
Copy Markdown
Contributor

@darcywong00 darcywong00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Comment thread build.sh
builder_run_action start do_start

builder_run_action test test_docker_container
builder_run_action htaccess preprocess_htaccess
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it matter that there's 3 builder actions that preprocess_htaccess?

  • configure
  • start
  • htaccess

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's deliberate -- it's safe to rerun. configure is needed for live sites; start is to ensure it happens when we start the site without a rebuild; htaccess is a convenience to rebuild without having to stop/start the site.

Comment thread .htaccess.in
# [NC] for case-insensitive
# Long regex for "BCP-47" codes = $1, rest of URL $2 onward
#
# @locales for BCP-47" codes = $1, rest of URL $2 onward
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this @locales get replaced in the regex? It's just a comment...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, but it doesn't hurt!

@mcdurdin
Copy link
Copy Markdown
Member Author

We could prepend a # DO NOT EDIT THIS FILE -- EDIT .htaccess.in message when building .htaccess I guess?

@darcywong00
Copy link
Copy Markdown
Contributor

We could prepend a # DO NOT EDIT THIS FILE -- EDIT .htaccess.in message when building .htaccess I guess?

Sounds good. I tacked that on in cbe5a71

@darcywong00
Copy link
Copy Markdown
Contributor

I'm gonna go ahead and merge this to continue testing my other PRs

@darcywong00 darcywong00 merged commit b1b41da into staging May 14, 2026
5 checks passed
@darcywong00 darcywong00 deleted the feat/rewrite-available-locales branch May 14, 2026 00:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants