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

fix(Last Saved): Translate the "last saved" relative date message #400

Merged
merged 2 commits into from
Nov 27, 2024

Conversation

ntoniazzi
Copy link
Contributor

In the top-navbar, the message indicating the date the diagram was last saved at is not translated. In English, we can see "Last saved 2 days ago". In Russian: "Последнее сохранение 2 days go".
I updated last-saved.tsx because it was straightforward, but it's not ideal because we have to maintain 2 locale lists: one here and the second in i18n.ts.

@johnnyfish johnnyfish requested a review from guyb1 November 14, 2024 13:22
@johnnyfish johnnyfish added the Translation Translate ChartDB label Nov 14, 2024
@ntoniazzi ntoniazzi force-pushed the translate-last-saved branch from 80b2b3d to c9b0add Compare November 19, 2024 13:58
@guyb1 guyb1 force-pushed the translate-last-saved branch from c9b0add to c1c40e2 Compare November 27, 2024 12:52
@guyb1
Copy link
Contributor

guyb1 commented Nov 27, 2024

Hi @ntoniazzi,

Thank you for your help with this! This was something that had been bugging me too 😂.

I agree that maintaining two locale lists isn’t ideal, but it works as a temporary solution until we refactor that area. For now, I’ve added some code to dynamically import based on the selected language to avoid increasing the bundle size.

Thanks again for your contribution - it’s much appreciated!

@guyb1 guyb1 changed the title Translate the "last saved" relative date message fix(i18n): Translate the "last saved" relative date message Nov 27, 2024
@guyb1 guyb1 changed the title fix(i18n): Translate the "last saved" relative date message fix(last saved): Translate the "last saved" relative date message Nov 27, 2024
@guyb1 guyb1 changed the title fix(last saved): Translate the "last saved" relative date message fix(Last Saved): Translate the "last saved" relative date message Nov 27, 2024
@guyb1 guyb1 merged commit d45677e into chartdb:main Nov 27, 2024
1 check passed
@guyb1 guyb1 mentioned this pull request Nov 26, 2024
guyb1 added a commit that referenced this pull request Nov 27, 2024
* Translate the "last saved" relative date message

* dynamic import locale base on the selected lang

---------

Co-authored-by: Guy Ben-Aharon <guybenah@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Translation Translate ChartDB
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants