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

API: Respect configured locale on single-lang site #2145

Merged
merged 3 commits into from Sep 30, 2019

Conversation

lukasbestle
Copy link
Member

@lukasbestle lukasbestle commented Sep 27, 2019

The $kirby->setCurrentLanguage() method not only sets the active language, but also the active PHP locale. It should be called for every API request, no matter if a language is specified or not.

The method will automatically fall back to the default language and its locale – or on single-lang sites to the configured locale option.


Forum thread: https://forum.getkirby.com/t/using-sortby-with-special-language-specific-characters/15781?u=lukasbestle

@lukasbestle lukasbestle added this to the 3.3.0 milestone Sep 27, 2019
@lukasbestle lukasbestle self-assigned this Sep 27, 2019
Copy link
Member

@bastianallgeier bastianallgeier left a comment

Choose a reason for hiding this comment

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

I think it would be good to have a single language and multi language test case for that.

The `$kirby->setCurrentLanguage()` method not only sets the active language, but also the active PHP locale. It should be called for every API request, no matter if a language is specified or not.

The method will automatically fall back to the default language and its locale – or on single-lang sites to the configured `locale` option.
@bastianallgeier bastianallgeier merged commit 86cc56c into develop Sep 30, 2019
@bastianallgeier bastianallgeier deleted the fix/api-configured-locale branch September 30, 2019 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 Is a bug; fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants