Skip to content
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
merged 13 commits into from
Aug 21, 2024

Conversation

mgmn
Copy link
Contributor

@mgmn mgmn commented Aug 18, 2024

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:

Alice and 2 others favorited your post

It comes from these localizable strings that have variables enclosed with {}:

  • A. {name_1} favorited your post
  • B. {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.

@renchap renchap requested a review from a team August 19, 2024 11:54
Copy link
Contributor

@ClearlyClaire ClearlyClaire left a 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.

@mgmn mgmn force-pushed the dev/notification_v2-fulltext-i18n-label branch from a89cdc8 to 7c73a1a Compare August 20, 2024 12:43
@mgmn mgmn requested a review from ClearlyClaire August 20, 2024 13:35
@renchap renchap added this pull request to the merge queue Aug 21, 2024
Merged via the queue into mastodon:main with commit 8c7642c Aug 21, 2024
28 checks passed
@mgmn mgmn deleted the dev/notification_v2-fulltext-i18n-label branch August 22, 2024 12:20
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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants