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

feat: i18n support #94

Closed
wants to merge 9 commits into from
Closed

feat: i18n support #94

wants to merge 9 commits into from

Conversation

MomentQYC
Copy link

@MomentQYC MomentQYC commented Mar 6, 2023

resolve #13
Initial implementation of i18n, the future will add the part of the user's independent choice of language.
I'm relatively new to js, so please point out any errors, thanks!

@MomentQYC MomentQYC changed the title feat: i18n support #13 feat: i18n support Mar 6, 2023
@lowercasename
Copy link
Owner

This is a superb feat, thank you so much so far! I'm hoping to have time to review this early this month.

@MomentQYC
Copy link
Author

When I create a new event, there is an error:
Database error, please try again :( - ValidationError: start: Cast to date failed for value "Moment" (type Moment) at path "start", end: Cast to date failed for value "Moment" (type Moment) at path "end"
I don't know if this is related to the code I changed (after all, I know very little about js).

@lowercasename
Copy link
Owner

There's currently an issue with this implementation where nested Handlebars expressions don't get rendered, so this i18n string:

"hostedBy": "Hosted by {{eventData.hostName}}",

Comes out as:

Hosted by

I think the easiest way to get around this is to separate the internal Handlebars expressions from the translation strings, since it seems quite complex to render nested Handlebars expressions.

@lowercasename
Copy link
Owner

lowercasename commented Mar 17, 2023

When I create a new event, there is an error: Database error, please try again :( - ValidationError: start: Cast to date failed for value "Moment" (type Moment) at path "start", end: Cast to date failed for value "Moment" (type Moment) at path "end" I don't know if this is related to the code I changed (after all, I know very little about js).

The issue here is that the event creation code expects the start and end date to be supplied in a very specific format, and that format only comes across as expected when the datepicker is set to the en locale.

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.

Localization support ?
2 participants