Skip to content

Fix datepicker to only attempt to use existing locales, ensuring Time Picking still works#2539

Merged
I-Valchev merged 1 commit into4.1from
fix/datepicker-locales
Apr 21, 2021
Merged

Fix datepicker to only attempt to use existing locales, ensuring Time Picking still works#2539
I-Valchev merged 1 commit into4.1from
fix/datepicker-locales

Conversation

@bobdenotter
Copy link
Copy Markdown
Member

No description provided.

{# Ensure we use only locales bundled with Flatflicker, otherwise default to 'en' #}
{% set locale = app.user.locale|split('_')|first %}
{% if not locale in 'ar|at|az|be|bg|bn|bs|cs|cy|da|de|eo|es|et|fa|fi|fo|fr|ga|gr|he|hi|hr|hu|id|is|it|ja|ka|km|ko|kz|lt|lv|mk|mn|ms|my|nl|no|pa|pl|pt|ro|ru|si|sk|sl|sq|sr|sv|th|tr|uk|uz|vn|zh'|split('|') %}
{% set locale = 'en' %}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@bobdenotter is it an overkill to use the default locale, rather than en here? 🤔

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.

I hardcoded it, because if the default locale would be nl_NL, it'll still break in that case.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ah, good point! Agree!

Copy link
Copy Markdown
Member

@I-Valchev I-Valchev left a comment

Choose a reason for hiding this comment

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

👍

@I-Valchev I-Valchev merged commit 9665229 into 4.1 Apr 21, 2021
@I-Valchev I-Valchev deleted the fix/datepicker-locales branch April 21, 2021 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants