-
-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
Change translation strings of grouped notification label to have full context #31486
Merged
renchap
merged 13 commits into
mastodon:main
from
mgmn:dev/notification_v2-fulltext-i18n-label
Aug 21, 2024
Merged
Change translation strings of grouped notification label to have full context #31486
renchap
merged 13 commits into
mastodon:main
from
mgmn:dev/notification_v2-fulltext-i18n-label
Aug 21, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 with this change, providing translators with the full sentences rather than chunks is good practice and sometimes the only way of dealing with different sentence structures across languages.
app/javascript/mastodon/features/notifications_v2/components/notification_favourite.tsx
Outdated
Show resolved
Hide resolved
app/javascript/mastodon/features/notifications_v2/components/notification_reblog.tsx
Outdated
Show resolved
Hide resolved
This reverts commit c9dd090.
mgmn
force-pushed
the
dev/notification_v2-fulltext-i18n-label
branch
from
August 20, 2024 12:43
a89cdc8
to
7c73a1a
Compare
ClearlyClaire
approved these changes
Aug 20, 2024
justinwritescode
pushed a commit
to justinwritescode/mastodon
that referenced
this pull request
Sep 15, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This changes the localizable strings for label in the grouped notifications to be placed the entire phrase within one string, to allow Crowdin contributors to translate/localize it more friendly.
Currently, some types of the grouped notifications has the label made with the two parts of string to be localized other languages. Here is an example:
It comes from these localizable strings that have variables enclosed with
{}
:{name_1} favorited your post
{name_2} and {count} others
The frontend inserts an username "Alice" into
{name_2}
, a number of others "2" into{count}
, and B writes "Alice and 2 others". Then, it be inserted into{name_1}
in A, and it results "Alice and 2 others favorited your post".This allows we to using the string B to various type of notifications, also A is used in the ungrouped notifications which is already existing like "Alice favorited your post" by placing an username "Alice" into
{name_1}
. Concatenating phrases is fine idea to me that give improvement of productivity on our work and make Mastodon have less resources.However with i18n perspective, it can introduces some issues due to split sentence and enforcing the word order to translators.
In a case localizing to Japanese for example, it usually adds the honorific さん/-san as a suffix to person's name. The string A is translated to have a honorific like
{name_1}-san favorited your post
and string B will be translated like{name_2}-san and {count} others
with a honorific. Now, when a notification same as above comes, A and B results "Alice-san and 2 others-san favorited your post" (Aliceさんほか2人さんがお気に入りしました). Unfortunately that is wrong usage of -san, it has a meaning "Dr.Alice and Dr.2-others favorited your post" if equivalent symptom is reproduced in English. There is no way to Crowdin contributors to get around this.To resolve this, we better to make the localizable strings contain full sentences of the phrase if we don't have a good reason. It is further friendly to localizing with many locales not only Japanese and lets Mastodon UI avoid grammatical issues.