mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-13 09:18:43 +07:00
Fix mod translation file generation (#7629)
This commit is contained in:

committed by
GitHub

parent
44fdf53b05
commit
f1a69744cb
@ -38,8 +38,14 @@ object TranslationFileWriter {
|
|||||||
val translations = Translations()
|
val translations = Translations()
|
||||||
translations.readAllLanguagesTranslation()
|
translations.readAllLanguagesTranslation()
|
||||||
|
|
||||||
val percentages = generateTranslationFiles(translations)
|
var fastlaneOutput = ""
|
||||||
writeLanguagePercentages(percentages)
|
// check to make sure we're not running from a jar since these users shouldn't need to
|
||||||
|
// regenerate base game translation and fastlane files
|
||||||
|
if (TranslationFileWriter.javaClass.`package`.specificationVersion == null) {
|
||||||
|
val percentages = generateTranslationFiles(translations)
|
||||||
|
writeLanguagePercentages(percentages)
|
||||||
|
fastlaneOutput = "\n" + writeTranslatedFastlaneFiles(translations)
|
||||||
|
}
|
||||||
|
|
||||||
// See #5168 for some background on this
|
// See #5168 for some background on this
|
||||||
for ((modName, modTranslations) in translations.modsWithTranslations) {
|
for ((modName, modTranslations) in translations.modsWithTranslations) {
|
||||||
@ -48,8 +54,7 @@ object TranslationFileWriter {
|
|||||||
writeLanguagePercentages(modPercentages, modFolder) // unused by the game but maybe helpful for the mod developer
|
writeLanguagePercentages(modPercentages, modFolder) // unused by the game but maybe helpful for the mod developer
|
||||||
}
|
}
|
||||||
|
|
||||||
return "Translation files are generated successfully.".tr() + "\n" +
|
return "Translation files are generated successfully.".tr() + fastlaneOutput
|
||||||
writeTranslatedFastlaneFiles(translations)
|
|
||||||
} catch (ex: Throwable) {
|
} catch (ex: Throwable) {
|
||||||
ex.printStackTrace()
|
ex.printStackTrace()
|
||||||
return ex.localizedMessage ?: ex.javaClass.simpleName
|
return ex.localizedMessage ?: ex.javaClass.simpleName
|
||||||
|
Reference in New Issue
Block a user