Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Full locale support for prototype pages #711

Open
rickychilcott opened this issue Feb 4, 2023 · 2 comments
Open

Full locale support for prototype pages #711

rickychilcott opened this issue Feb 4, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@rickychilcott
Copy link
Contributor

Multi locales are not supported in prototype pages

Bridgetown Version:
1.2

To Reproduce
Generate a prototype page using the standard docs.

---
layout: default
title: Posts in category :prototype-term
prototype:
  collection: posts
  term: category
---

and save it as categories/category.multi.html. it only generates in the default locale.

If you set permalink:

---
layout: default
title: Posts in category :prototype-term
prototype:
  collection: posts
  term: category
permalink: /:locale/blog/categories/:term
---
...

It appears to get confused and only generates the default locale related content (i.e. en) to the path "/locale/categories/term1", "/locale/categories/term2". Note: I'm saying it actually goes to the "locale" folder not "en". So the /:locale/... gets translated to /locale/...

Expected behavior

Each locale is generated when the multi extension is used.

**Computing environment **

  • OS: Mac OS X 13.1
  • Browser Brave
  • Browser Version v1.47.186 (latest)
  • Ruby Version 3.2

Additional context
I'm able to work around it by, generating a file a prototype file for each locale. One example:

Filename: `src/category.en-AU.erb"

---
layout: default
title: Posts in category :prototype-term
permalink: /en-AU/blog/categories/:term
prototype:
  collection: posts
  term: tag
---
...
@rickychilcott rickychilcott added the bug Something isn't working label Feb 4, 2023
@jaredcwhite jaredcwhite added this to the 1.3 milestone Feb 8, 2023
@jaredcwhite jaredcwhite removed this from the 1.3 milestone Jun 6, 2023
@simonc
Copy link

simonc commented Jun 21, 2023

Hi there. On a related note I seem to be experiencing the same issue when listing paginated posts.

I tried defining _pages/blog.multi.liquid and locale-specific pages as _pages/blog.{en,fr}.liquid.

The posts are properly filtered by locale but the rest of the UI is printed in the default locale.

@matiasmasca
Copy link

matiasmasca commented Jan 22, 2024

I have similar problems on v1.3 =( seems the "site.locale" doesn't change. If I print:
" #{site.locale} #{page.data.locale}"
I got:
es en

my site is 'es' by default, by I'm in a /en/... url

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants