Update latest fastlane changelog entry when generating translation files

This commit is contained in:
Yair Morgenstern 2022-05-04 19:03:47 +03:00
parent 0aa1dbeda4
commit 7986134929
2 changed files with 28 additions and 21 deletions

View File

@ -483,13 +483,15 @@ object TranslationFileWriter {
* @return Success or error message.
*/
private fun writeTranslatedFastlaneFiles(translations: Translations): String {
return try {
try {
writeFastlaneFiles(shortDescriptionFile, translations[shortDescriptionKey], false)
writeFastlaneFiles(fullDescriptionFile, translations[fullDescriptionKey], true)
"Fastlane files are generated successfully."
updateFastlaneChangelog()
return "Fastlane files are generated successfully."
} catch (ex: Throwable) {
ex.printStackTrace()
ex.localizedMessage ?: ex.javaClass.simpleName
return ex.localizedMessage ?: ex.javaClass.simpleName
}
}
@ -507,6 +509,23 @@ object TranslationFileWriter {
File(path + File.separator + fileName).writeText(fileContent)
}
}
// Original changelog entry, written by incrementVersionAndChangelog, is often changed manually for readability.
// This updates the fastlane changelog entry to match the latest one in changelog.md
private fun updateFastlaneChangelog() {
// Relative path since we're in android/assets
val changelogFile = File("../../changelog.md").readText()
// first group catches the version name, second group catches the rest of the version changelog
// changelogs by definition do not have #'s in them so we can use it as a delimiter
val latestVersionRegexGroup = Regex("## \\S*([^#]*)").find(changelogFile)
val versionChangelog = latestVersionRegexGroup!!.groups[1]!!.value.trim()
val buildConfigFile = File("../../buildSrc/src/main/kotlin/BuildConfig.kt").readText()
val versionNumber =
Regex("appCodeNumber = (\\d*)").find(buildConfigFile)!!.groups[1]!!.value
val fileName = "$fastlanePath/en-US/changelogs/$versionNumber.txt"
File(fileName).writeText(versionChangelog)
}
//endregion
}

View File

@ -1,27 +1,15 @@
## 4.0.12
Minor performance improvement for border strings
By SomeTroglodyte:
- Optimize String to Stat and Translation mod list somewhat
- Implement fastlane step 2: Translating
- Show available resources from CityScreen (bottom right info only)
- Fastlane - sort screenshots by renaming
- Unciv Adaptive Android Icon
- Fix TileInfo.neighbors being incomplete in rare circumstances
- Show available resources from CityScreen
- F-droid integration improvements!
By JackRainy:
- Allow city connections via open borders and own harbors only
- Fix of the broken link in the uniques.md (once again)
- Enable scrolling for the oversized popups
- Enable scrolling for the oversized popups
Make 'Followers of this religion" translatable - By heipizhu4
Fix minimap actor leak - By Azzurite
Performance improvements - By Azzurite
By xlenstra:
- Fixed `provides [amount] [resource]` on buildings not accepting conditionals
- Implemented most easy things from comments on moddable victory PR
check for internet before starting a mp game to avoid freeze - By alexban011
- Implemented most things for moddable victory conditions
Check internet before starting mp game to avoid freeze - By alexban011