Skip to content

I18n/locales exploration#127

Draft
eelcoj wants to merge 1 commit intomainfrom
locale
Draft

I18n/locales exploration#127
eelcoj wants to merge 1 commit intomainfrom
locale

Conversation

@eelcoj
Copy link
Contributor

@eelcoj eelcoj commented Feb 5, 2026

This PR is to explore how to add i18n/locale to Perron. Since Perron is just Rails most of the i18n code can be used.

But how to structure the content files? Currently leaning towards app/content/:collection_name/:locale/*/*.* (another option would be app/content/:collection_name/*/*.:locale.md). The former logic is now added in this PR and could be shipped as-is.

Tentative implementation then looks like:

# config/routes.rb
scope "(:locale)", locale: /de/, defaults: { locale: :en } do
  resources :articles, path: "docs", module: :content, only: %w[index show]
end
# config/initializer/locale.rb
I18n.available_locales = [:en, :de]
I18n.default_locale = :en

Biggest unknown now is how to add these locale-based routes to the build step.

Closes: #128

eelcoj pushed a commit to Rails-Designer/perron-site that referenced this pull request Feb 5, 2026
@eelcoj eelcoj mentioned this pull request Feb 5, 2026
@eelcoj eelcoj added this to the V1 milestone Feb 18, 2026
@eelcoj eelcoj removed this from the V1 milestone Mar 18, 2026
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.

I18n/locale support

1 participant