Skip to content

Commit b3d07a2

Browse files
committed
Migrate additional packages up to NBT to message bundles
1 parent f7cb291 commit b3d07a2

File tree

66 files changed

+410
-176
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+410
-176
lines changed

src/main/kotlin/asset/MCDevBundle.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ private const val BUNDLE = "messages.MinecraftDevelopment"
2929

3030
object MCDevBundle : DynamicBundle(BUNDLE) {
3131

32-
fun message(@PropertyKey(resourceBundle = BUNDLE) key: String): String {
32+
operator fun invoke(@PropertyKey(resourceBundle = BUNDLE) key: String): String {
3333
return getMessage(key)
3434
}
3535

36-
fun message(@PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any): String {
36+
operator fun invoke(@PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any?): String {
3737
return getMessage(key, *params)
3838
}
3939
}

src/main/kotlin/creator/MinecraftModuleBuilder.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class MinecraftModuleBuilder : AbstractNewProjectWizardBuilder() {
4141
override fun getNodeIcon() = PlatformAssets.MINECRAFT_ICON
4242
override fun getGroupName() = MinecraftModuleType.NAME
4343
override fun getBuilderId() = "MINECRAFT_MODULE"
44-
override fun getDescription() = MCDevBundle.message("creator.ui.create_minecraft_project")
44+
override fun getDescription() = MCDevBundle("creator.ui.create_minecraft_project")
4545

4646
override fun setupRootModel(modifiableRootModel: ModifiableRootModel) {
4747
if (moduleJdk != null) {

src/main/kotlin/creator/ProjectSetupFinalizerWizardStep.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ class JdkProjectSetupFinalizer(
120120
private var sdk by sdkProperty
121121
private var sdkComboBox: JdkComboBoxWithPreference? = null
122122
private var preferredJdkLabel: Placeholder? = null
123-
private var preferredJdkReason = MCDevBundle.message("creator.validation.jdk_preferred_default_reason")
123+
private var preferredJdkReason = MCDevBundle("creator.validation.jdk_preferred_default_reason")
124124

125125
var preferredJdk: JavaSdkVersion = JavaSdkVersion.JDK_17
126126
private set
@@ -147,7 +147,7 @@ class JdkProjectSetupFinalizer(
147147
preferredJdkLabel?.component = null
148148
} else {
149149
preferredJdkLabel?.component =
150-
JLabel(MCDevBundle.message("creator.validation.jdk_preferred", preferredJdk.description, preferredJdkReason))
150+
JLabel(MCDevBundle("creator.validation.jdk_preferred", preferredJdk.description, preferredJdkReason))
151151
.also { it.foreground = JBColor.YELLOW }
152152
}
153153
}

src/main/kotlin/creator/buildsystem/AbstractBuildSystemStep.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ abstract class AbstractBuildSystemStep(
4949

5050
override val self get() = this
5151
override val label
52-
get() = MCDevBundle.message("creator.ui.build_system.label.generic")
52+
get() = MCDevBundle("creator.ui.build_system.label.generic")
5353

5454
override fun initSteps(): LinkedHashMap<String, NewProjectWizardStep> {
5555
context.putUserData(PLATFORM_NAME_KEY, platformName)
@@ -97,12 +97,12 @@ abstract class AbstractBuildSystemStep(
9797

9898
class GradleBuildSystem : AbstractBuildSystemStep.Factory {
9999
override val name
100-
get() = MCDevBundle.message("creator.ui.build_system.label.gradle")
100+
get() = MCDevBundle("creator.ui.build_system.label.gradle")
101101
}
102102

103103
class MavenBuildSystem : AbstractBuildSystemStep.Factory {
104104
override val name
105-
get() = MCDevBundle.message("creator.ui.build_system.label.maven")
105+
get() = MCDevBundle("creator.ui.build_system.label.maven")
106106
}
107107

108108
abstract class AbstractRunBuildSystemStep(

src/main/kotlin/creator/buildsystem/BuildSystemPropertiesStep.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ import com.intellij.ui.dsl.builder.bindText
3838
import com.intellij.ui.dsl.builder.columns
3939
import com.intellij.ui.dsl.builder.textValidation
4040

41-
private val nonExampleValidation = validationErrorIf<String>(MCDevBundle.message("creator.validation.group_id_non_example")) {
41+
private val nonExampleValidation = validationErrorIf<String>(MCDevBundle("creator.validation.group_id_non_example")) {
4242
it == "org.example"
4343
}
4444

45-
private val versionValidation = validationErrorIf<String>(MCDevBundle.message("creator.validation.semantic_version")) {
45+
private val versionValidation = validationErrorIf<String>(MCDevBundle("creator.validation.semantic_version")) {
4646
SemanticVersion.tryParse(it) == null
4747
}
4848

@@ -67,22 +67,22 @@ class BuildSystemPropertiesStep<ParentStep>(private val parent: ParentStep) : Ab
6767
private fun suggestArtifactId() = parent.name
6868

6969
override fun setupUI(builder: Panel) {
70-
builder.collapsibleGroup(MCDevBundle.message("creator.ui.group.title")) {
71-
row(MCDevBundle.message("creator.ui.group.group_id")) {
70+
builder.collapsibleGroup(MCDevBundle("creator.ui.group.title")) {
71+
row(MCDevBundle("creator.ui.group.group_id")) {
7272
textField()
7373
.bindText(groupIdProperty)
7474
.columns(COLUMNS_MEDIUM)
7575
.validationRequestor(AFTER_GRAPH_PROPAGATION(propertyGraph))
7676
.textValidation(CHECK_NON_EMPTY, CHECK_GROUP_ID, nonExampleValidation)
7777
}
78-
row(MCDevBundle.message("creator.ui.group.artifact_id")) {
78+
row(MCDevBundle("creator.ui.group.artifact_id")) {
7979
textField()
8080
.bindText(artifactIdProperty)
8181
.columns(COLUMNS_MEDIUM)
8282
.validationRequestor(AFTER_GRAPH_PROPAGATION(propertyGraph))
8383
.textValidation(CHECK_NON_EMPTY, CHECK_ARTIFACT_ID)
8484
}
85-
row(MCDevBundle.message("creator.ui.group.version")) {
85+
row(MCDevBundle("creator.ui.group.version")) {
8686
textField()
8787
.bindText(versionProperty)
8888
.columns(COLUMNS_MEDIUM)

src/main/kotlin/creator/buildsystem/gradle-steps.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class GradleWrapperStep(parent: NewProjectWizardStep) : AbstractRunGradleTaskSte
9090

9191
abstract class AbstractPatchGradleFilesStep(parent: NewProjectWizardStep) : AbstractLongRunningStep(parent) {
9292
override val description
93-
get() = MCDevBundle.message("creator.step.gradle.patch_gradle.description")
93+
get() = MCDevBundle("creator.step.gradle.patch_gradle.description")
9494

9595
abstract fun patch(project: Project, gradleFiles: GradleFiles)
9696

@@ -195,7 +195,7 @@ abstract class AbstractPatchGradleFilesStep(parent: NewProjectWizardStep) : Abst
195195

196196
open class GradleImportStep(parent: NewProjectWizardStep) : AbstractLongRunningStep(parent) {
197197
override val description
198-
get() = MCDevBundle.message("creator.step.gradle.import_gradle.description")
198+
get() = MCDevBundle("creator.step.gradle.import_gradle.description")
199199

200200
open val additionalRunTasks = emptyList<String>()
201201

src/main/kotlin/creator/buildsystem/maven-steps.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ fun FixedAssetsNewProjectWizardStep.addDefaultMavenProperties() {
6464

6565
abstract class AbstractPatchPomStep(parent: NewProjectWizardStep) : AbstractLongRunningStep(parent) {
6666
override val description
67-
get() = MCDevBundle.message("creator.step.maven.patch_pom.description")
67+
get() = MCDevBundle("creator.step.maven.patch_pom.description")
6868

6969
open fun patchPom(model: MavenDomProjectModel, root: XmlTag) {
7070
setupCore(model)
@@ -171,7 +171,7 @@ class ReformatPomStep(parent: NewProjectWizardStep) : AbstractReformatFilesStep(
171171

172172
class MavenImportStep(parent: NewProjectWizardStep) : AbstractLongRunningStep(parent) {
173173
override val description
174-
get() = MCDevBundle.message("creator.step.maven.import_maven.description")
174+
get() = MCDevBundle("creator.step.maven.import_maven.description")
175175

176176
override fun perform(project: Project) {
177177
val pomFile = VfsUtil.findFile(Path.of(context.projectFileDirectory).resolve("pom.xml"), true)

src/main/kotlin/creator/platformtype/ModPlatformStep.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ class ModPlatformStep(
4141

4242
override val self = this
4343
override val label
44-
get() = MCDevBundle.message("creator.ui.platform.label")
44+
get() = MCDevBundle("creator.ui.platform.label")
4545

4646
class TypeFactory : PlatformTypeStep.Factory {
4747
override val name
48-
get() = MCDevBundle.message("creator.ui.platform.mod.name")
48+
get() = MCDevBundle("creator.ui.platform.mod.name")
4949
override fun createStep(parent: PlatformTypeStep) = ModPlatformStep(parent)
5050
}
5151

src/main/kotlin/creator/platformtype/PlatformTypeStep.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class PlatformTypeStep private constructor(
4747

4848
override val self = this
4949
override val label
50-
get() = MCDevBundle.message("creator.ui.platform.type.label")
50+
get() = MCDevBundle("creator.ui.platform.type.label")
5151

5252
interface Factory : NewProjectWizardMultiStepFactory<PlatformTypeStep>
5353
}

src/main/kotlin/creator/platformtype/PluginPlatformStep.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ class PluginPlatformStep(
4141

4242
override val self = this
4343
override val label
44-
get() = MCDevBundle.message("creator.ui.platform.label")
44+
get() = MCDevBundle("creator.ui.platform.label")
4545

4646
class TypeFactory : PlatformTypeStep.Factory {
4747
override val name
48-
get() = MCDevBundle.message("creator.ui.platform.plugin.name")
48+
get() = MCDevBundle("creator.ui.platform.plugin.name")
4949
override fun createStep(parent: PlatformTypeStep) = PluginPlatformStep(parent)
5050
}
5151

0 commit comments

Comments
 (0)