Skip to content

Commit

Permalink
Reorganize and refactor strings.xml
Browse files Browse the repository at this point in the history
This commit re-organizes `lawn/`'s `strings.xml` code files for clarity and also adds a simple naming scheme. The strings will probably be renamed soon, since I don't have the time to do all of that
  • Loading branch information
SuperDragonXD committed Jun 22, 2024
1 parent 739c2e5 commit 9aac523
Show file tree
Hide file tree
Showing 22 changed files with 461 additions and 340 deletions.
14 changes: 13 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ Please make sure to be civil during discussion of your contribution (refer to th
For translation, visit [Lawnchair on Crowdin](https://lawnchair.crowdin.com) and follow these tips:

- When using quotation marks, insert the symbols specific to the target language, as listed in this [this summary table](https://en.wikipedia.org/wiki/Quotation_mark#Summary_table);
- Lawnchair uses title case for some English UI text while other languages do not use title case; opt for sentence case instead;
- Some English terminology may have not have commonly-used equivalents in other languages. In such cases, use short descriptive phrases—for example, the equivalent of _bottom row_ for _dock_;
- Some languages (e.g. French) have variations of words depending if it's masculine or feminine (gender-specific); we recommend opting for gender-neutral words instead.

Expand Down Expand Up @@ -97,3 +96,16 @@ See the table below detailing the release type:
| Beta | 02 |
| Release Candidate | 03 |
| Release | 04 |
#### String naming
Strings `names` in `strings.xml` should follow this format:
| Type | Format | Example usage | Actual string | Other information |
|--------------------------------------------------|-------------------|----------------------------|----------------------|---------------------------------------------------------------------------------------------------------------------|
| Generic word | $1 | `disagree_or_agree` | Disagree or agree | Should only be used if it doesn't fit the below categories |
| Action | $1_action | `apply_action` | Apply | Any generic action verb can fit here |
| Preference or popup label<br/>Preference headers | $1_label | `folders_label` | Folders | |
| Preference or popup description | $1_description | `folders_description` | Row and column count | |
| Preference choice | $1_choice | `off_choice` | Off | |
| Feature string | (feature_name)_$1 | `colorpicker_hsb` | HSB | Feature strings are strings that are confined to a specific feature. Examples include the gesture and color picker. |
| Launcher string | $1_launcher | `device_contacts_launcher` | Contacts from device | Strings that are specific to the Launcher area |
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ allprojects {

plugins.withType(JavaBasePlugin).configureEach {
java {
toolchain.languageVersion = JavaLanguageVersion.of(21)
toolchain.languageVersion = JavaLanguageVersion.of(17)
}
}

Expand Down Expand Up @@ -123,10 +123,10 @@ final def ciBuild = System.getenv("CI") == "true"
final def ciRef = System.getenv("GITHUB_REF") ?: ""
final def ciRunNumber = System.getenv("GITHUB_RUN_NUMBER") ?: ""
final def isReleaseBuild = ciBuild && ciRef.contains("beta")
final def devReleaseName = ciBuild ? "Dev (#${ciRunNumber})" : "Dev (${buildCommit})"
final def devReleaseName = ciBuild ? "Dev.(#${ciRunNumber})" : "Dev.(${buildCommit})"
final def version = "14"
final def releaseName = "Beta 2"
final def versionDisplayName = "${version} ${isReleaseBuild ? releaseName : devReleaseName}"
final def versionDisplayName = "${version}.${isReleaseBuild ? releaseName : devReleaseName}"
final def majorVersion = versionDisplayName.split("\\.")[0]

final def quickstepMinSdk = "29"
Expand All @@ -153,7 +153,7 @@ android {
applicationVariants.configureEach { variant ->
variant.outputs.configureEach {
def channel = variant.productFlavors.last().name
outputFileName = "Lawnchair ${variant.versionName} $channel ${variant.buildType.name}.apk"
outputFileName = "Lawnchair.${variant.versionName}.$channel.${variant.buildType.name}.apk"
}
}

Expand Down
Loading

0 comments on commit 9aac523

Please sign in to comment.