Open pavish opened 3 weeks ago
I'm commenting to add some clarity because I was confused when I read the issue description.
Our component library doesn't currently import svelte-i18n
. So no changes needed there.
The problem is that our component library currently has some strings which are hard-coded in English. For example, in FileUpload.svelte
, we have:
<span>Uploaded {percentage}%</span>
and
<div class="title">Drag a file here</div>
I think what we need to do in this example is refactor that component to accept props for those strings, probably something like this:
export let i18nUploadedPercentage: (percentage: number) => string =
(percentage) => `Uploaded ${percentage}%`;
export let i18nDragAFileHere: string = 'Drag a file here';
There are only a very small handful of places like this in the component library, with FileUpload.svelte
being perhaps the most glaring example.
Description
The component library should not directly use svelte-i18n. We should handle the following: