-
Notifications
You must be signed in to change notification settings - Fork 141
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
Adding Internationalization (i18n) support to Appwrite console. #451
Conversation
@goswamianshuman is attempting to deploy a commit to the appwrite Team on Vercel. A member of the Team first needs to authorize it. |
@TorstenDittmann @TGlide please have a look over this PR, the provided i18n is available in German and English. the main dashboard is not having any changes but you can have a look over the other files. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really nice start! Not sure if I missed it, is there any way to change the language within the console?
@@ -4,7 +4,8 @@ | |||
"node": ">=16" | |||
}, | |||
"scripts": { | |||
"dev": "vite dev", | |||
"dev": "vite", | |||
"vite": "vite dev", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, I was testing different libraries so I did the following changes. I'll make it back to the original.
src/routes/+layout.svelte
Outdated
{#if !$isLoading} | ||
<slot /> | ||
{:else if $loading} | ||
<Loading /> | ||
{/if} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{#if !$isLoading} | |
<slot /> | |
{:else if $loading} | |
<Loading /> | |
{/if} | |
{#if $isLoading || $loading} | |
<Loading /> | |
{/if} |
package.json
Outdated
@@ -30,6 +31,7 @@ | |||
"logrocket": "^3.0.1", | |||
"pretty-bytes": "^6.1.0", | |||
"prismjs": "^1.29.0", | |||
"svelte-i18n": "^3.6.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should discuss if this is the best library for the console. @TorstenDittmann has some features he'd like, and it also seems unmaintained.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree I would use i18next
directly without relying on the svelte version
src/routes/invite/+page.svelte
Outdated
@@ -40,28 +41,29 @@ | |||
</script> | |||
|
|||
<svelte:head> | |||
<title>Accept invite - Appwrite</title> | |||
<title>{$_('accept_invite.title')} - Appwrite</title> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity, does the $_
store have autocomplete?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity, does the
$_
store have autocomplete?
No, Here _ is a function that takes a string input. and this string is the path of data in the JSON.
Hey Thomas, I will be working on it today. 💪 |
package.json
Outdated
"pretty-bytes": "^6.1.0", | ||
"prismjs": "^1.29.0", | ||
"svelte-i18next": "^2.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remember to remove this one 👍
(I think we can remove npm-run-all
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I used it before while testing other libraries. All the unwanted libraries will be removed from package.json 🙂
// $: { | ||
// const getUserLanguage = window.navigator.language; | ||
// console.log(getUserLanguage); | ||
// } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, how is language initialized and changed in this implementation?
@@ -40,28 +41,29 @@ | |||
</script> | |||
|
|||
<svelte:head> | |||
<title>Accept invite - Appwrite</title> | |||
<title>{$_.t('accept_invite.title')} - Appwrite</title> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot, is this typesafe? E.g. if I pass in a string that doesn't exist, will the IDE (not the server) return an error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TGlide I think now we are working with pull request #459, so we have stopped working on this PR we can close this PR, but firstly we need to discuss it with @TorstenDittmann.
Hello, @TorstenDittmann I think we don't need this PR anymore already we have continued with #459 so I'm closing it for now we can open it again if we require to make any new changes to it.😀 |
What does this PR do?
Test Plan
Related PRs and Issues