Open casungo opened 8 months ago
astro-i18next
have the Trans
component (inspired by i18next react I think): https://github.com/yassinedoghri/astro-i18next#trans-component. I don't like this API but I can definitely take inspiration
Chipping in that I think a nice thing about their Trans
component is that its similar API to react-i18next, so on a project with both react and astro components there is a consistent feel to the code that uses i18next. I agree its not the world's greatest approach though.
FWIW I try to avoid using words and links as much as possible inline prose because I find it can lead to some funny translations due to grammatical differences between languages, and automated translation tools I've found to be particularly bad at correctly lining up what should be a link vs. not.
For example, I would prefer to do something like label an element or list, and then simply put the link in that element or as a list item, so the translations have no interpolation.
I'd need to have a look at how it works more closely
Description: Currently, the i18n integration does not support adding links within translated strings. This feature would be very useful for cases where a translated phrase needs to include a link to external content.
For example, consider the following string: "Hi everyone, follow me on github, bye!" It would be great if the word "github" could be turned into a link pointing to the relevant GitHub profile or repository.
Adding support for links in translations would enhance the flexibility and usability of the i18n system. This would allow for more dynamic and interactive content within translated strings.
Possible implementation ideas:
[link text](url)
(URL)
for each translated string that contains a link<a>
tags with the correct href attributeI believe this feature would be a valuable addition to the i18n integration and would greatly benefit users who need to include links in their translated content. Please let me know if you need any further information or clarification. Thank you for considering this feature request!