Skip to content

Commit

Permalink
Merge pull request #264 from radixdlt/feature/ABW-1544-default-language
Browse files Browse the repository at this point in the history
[ABW-1544] Make values-en the default strings directory for Crowdin compatibility
  • Loading branch information
micbakos-rdx committed May 23, 2023
2 parents c63671d + 794cb05 commit 58cd367
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 9 deletions.
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


# Gradle files
.gradle/
build/
Expand Down Expand Up @@ -36,4 +34,7 @@ google-services.json
# MACos generated
.DS_Store

vendor/
vendor/

# Default translation file (See in app/build.gradle)
app/src/main/res/values/strings.xml
16 changes: 16 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -230,3 +230,19 @@ dependencies {
debugImplementation libs.composeUiTooling
debugImplementation libs.composeUiTestManifest
}

/**
* Copies the english translation file to the default location.
* This is needed since Crowdin cannot create pull requests
* in a path that does not declare the language code.
*
* So assuming that the english language defined in the values-es is the default,
* this will be the file that gets copied.
*/
task buildDefaultLanguage {
copy {
from ('src/main/res/values-en/strings.xml')
into ('src/main/res/values/')
}
}
preBuild.dependsOn buildDefaultLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,8 @@ private fun RequestedPermissionsList(
if (numberOfAccounts == 0) {
stringResource(id = R.string.any_number_of_accounts)
} else {
pluralStringResource(
id = R.plurals.view_at_least_x_accounts,
numberOfAccounts,
stringResource(
id = R.string.view_at_least_x_accounts,
numberOfAccounts
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,7 @@
<item quantity="one">\u2022 %d account</item>
<item quantity="other">\u2022 %d accounts</item>
</plurals>
<plurals name="view_at_least_x_accounts">
<item quantity="other">\u2022 %d or more accounts</item>
</plurals>
<string name="view_at_least_x_accounts">\u2022 %d or more accounts</string>
<string name="any_number_of_accounts">\u2022 Any number of accounts</string>
<string name="agree">Agree</string>
<string name="new_login_request">New Login Request</string>
Expand Down

0 comments on commit 58cd367

Please sign in to comment.