Skip to content

Commit

Permalink
Reorganize strings
Browse files Browse the repository at this point in the history
  • Loading branch information
wingio committed Sep 12, 2024
1 parent cc91554 commit 7f45757
Show file tree
Hide file tree
Showing 145 changed files with 1,506 additions and 6,892 deletions.
60 changes: 58 additions & 2 deletions crowdin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,72 @@ api_token_env: CROWDIN_PERSONAL_TOKEN

preserve_hierarchy: true
files:
- source: ui/src/commonMain/moko-resources/base/plurals.xml
translation: ui/src/commonMain/moko-resources/%locale%/plurals.xml
update_option: update_as_unapproved
ignore:
- ui/src/commonMain/moko-resources/images/
- ui/src/commonMain/moko-resources/files/

- source: ui/src/commonMain/moko-resources/base/strings.xml
translation: ui/src/commonMain/moko-resources/%locale%/strings.xml
update_option: update_as_unapproved
ignore:
- ui/src/commonMain/moko-resources/images/
- ui/src/commonMain/moko-resources/files/

- source: ui/src/commonMain/moko-resources/base/plurals.xml
translation: ui/src/commonMain/moko-resources/%locale%/plurals.xml
- source: ui/src/commonMain/moko-resources/base/strings_auth.xml
translation: ui/src/commonMain/moko-resources/%locale%/strings_auth.xml
update_option: update_as_unapproved
ignore:
- ui/src/commonMain/moko-resources/images/
- ui/src/commonMain/moko-resources/files/

- source: ui/src/commonMain/moko-resources/base/strings_explore.xml
translation: ui/src/commonMain/moko-resources/%locale%/strings_explore.xml
update_option: update_as_unapproved
ignore:
- ui/src/commonMain/moko-resources/images/
- ui/src/commonMain/moko-resources/files/

- source: ui/src/commonMain/moko-resources/base/strings_explorer.xml
translation: ui/src/commonMain/moko-resources/%locale%/strings_explorer.xml
update_option: update_as_unapproved
ignore:
- ui/src/commonMain/moko-resources/images/
- ui/src/commonMain/moko-resources/files/

- source: ui/src/commonMain/moko-resources/base/strings_home.xml
translation: ui/src/commonMain/moko-resources/%locale%/strings_home.xml
update_option: update_as_unapproved
ignore:
- ui/src/commonMain/moko-resources/images/
- ui/src/commonMain/moko-resources/files/

- source: ui/src/commonMain/moko-resources/base/strings_profile.xml
translation: ui/src/commonMain/moko-resources/%locale%/strings_profile.xml
update_option: update_as_unapproved
ignore:
- ui/src/commonMain/moko-resources/images/
- ui/src/commonMain/moko-resources/files/

- source: ui/src/commonMain/moko-resources/base/strings_release.xml
translation: ui/src/commonMain/moko-resources/%locale%/strings_release.xml
update_option: update_as_unapproved
ignore:
- ui/src/commonMain/moko-resources/images/
- ui/src/commonMain/moko-resources/files/

- source: ui/src/commonMain/moko-resources/base/strings_repository.xml
translation: ui/src/commonMain/moko-resources/%locale%/strings_repository.xml
update_option: update_as_unapproved
ignore:
- ui/src/commonMain/moko-resources/images/
- ui/src/commonMain/moko-resources/files/

- source: ui/src/commonMain/moko-resources/base/strings_settings.xml
translation: ui/src/commonMain/moko-resources/%locale%/strings_settings.xml
update_option: update_as_unapproved
ignore:
- ui/src/commonMain/moko-resources/images/
- ui/src/commonMain/moko-resources/files/
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ compose-webview-multiplatform = "1.9.20"
highlights = "0.7.1"
koin = "3.6.0-wasm-alpha2"
ktor = "2.3.12"
moko-resources = "0.24.0-alpha-3"
moko-resources = "0.24.2"
multiplatform-paging = "3.2.0-alpha05-0.2.3"
multiplatform-settings = "1.0.0"
voyager = "1.0.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class LandingScreen(
Spacer(modifier = Modifier.weight(0.10f))

Text(
text = stringResource(Res.strings.login_welcome),
text = stringResource(Res.strings.msg_welcome),
style = MaterialTheme.typography.headlineLarge.copy(
fontWeight = FontWeight.Thin
),
Expand Down Expand Up @@ -136,7 +136,7 @@ class LandingScreen(
imageVector = Icons.Social.GitHub,
contentDescription = null
)
Text(stringResource(Res.strings.login_sign_in_github))
Text(stringResource(Res.strings.action_github_sign_in))
}
Spacer(Modifier.weight(0.20f))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ fun TrendingFeedHeader(
modifier = modifier.padding(horizontal = 16.dp)
) {
Text(
text = stringResource(Res.strings.noun_trending),
text = stringResource(Res.strings.title_trending),
style = MaterialTheme.typography.titleMedium,
modifier = Modifier.weight(1f)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ class HomeScreen : Tab {
}

feedItem.newReleaseItemFragment != null -> NewReleaseItem(item = feedItem.newReleaseItemFragment!!)

feedItem.followedUserFeedItemFragment != null -> {
val id =
feedItem.followedUserFeedItemFragment!!.followee.feedUser?.id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,13 @@ fun FeedUserCard(
contentDescription = null,
modifier = Modifier.size(15.dp)
)
Text(stringResource(Res.strings.noun_follower_count, followers))
Text(
pluralStringResource(
Res.plurals.followers,
count = followers,
followers
)
)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ fun FollowedUserItem(
iconUrl = actor.avatarUrl,
iconDescription = stringResource(Res.strings.noun_users_avatar, actor.login),
badgeIcon = Icons.Filled.PersonAddAlt1,
badgeIconDescription = stringResource(Res.strings.noun_followed),
badgeIconDescription = stringResource(Res.strings.cd_followed),
text = actorText
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ fun ForkedRepoItem(
iconUrl = actor.avatarUrl,
iconDescription = stringResource(Res.strings.noun_users_avatar, actor.login),
badgeIcon = Icons.Custom.Fork,
badgeIconDescription = stringResource(Res.strings.noun_forked_repo),
badgeIconDescription = stringResource(Res.strings.cd_forked_repo),
text = annotatingStringResource(res = Res.strings.forked_repo, actor.login) {
when (it) {
"name" -> SpanStyle(color = MaterialTheme.colorScheme.onSurface)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ import com.materiiapps.gloom.api.dto.user.User
import com.materiiapps.gloom.gql.fragment.NewReleaseItemFragment
import com.materiiapps.gloom.ui.component.Avatar
import com.materiiapps.gloom.ui.component.ThinDivider
import com.materiiapps.gloom.ui.icon.custom.Commit
import com.materiiapps.gloom.ui.icon.Custom
import com.materiiapps.gloom.ui.icon.custom.Commit
import com.materiiapps.gloom.ui.screen.release.ReleaseScreen
import com.materiiapps.gloom.ui.screen.repo.RepoScreen
import com.materiiapps.gloom.ui.theme.DarkGreen
Expand Down Expand Up @@ -165,7 +165,7 @@ fun ReleaseCard(

if (release.isLatest) {
Text(
text = stringResource(Res.strings.adj_latest),
text = stringResource(Res.strings.label_latest),
style = MaterialTheme.typography.labelSmall,
fontSize = 10.sp,
color = DarkGreen,
Expand Down Expand Up @@ -239,7 +239,7 @@ fun ReleaseCard(
if (release.tagCommit?.abbreviatedOid?.isNotBlank() == true) {
ReleaseDetail(
icon = Icons.Custom.Commit,
iconDescription = stringResource(Res.strings.noun_tag),
iconDescription = stringResource(Res.strings.noun_commit),
text = release.tagCommit!!.abbreviatedOid
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ fun StarredRepoItem(
iconUrl = actor.avatarUrl,
iconDescription = stringResource(Res.strings.noun_users_avatar, actor.login),
badgeIcon = Icons.Filled.Star,
badgeIconDescription = stringResource(Res.strings.noun_starred),
badgeIconDescription = stringResource(Res.strings.title_starred),
text = annotatingStringResource(res = Res.strings.starred_repo, actor.login) {
when (it) {
"name" -> SpanStyle(color = MaterialTheme.colorScheme.onSurface)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class OrgsListScreen(
private val username: String,
) : BaseListScreen<ModelUser, JoinedOrgsQuery.Data?, OrgListViewModel>() {

override val titleRes: StringResource get() = Res.strings.noun_orgs
override val titleRes: StringResource get() = Res.strings.title_orgs

override val viewModel: OrgListViewModel
@Composable get() = getScreenModel { parametersOf(username) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class RepositoryListScreen(
private val username: String,
) : BaseListScreen<ModelRepo, RepoListQuery.Data?, RepositoryListViewModel>() {

override val titleRes: StringResource get() = Res.strings.noun_repos
override val titleRes: StringResource get() = Res.strings.title_repos

override val viewModel: RepositoryListViewModel
@Composable get() = getScreenModel { parametersOf(username) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class SponsoringScreen(
private val username: String,
) : BaseListScreen<ModelUser, SponsoringQuery.Data?, SponsoringViewModel>() {

override val titleRes: StringResource get() = Res.strings.noun_sponsoring
override val titleRes: StringResource get() = Res.strings.title_sponsoring

override val viewModel: SponsoringViewModel
@Composable get() = getScreenModel { parametersOf(username) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class StarredReposListScreen(
private val username: String,
) : BaseListScreen<ModelRepo, StarredReposQuery.Data?, StarredReposListViewModel>() {

override val titleRes: StringResource get() = Res.strings.noun_starred
override val titleRes: StringResource get() = Res.strings.title_starred

override val viewModel: StarredReposListViewModel
@Composable get() = getScreenModel { parametersOf(username) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class FollowersScreen(
private val username: String,
) : BaseListScreen<ModelUser, FollowersQuery.Data?, FollowersViewModel>() {

override val titleRes: StringResource get() = Res.strings.noun_followers
override val titleRes: StringResource get() = Res.strings.title_followers

override val viewModel: FollowersViewModel
@Composable get() = getScreenModel { parametersOf(username) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class FollowingScreen(
private val username: String,
) : BaseListScreen<ModelUser, FollowingQuery.Data?, FollowingViewModel>() {

override val titleRes: StringResource get() = Res.strings.noun_following
override val titleRes: StringResource get() = Res.strings.title_following

override val viewModel: FollowingViewModel
@Composable get() = getScreenModel { parametersOf(username) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ import com.materiiapps.gloom.ui.screen.repo.component.RepoItem
import com.materiiapps.gloom.util.Constants
import com.seiko.imageloader.rememberImagePainter
import dev.icerock.moko.resources.compose.painterResource
import dev.icerock.moko.resources.compose.pluralStringResource
import dev.icerock.moko.resources.compose.stringResource
import org.koin.compose.koinInject
import org.koin.core.parameter.parametersOf
Expand Down Expand Up @@ -378,8 +379,9 @@ open class ProfileScreen(
)
}) {
Text(
stringResource(
Res.strings.noun_follower_count,
pluralStringResource(
Res.plurals.followers,
(user.followers ?: 0).toInt(),
user.followers ?: 0
)
)
Expand All @@ -392,8 +394,9 @@ open class ProfileScreen(
)
}) {
Text(
stringResource(
Res.strings.noun_following_count,
pluralStringResource(
Res.plurals.following,
(user.following ?: 0).toInt(),
user.following ?: 0
)
)
Expand All @@ -412,7 +415,7 @@ open class ProfileScreen(
Res.strings.badge_supporter
)
else if (user.id == Constants.DEV_USER_ID) painterResource(Res.images.img_badge_dev) to stringResource(
Res.strings.badge_dev
Res.strings.badge_supporter
)
else null to null

Expand Down Expand Up @@ -527,22 +530,22 @@ open class ProfileScreen(
ElevatedCard {
Column {
StatItem(
label = stringResource(Res.strings.noun_repos),
label = stringResource(Res.strings.title_repos),
count = repoCount,
icon = Icons.Outlined.Book
) {
username?.let { RepositoryListScreen(it) }?.let { nav?.navigate(it) }
}
if (!isOrg) {
StatItem(
label = stringResource(Res.strings.noun_orgs),
label = stringResource(Res.strings.title_orgs),
count = orgCount,
icon = Icons.Outlined.Business
) {
username?.let { OrgsListScreen(it) }?.let { nav?.navigate(it) }
}
StatItem(
label = stringResource(Res.strings.noun_starred),
label = stringResource(Res.strings.title_starred),
count = starCount,
icon = Icons.Outlined.Star
) {
Expand All @@ -551,7 +554,7 @@ open class ProfileScreen(
}
if (sponsoringCount > 0) {
StatItem(
label = stringResource(Res.strings.noun_sponsoring),
label = stringResource(Res.strings.title_sponsoring),
count = sponsoringCount,
icon = Icons.Outlined.FavoriteBorder
) {
Expand Down Expand Up @@ -604,7 +607,7 @@ open class ProfileScreen(
modifier = Modifier.padding(vertical = 8.dp)
) {
Text(
stringResource(Res.strings.title_pinned),
stringResource(Res.strings.section_title_pinned),
style = MaterialTheme.typography.labelLarge,
fontSize = 15.sp,
modifier = Modifier.padding(horizontal = 18.dp)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ fun ContributionGraph(
.padding(horizontal = 16.dp)
) {
Text(
text = stringResource(Res.strings.noun_contributions, calendar.totalContributions),
text = stringResource(Res.strings.section_title_contributions, calendar.totalContributions),
style = MaterialTheme.typography.labelLarge,
fontSize = 15.sp
)
Expand Down Expand Up @@ -99,7 +99,7 @@ fun ContributionGraph(
.padding(16.dp)
) {
Text(
text = stringResource(Res.strings.noun_less),
text = stringResource(Res.strings.label_less),
style = MaterialTheme.typography.labelMedium,
color = LocalContentColor.current.copy(0.5f)
)
Expand All @@ -115,7 +115,7 @@ fun ContributionGraph(
}

Text(
text = stringResource(Res.strings.noun_more),
text = stringResource(Res.strings.label_more),
style = MaterialTheme.typography.labelMedium,
color = LocalContentColor.current.copy(0.5f)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ class ReleaseScreen(
if (it.isNotEmpty()) {
item {
Text(
text = stringResource(Res.strings.noun_contributors),
text = stringResource(Res.strings.title_contributors),
style = MaterialTheme.typography.labelLarge,
color = MaterialTheme.colors.primary,
modifier = Modifier.padding(horizontal = 16.dp)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class LicenseScreen(
},
style = MaterialTheme.typography.labelLarge
)
Text(stringResource(Res.strings.noun_license))
Text(stringResource(Res.strings.title_license))
}
},
navigationIcon = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ fun ContributorsRow(
modifier = Modifier.padding(16.dp)
) {
Text(
text = stringResource(Res.strings.noun_contributors),
text = stringResource(Res.strings.title_contributors),
style = MaterialTheme.typography.labelLarge
)
Text(
Expand Down
Loading

0 comments on commit 7f45757

Please sign in to comment.