Replies: 1 comment 3 replies
-
That's an interesting question! Yep, I think the majority of apps/sites pick one tone, but I did see one app so far where this kind of personalization is possible. There, the chosen approach was to create separate messages for the formal and informal tone, providing a maximum of flexibility for messages without having to branch a lot in messages. You could use a locale with a private extension to encode the tone (e.g. The other option would be to handle the tone for each message individually, like you did in the example above. Do you have an estimate about how many messages are affected? I.e. are messages generally personalized / refer to the user? If so, maybe a separate locale could be a good choice. What do you think? |
Beta Was this translation helpful? Give feedback.
-
First of all, thanks for the amazing package.
I am here seeking for best practices for the German language. As you might know, we have formal and informal tone.
I was about to do following (many times):
And on initialization we get info whether or not we should use the ‘formal’ or ‘informal’
tone
.And include the same with the client context.
Like this, I don’t have to bother to add the
tone
wherever it is being used in the translations. It’s just there if I need it.Now in the docs, this approach is deprecated (and will be removed in the next major version) in favor of using
RichText
. I find it not trivial without adding theRichText
wherever we use anyt(…)
translation key and the app will be a bit bloated.Anyone has some recommendations on how to best approach that use case?
Appreciate your time!
Beta Was this translation helpful? Give feedback.
All reactions