Skip to content

Differentiate between “My followers” and other accounts followers for i18n #459

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -460,9 +460,12 @@ private void bindHeaderView(){
followersCount.setText(UiUtils.abbreviateNumber(account.followersCount));
followingCount.setText(UiUtils.abbreviateNumber(account.followingCount));
postsCount.setText(UiUtils.abbreviateNumber(account.statusesCount));
followersLabel.setText(getResources().getQuantityString(R.plurals.followers, (int)Math.min(999, account.followersCount)));
followingLabel.setText(getResources().getQuantityString(R.plurals.following, (int)Math.min(999, account.followingCount)));
postsLabel.setText(getResources().getQuantityString(R.plurals.posts, (int)Math.min(999, account.statusesCount)));
final int followingResId = isSelf ? R.plurals.my_following : R.plurals.following;
final int followersResId = isSelf ? R.plurals.my_followers : R.plurals.followers;
final int postsResId = isSelf ? R.plurals.my_posts : R.plurals.posts;
followersLabel.setText(getResources().getQuantityString(followersResId, (int)Math.min(999, account.followersCount)));
followingLabel.setText(getResources().getQuantityString(followingResId, (int)Math.min(999, account.followingCount)));
postsLabel.setText(getResources().getQuantityString(postsResId, (int)Math.min(999, account.statusesCount)));

UiUtils.loadCustomEmojiInTextView(name);
UiUtils.loadCustomEmojiInTextView(bio);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@
import org.joinmastodon.android.R;
import org.joinmastodon.android.api.requests.HeaderPaginationRequest;
import org.joinmastodon.android.api.requests.accounts.GetAccountFollowers;
import org.joinmastodon.android.api.session.AccountSessionManager;
import org.joinmastodon.android.model.Account;

public class FollowerListFragment extends AccountRelatedAccountListFragment{

@Override
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setSubtitle(getResources().getQuantityString(R.plurals.x_followers, (int)(account.followersCount%1000), account.followersCount));
final boolean isSelf = AccountSessionManager.getInstance().isSelf(accountID, account);
final int followersCountResId = isSelf ? R.plurals.my_x_followers : R.plurals.x_followers;
setSubtitle(getResources().getQuantityString(followersCountResId, (int)(account.followersCount%1000), account.followersCount));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@
import org.joinmastodon.android.R;
import org.joinmastodon.android.api.requests.HeaderPaginationRequest;
import org.joinmastodon.android.api.requests.accounts.GetAccountFollowing;
import org.joinmastodon.android.api.session.AccountSessionManager;
import org.joinmastodon.android.model.Account;

public class FollowingListFragment extends AccountRelatedAccountListFragment{

@Override
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setSubtitle(getResources().getQuantityString(R.plurals.x_following, (int)(account.followingCount%1000), account.followingCount));
final boolean isSelf = AccountSessionManager.getInstance().isSelf(accountID, account);
final int followingCountResId = isSelf ? R.plurals.my_x_following : R.plurals.x_following;
setSubtitle(getResources().getQuantityString(followingCountResId, (int)(account.followingCount%1000), account.followingCount));
}

@Override
Expand Down
24 changes: 24 additions & 0 deletions mastodon/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,29 @@
<item quantity="one">follower</item>
<item quantity="other">followers</item>
</plurals>
<plurals name="my_followers">
<item quantity="one">follower</item>
<item quantity="other">followers</item>
</plurals>

<plurals name="following">
<item quantity="one">following</item>
<item quantity="other">following</item>
</plurals>
<plurals name="my_following">
<item quantity="one">following</item>
<item quantity="other">following</item>
</plurals>

<plurals name="posts">
<item quantity="one">post</item>
<item quantity="other">posts</item>
</plurals>
<plurals name="my_posts">
<item quantity="one">post</item>
<item quantity="other">posts</item>
</plurals>

<string name="posts">Posts</string>
<string name="posts_and_replies">Posts and Replies</string>
<string name="media">Media</string>
Expand Down Expand Up @@ -325,10 +340,19 @@
<item quantity="one">%,d follower</item>
<item quantity="other">%,d followers</item>
</plurals>
<plurals name="my_x_followers">
<item quantity="one">%,d follower</item>
<item quantity="other">%,d followers</item>
</plurals>

<plurals name="x_following">
<item quantity="one">%,d following</item>
<item quantity="other">%,d following</item>
</plurals>
<plurals name="my_x_following">
<item quantity="one">%,d following</item>
<item quantity="other">%,d following</item>
</plurals>
<plurals name="x_favorites">
<item quantity="one">%,d favorite</item>
<item quantity="other">%,d favorites</item>
Expand Down