-
-
Notifications
You must be signed in to change notification settings - Fork 34
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
"İ" doesn't change to "I" when the language is changed #78
Comments
Wow… that seems like a bug, but not sure what exactly could cause this behavior..🤔 |
Btw could you please provide some repro? Just to see your use case.. |
Ok, in your change locale process, you need to change your html lang attribute first to render your
After your lang attribute is present, you can set the sveltekit-i18n locale using |
I am using the same code used in Thank you very much for taking your time and providing your solution. And your library is really helping me a lot. But I don't understand how can I make Is there a way to update |
As far as I know Svelte currently does not have any automated way how to change the document.querySelector('html').setAttribute('lang', YOUR_LOCALE) currently, it’s not implemented in the examples so that’s why it currently does not work in the |
Ok, for now, you could use this (bit hacky) solution: <script>
const handleLocaleChange = async ({ currentTarget = {} }) => {
const {value} = currentTarget;
document.querySelector('html').setAttribute('lang', value);
// Don't ask me why this works and tick() not...
await new Promise((res) => setTimeout(res, 0));
locale.set(value);
}
</script>
<select on:change={handleLocaleChange}>
<option value="en">English</option>
<option value="az">Azerbaijani</option>
</select> I'll implement auto change mechanism for html |
"i" and "ı" are two different letters in most Turkic languages.
Capital form of "i" is "İ" and "ı" is "I".
When I use uppercase form of string (by using CSS:
text-transform: uppercase;
), they don't change according to language standard. My browser is the latest version of Chrome. I don't define custom font, I use system default font.For example:
<div style="text-transform: uppercase">This is my text</div>
If the language is English when I first load the page:
Output: THIS IS MY TEXT
This is as expected.
When I change language to Azerbaijani:
Output: THIS IS MY TEXT
But it should be: THİS İS MY TEXT
Testing vice-versa:
If the language is Azerbaijani when I first load the page:
Output: THİS İS MY TEXT
This is as expected.
When I change language to English:
Output: THİS İS MY TEXT
But it should be: THIS IS MY TEXT
This ambiguity occur only when I use
text-transform: uppercase;
. I don't get this problem if I type uppercased letters by hand. But I can't use this method in each page (project requirements). How can I solve this issue?I don't really know if this is related to the
sveltekit-i18n
or not. I am sorry if I am in a wrong place for this issue :)The text was updated successfully, but these errors were encountered: