Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AloqaIM-Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
AloqaIM-Android
Commits
971b7569
Commit
971b7569
authored
Jul 22, 2017
by
Leonardo Aramaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Using plurals for quantity strings
parent
11a70451
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
5 deletions
+11
-5
RoomFragment.java
...a/chat/rocket/android/fragment/chatroom/RoomFragment.java
+2
-2
UsersOfRoomDialogFragment.java
...d/fragment/chatroom/dialog/UsersOfRoomDialogFragment.java
+1
-1
strings.xml
app/src/main/res/values/strings.xml
+8
-2
No files found.
app/src/main/java/chat/rocket/android/fragment/chatroom/RoomFragment.java
View file @
971b7569
...
...
@@ -254,8 +254,8 @@ public class RoomFragment extends AbstractChatRoomFragment implements
protected
Snackbar
getUnreadCountIndicatorView
(
int
count
)
{
// TODO: replace with another custom View widget, not to hide message composer.
final
String
caption
=
getResources
().
getString
(
R
.
string
.
fmt_dialog_view_latest_message_title
,
count
);
final
String
caption
=
getResources
().
get
Quantity
String
(
R
.
plurals
.
fmt_dialog_view_latest_message_title
,
count
,
count
);
return
Snackbar
.
make
(
rootView
,
caption
,
Snackbar
.
LENGTH_LONG
)
.
setAction
(
R
.
string
.
dialog_view_latest_message_action
,
view
->
scrollToLatestMessage
());
...
...
app/src/main/java/chat/rocket/android/fragment/chatroom/dialog/UsersOfRoomDialogFragment.java
View file @
971b7569
...
...
@@ -192,7 +192,7 @@ public class UsersOfRoomDialogFragment extends AbstractChatRoomDialogFragment {
*/
private
void
onRenderTotalCount
(
long
total
)
{
TextView
userCount
=
(
TextView
)
getDialog
().
findViewById
(
R
.
id
.
room_user_count
);
userCount
.
setText
(
get
String
(
R
.
string
.
fmt_room_user_count
,
total
));
userCount
.
setText
(
get
Resources
().
getQuantityString
(
R
.
plurals
.
fmt_room_user_count
,
(
int
)
total
,
total
));
}
/**
...
...
app/src/main/res/values/strings.xml
View file @
971b7569
...
...
@@ -14,14 +14,20 @@
<string
name=
"start_of_conversation"
>
Start of conversation
</string>
<string
name=
"users_of_room_title"
>
Members List
</string>
<string
name=
"fmt_room_user_count"
>
Total: %,d users
</string>
<plurals
name=
"fmt_room_user_count"
>
<item
quantity=
"one"
>
Total: %,d user
</item>
<item
quantity=
"other"
>
Total: %,d users
</item>
</plurals>
<string
name=
"sending"
>
Sending…
</string>
<string
name=
"not_synced"
>
Not synced
</string>
<string
name=
"failed_to_sync"
>
Failed to sync
</string>
<string
name=
"resend"
>
Resend
</string>
<string
name=
"discard"
>
Discard
</string>
<string
name=
"fmt_dialog_view_latest_message_title"
>
New %d messages
</string>
<plurals
name=
"fmt_dialog_view_latest_message_title"
>
<item
quantity=
"one"
>
New %d message
</item>
<item
quantity=
"other"
>
New %d messages
</item>
</plurals>
<string
name=
"dialog_view_latest_message_action"
>
View
</string>
<string
name=
"file_uploading_title"
>
Uploading…
</string>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment