Skip to content

Commit 658365e

Browse files
committed
Add translation strings
1 parent 34b40ca commit 658365e

16 files changed

Lines changed: 335 additions & 102 deletions

File tree

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
<resources>
2+
<string name="timeline">Timeline</string>
3+
<string name="notifications">Notifications</string>
4+
<string name="explore">Explore</string>
5+
<string name="profile">Profile</string>
6+
7+
<string name="add_account">Add account</string>
8+
<string name="post">Post</string>
9+
<string name="post_by">Post by %s</string>
10+
11+
<string name="boosted_by">Boosted by</string>
12+
<string name="liked_by">Liked by</string>
13+
<string name="reacted_by">Reacted by</string>
14+
15+
<string name="x_posts">%s posts</string>
16+
17+
<string name="edit_profile">Edit profile</string>
18+
<string name="follow">Follow</string>
19+
<string name="unfollow">Unfollow</string>
20+
21+
<string name="joined_at_x">Joined at %s</string>
22+
23+
<string name="followers">followers</string>
24+
<string name="following">following</string>
25+
26+
<string name="posts">Posts</string>
27+
<string name="posts_and_replies">Posts &amp; Replies</string>
28+
<string name="media">Media</string>
29+
30+
<string name="no_notifications">No notifications...</string>
31+
32+
<string name="instance_host">Instance Host</string>
33+
<string name="you_must_provide_a_valid_host">You must provide a valid host!</string>
34+
35+
<string name="finish">Finish</string>
36+
<string name="_continue">Continue</string>
37+
<string name="cancel">Cancel</string>
38+
<string name="ok">Ok</string>
39+
40+
<string name="debug">Debug</string>
41+
42+
<string name="search_for_posts_or_users">Search for posts or users...</string>
43+
<string name="reply">Reply</string>
44+
<string name="compose">Compose</string>
45+
46+
<string name="visibility_public">Public</string>
47+
<string name="visibility_public_description">Visible to anyone, shows on global timeline</string>
48+
<string name="visibility_unlisted">Unlisted</string>
49+
<string name="visibility_unlisted_description">Visible to anyone, not shown on the global timeline</string>
50+
<string name="visibility_followers">Followers</string>
51+
<string name="visibility_followers_description">Visible to followers only</string>
52+
<string name="visibility_direct">Direct</string>
53+
<string name="visibility_direct_description">Visible only to mentioned users</string>
54+
55+
<string name="content_warning">Content warning</string>
56+
<string name="write_your_post_here">Write your post here...</string>
57+
58+
<string name="settings">Settings</string>
59+
<string name="general">General</string>
60+
<string name="wellbeing">Wellbeing</string>
61+
<string name="default_post_visibility">Default post visibility</string>
62+
<string name="hide_interaction_counters">Hide interaction counters on posts</string>
63+
<string name="hide_follow_counters">Hide follow counters</string>
64+
65+
<string name="account">Account</string>
66+
<string name="switch_account">Switch account</string>
67+
<string name="logout">Log out</string>
68+
69+
<string name="storage">Storage</string>
70+
<string name="cache">Cache</string>
71+
<string name="toggle_logged_in_state">Toggle logged in state</string>
72+
<string name="reset_feature_determinations">Reset feature determinations</string>
73+
<string name="clear_cache">Clear cache</string>
74+
<string name="clear_settings">Clear settings</string>
75+
76+
<string name="liked_your_post">liked your post</string>
77+
<string name="reacted_with_x">reacted with %s</string>
78+
<string name="boosted_your_post">boosted your post</string>
79+
<string name="edited_a_post">edited a post</string>
80+
<string name="a_poll_you_have_voted_in_has_ended">A poll you have voted in has ended</string>
81+
<string name="just_posted">just posted</string>
82+
<string name="bit_you">bit you</string>
83+
<string name="bit_you_back">bit you back</string>
84+
<string name="bit_your_post">bit your post</string>
85+
<string name="requested_to_follow_you">requested to follow you</string>
86+
<string name="followed_you">followed you</string>
87+
88+
<string name="accept">Accept</string>
89+
<string name="reject">Reject</string>
90+
91+
<string name="boosted">boosted</string>
92+
93+
<string name="show_content">Show content</string>
94+
<string name="hide_content">Hide content</string>
95+
96+
<string name="copy_link">Copy link</string>
97+
<string name="open_in_browser">Open in browser</string>
98+
<string name="bookmark">Bookmark</string>
99+
<string name="unbookmark">Unbookmark</string>
100+
<string name="show_boosts">Show boosts</string>
101+
<string name="show_likes">Show likes</string>
102+
<string name="show_reactions">Show reactions</string>
103+
<string name="mute">Mute</string>
104+
<string name="report">Report</string>
105+
<string name="edit">Edit</string>
106+
<string name="delete">Delete</string>
107+
</resources>

shared/src/commonMain/kotlin/site/remlit/snowdrop/App.kt

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ import kotlinx.coroutines.delay
7474
import kotlinx.coroutines.flow.collectLatest
7575
import kotlinx.serialization.Serializable
7676
import org.jetbrains.compose.resources.painterResource
77+
import org.jetbrains.compose.resources.stringResource
7778
import site.remlit.snowdrop.component.AppTheme
7879
import site.remlit.snowdrop.component.Avatar
7980
import site.remlit.snowdrop.util.ExternalUriHandler
@@ -100,6 +101,8 @@ import site.remlit.snowdrop.view.debug.DebugView
100101
import site.remlit.snowdrop.view.debug.DebugStorageView
101102
import site.remlit.snowdrop.view.settings.*
102103
import snowdrop.shared.generated.resources.Res
104+
import snowdrop.shared.generated.resources.add_account
105+
import snowdrop.shared.generated.resources.explore
103106
import snowdrop.shared.generated.resources.icon_account_circle_24px
104107
import snowdrop.shared.generated.resources.icon_account_circle_filled_24px
105108
import snowdrop.shared.generated.resources.icon_add_24px
@@ -111,6 +114,9 @@ import snowdrop.shared.generated.resources.icon_home_24px
111114
import snowdrop.shared.generated.resources.icon_home_filled_24px
112115
import snowdrop.shared.generated.resources.icon_notifications_24px
113116
import snowdrop.shared.generated.resources.icon_notifications_filled_24px
117+
import snowdrop.shared.generated.resources.notifications
118+
import snowdrop.shared.generated.resources.profile
119+
import snowdrop.shared.generated.resources.timeline
114120
import kotlin.reflect.KClass
115121
import kotlin.time.Duration.Companion.milliseconds
116122

@@ -279,7 +285,7 @@ fun App() = safe {
279285
)
280286
else Icon(painterResource(Res.drawable.icon_home_24px), null)
281287
},
282-
label = { Text("Timeline") }
288+
label = { Text(stringResource(Res.string.timeline)) }
283289
)
284290

285291
NavigationBarItem(
@@ -292,7 +298,7 @@ fun App() = safe {
292298
)
293299
else Icon(painterResource(Res.drawable.icon_notifications_24px), null)
294300
},
295-
label = { Text("Notifications") }
301+
label = { Text(stringResource(Res.string.notifications)) }
296302
)
297303

298304
NavigationBarItem(
@@ -305,7 +311,7 @@ fun App() = safe {
305311
)
306312
else Icon(painterResource(Res.drawable.icon_explore_24px), null)
307313
},
308-
label = { Text("Explore") }
314+
label = { Text(stringResource(Res.string.explore)) }
309315
)
310316

311317
NavigationBarItem(
@@ -330,7 +336,7 @@ fun App() = safe {
330336
}
331337
} else fallbackAvatarIcon()
332338
},
333-
label = { Text("Profile") }
339+
label = { Text(stringResource(Res.string.profile)) }
334340
)
335341
}
336342
}
@@ -410,7 +416,7 @@ fun App() = safe {
410416
}
411417
) {
412418
Icon(painterResource(Res.drawable.icon_add_24px), null)
413-
Text("Add account")
419+
Text(stringResource(Res.string.add_account))
414420
}
415421
}
416422

shared/src/commonMain/kotlin/site/remlit/snowdrop/component/Notification.kt

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import androidx.compose.ui.unit.TextUnit
3333
import androidx.compose.ui.unit.dp
3434
import androidx.compose.ui.unit.sp
3535
import org.jetbrains.compose.resources.painterResource
36+
import org.jetbrains.compose.resources.stringResource
3637
import site.remlit.snowdrop.ProfileRoute
3738
import site.remlit.snowdrop.api.followRequest.authorizeFollowRequest
3839
import site.remlit.snowdrop.api.followRequest.rejectFollowRequest
@@ -41,6 +42,14 @@ import site.remlit.snowdrop.util.LocalNavController
4142
import site.remlit.snowdrop.util.bgIO
4243
import site.remlit.snowdrop.util.extension.toRelativeString
4344
import snowdrop.shared.generated.resources.Res
45+
import snowdrop.shared.generated.resources.a_poll_you_have_voted_in_has_ended
46+
import snowdrop.shared.generated.resources.accept
47+
import snowdrop.shared.generated.resources.bit_you
48+
import snowdrop.shared.generated.resources.bit_you_back
49+
import snowdrop.shared.generated.resources.bit_your_post
50+
import snowdrop.shared.generated.resources.boosted_your_post
51+
import snowdrop.shared.generated.resources.edited_a_post
52+
import snowdrop.shared.generated.resources.followed_you
4453
import snowdrop.shared.generated.resources.icon_add_24px
4554
import snowdrop.shared.generated.resources.icon_check_24px
4655
import snowdrop.shared.generated.resources.icon_close_24px
@@ -51,6 +60,11 @@ import snowdrop.shared.generated.resources.icon_repeat_24px
5160
import snowdrop.shared.generated.resources.icon_poll_24px
5261
import snowdrop.shared.generated.resources.icon_star_24px
5362
import snowdrop.shared.generated.resources.icon_tooth_24px
63+
import snowdrop.shared.generated.resources.just_posted
64+
import snowdrop.shared.generated.resources.liked_your_post
65+
import snowdrop.shared.generated.resources.reacted_with_x
66+
import snowdrop.shared.generated.resources.reject
67+
import snowdrop.shared.generated.resources.requested_to_follow_you
5468

5569
@Composable
5670
fun Notification(notification: Notification) {
@@ -138,18 +152,18 @@ fun Notification(notification: Notification) {
138152
}
139153

140154
when (notification.type) {
141-
"favourite" -> message = "liked your post"
142-
"pleroma:emoji_reaction" -> message = "reacted with ${notification.emoji}"
143-
"reaction" -> message = "reacted with :${notification.reaction?.name}:"
144-
"reblog" -> message = "boosted your post"
145-
"update" -> message = "edited a post"
146-
"poll" -> message = "A poll you have voted in has ended"
147-
"status" -> message = "just posted"
148-
"bite" -> message = if (notification.bite?.biteBack == true) "bit you back"
149-
else if (notification.status != null) "bit your post"
150-
else "bit you"
151-
"follow_request" -> message = "requested to follow you"
152-
"follow" -> message = "followed you"
155+
"favourite" -> message = stringResource(Res.string.liked_your_post)
156+
"pleroma:emoji_reaction" -> message = stringResource(Res.string.reacted_with_x, "${notification.emoji}")
157+
"reaction" -> message = stringResource(Res.string.reacted_with_x, ":${notification.reaction?.name}:")
158+
"reblog" -> message = stringResource(Res.string.boosted_your_post)
159+
"update" -> message = stringResource(Res.string.edited_a_post)
160+
"poll" -> message = stringResource(Res.string.a_poll_you_have_voted_in_has_ended)
161+
"status" -> message = stringResource(Res.string.just_posted)
162+
"bite" -> message = if (notification.bite?.biteBack == true) stringResource(Res.string.bit_you_back)
163+
else if (notification.status != null) stringResource(Res.string.bit_your_post)
164+
else stringResource(Res.string.bit_you)
165+
"follow_request" -> message = stringResource(Res.string.requested_to_follow_you)
166+
"follow" -> message = stringResource(Res.string.followed_you)
153167
}
154168

155169
/*
@@ -215,11 +229,11 @@ fun Notification(notification: Notification) {
215229
) {
216230
FilledTonalButton(onClick = { bgIO { authorizeFollowRequest(notification.account.id) } }) {
217231
Icon(painterResource(Res.drawable.icon_check_24px), null)
218-
Text("Accept")
232+
Text(stringResource(Res.string.accept))
219233
}
220234
OutlinedButton(onClick = { bgIO { rejectFollowRequest(notification.account.id) } }) {
221235
Icon(painterResource(Res.drawable.icon_close_24px), null)
222-
Text("Reject")
236+
Text(stringResource(Res.string.reject))
223237
}
224238
}
225239
}

0 commit comments

Comments
 (0)