i18n: add bundle for idea-core
This commit is contained in:
@@ -12,7 +12,6 @@ replace.cast.with.static.assert=Replace a cast with a static assert
|
||||
introduce.non.null.assertion=Add non-null asserted (!!) call
|
||||
remove.unnecessary.non.null.assertion=Remove unnecessary non-null assertion (!!)
|
||||
change.to.backing.field=Change reference to backing field
|
||||
implement.members=Implement members
|
||||
import.fix=Import
|
||||
imports.chooser.title=Imports
|
||||
rename.kotlin.package.class.error=Can't rename Kotlin package facade class
|
||||
@@ -119,12 +118,10 @@ change.to.property.name.action=Change ''{0}'' to ''{1}''
|
||||
create.from.usage.family=Create from usage
|
||||
create.local.variable.from.usage=Create local variable ''{0}''
|
||||
create.parameter.from.usage=Create parameter ''{0}''
|
||||
surround.with=Surround with
|
||||
surround.with.string.template="${expr}"
|
||||
surround.with.when.template=when (expr) {}
|
||||
surround.with.runtime.type.cast.template=(expr as RuntimeType)
|
||||
surround.with.function.template={ }
|
||||
surround.with.cannot.perform.action=Cannot perform Surround With action to the current contextsurround.with.function.template={ }
|
||||
kotlin.code.transformations=Kotlin Code Transformations
|
||||
fold.if.to.call=Replace 'if' expression with method call
|
||||
fold.if.to.call.family=Replace 'if' Expression with Method Call
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
action.text.implement.as.constructor.parameters=Implement as constructor parameters
|
||||
action.text.implement.members=Implement members
|
||||
hint.text.no.members.to.implement.have.been.found=No members to implement have been found
|
||||
hint.text.no.members.to.override.have.been.found=No members to override have been found
|
||||
hint.text.surround.with.cannot.perform.action=Cannot perform Surround With action to the current contextsurround.with.function.template={ }
|
||||
hint.text.surround.with=Surround with
|
||||
notification.action.text.apply.context=Apply context
|
||||
notification.action.text.enable.auto.reload=Enable auto-reload
|
||||
notification.text.there.is.a.new.script.context.available=There is a new script context available.
|
||||
text.kotlin.loading.script.dependencies=Kotlin: Loading script dependencies...
|
||||
text.loading.kotlin.script.definitions=Loading kotlin script definitions
|
||||
text.loading.kotlin.script.dependencies=Loading kotlin script dependencies
|
||||
title.implement.members=Implement Members
|
||||
title.override.members=Override Members
|
||||
+6
-6
@@ -22,8 +22,8 @@ import com.intellij.openapi.project.Project
|
||||
import com.intellij.psi.PsiFile
|
||||
import org.jetbrains.kotlin.descriptors.ClassDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.PropertyDescriptor
|
||||
import org.jetbrains.kotlin.idea.KotlinBundle
|
||||
import org.jetbrains.kotlin.idea.caches.resolve.resolveToDescriptorIfAny
|
||||
import org.jetbrains.kotlin.idea.core.util.KotlinIdeaCoreBundle
|
||||
import org.jetbrains.kotlin.idea.util.expectedDescriptors
|
||||
import org.jetbrains.kotlin.js.descriptorUtils.hasPrimaryConstructor
|
||||
import org.jetbrains.kotlin.psi.KtClass
|
||||
@@ -37,18 +37,18 @@ open class ImplementMembersHandler : OverrideImplementMembersHandler(), Intentio
|
||||
.map { OverrideMemberChooserObject.create(project, it, it, OverrideMemberChooserObject.BodyType.FROM_TEMPLATE) }
|
||||
}
|
||||
|
||||
override fun getChooserTitle() = "Implement Members"
|
||||
override fun getChooserTitle() = KotlinIdeaCoreBundle.message("title.implement.members")
|
||||
|
||||
override fun getNoMembersFoundHint() = "No members to implement have been found"
|
||||
override fun getNoMembersFoundHint() = KotlinIdeaCoreBundle.message("hint.text.no.members.to.implement.have.been.found")
|
||||
|
||||
override fun getText() = KotlinBundle.message("implement.members")
|
||||
override fun getFamilyName() = KotlinBundle.message("implement.members")
|
||||
override fun getText() = KotlinIdeaCoreBundle.message("action.text.implement.members")
|
||||
override fun getFamilyName() = KotlinIdeaCoreBundle.message("action.text.implement.members")
|
||||
|
||||
override fun isAvailable(project: Project, editor: Editor, file: PsiFile) = isValidFor(editor, file)
|
||||
}
|
||||
|
||||
class ImplementAsConstructorParameter : ImplementMembersHandler() {
|
||||
override fun getText() = "Implement as constructor parameters"
|
||||
override fun getText() = KotlinIdeaCoreBundle.message("action.text.implement.as.constructor.parameters")
|
||||
|
||||
override fun isValidForClass(classOrObject: KtClassOrObject): Boolean {
|
||||
if (classOrObject !is KtClass || classOrObject is KtEnumEntry || classOrObject.isInterface()) return false
|
||||
|
||||
+3
-2
@@ -8,6 +8,7 @@ package org.jetbrains.kotlin.idea.core.overrideImplement
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.util.SmartList
|
||||
import org.jetbrains.kotlin.descriptors.*
|
||||
import org.jetbrains.kotlin.idea.core.util.KotlinIdeaCoreBundle
|
||||
import org.jetbrains.kotlin.resolve.DescriptorUtils
|
||||
import org.jetbrains.kotlin.resolve.descriptorUtil.builtIns
|
||||
import java.util.*
|
||||
@@ -88,7 +89,7 @@ class OverrideMembersHandler(private val preferConstructorParameters: Boolean =
|
||||
return overridden.flatMap { toRealSupers(it) }.distinctBy { it.original }
|
||||
}
|
||||
|
||||
override fun getChooserTitle() = "Override Members"
|
||||
override fun getChooserTitle() = KotlinIdeaCoreBundle.message("title.override.members")
|
||||
|
||||
override fun getNoMembersFoundHint() = "No members to override have been found"
|
||||
override fun getNoMembersFoundHint() = KotlinIdeaCoreBundle.message("hint.text.no.members.to.override.have.been.found")
|
||||
}
|
||||
|
||||
+4
-3
@@ -16,6 +16,7 @@ import com.intellij.ui.EditorNotificationPanel
|
||||
import com.intellij.ui.HyperlinkLabel
|
||||
import org.jetbrains.annotations.TestOnly
|
||||
import org.jetbrains.kotlin.idea.core.script.settings.KotlinScriptingSettings
|
||||
import org.jetbrains.kotlin.idea.core.util.KotlinIdeaCoreBundle
|
||||
import org.jetbrains.kotlin.psi.UserDataProperty
|
||||
import org.jetbrains.kotlin.scripting.resolve.ScriptCompilationConfigurationWrapper
|
||||
|
||||
@@ -84,12 +85,12 @@ private class NewScriptDependenciesNotificationPanel(
|
||||
) : EditorNotificationPanel() {
|
||||
|
||||
init {
|
||||
setText("There is a new script context available.")
|
||||
createComponentActionLabel("Apply context") {
|
||||
setText(KotlinIdeaCoreBundle.message("notification.text.there.is.a.new.script.context.available"))
|
||||
createComponentActionLabel(KotlinIdeaCoreBundle.message("notification.action.text.apply.context")) {
|
||||
onClick()
|
||||
}
|
||||
|
||||
createComponentActionLabel("Enable auto-reload") {
|
||||
createComponentActionLabel(KotlinIdeaCoreBundle.message("notification.action.text.enable.auto.reload")) {
|
||||
onClick()
|
||||
KotlinScriptingSettings.getInstance(project).isAutoReloadEnabled = true
|
||||
}
|
||||
|
||||
+3
-2
@@ -12,6 +12,7 @@ import com.intellij.openapi.editor.Document
|
||||
import com.intellij.openapi.editor.Editor
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.psi.PsiFile
|
||||
import org.jetbrains.kotlin.idea.core.util.KotlinIdeaCoreBundle
|
||||
import org.jetbrains.kotlin.psi.KtFile
|
||||
|
||||
class ScriptTrafficLightRendererContributor : TrafficLightRendererContributor {
|
||||
@@ -27,13 +28,13 @@ class ScriptTrafficLightRendererContributor : TrafficLightRendererContributor {
|
||||
override fun getDaemonCodeAnalyzerStatus(severityRegistrar: SeverityRegistrar): DaemonCodeAnalyzerStatus {
|
||||
val status = super.getDaemonCodeAnalyzerStatus(severityRegistrar)
|
||||
if (!ScriptDefinitionsManager.getInstance(file.project).isReady()) {
|
||||
status.reasonWhySuspended = "Loading kotlin script definitions"
|
||||
status.reasonWhySuspended = KotlinIdeaCoreBundle.message("text.loading.kotlin.script.definitions")
|
||||
status.errorAnalyzingFinished = false
|
||||
} else if (
|
||||
!ScriptConfigurationManager.getInstance(project).hasConfiguration(file)
|
||||
&& !ScriptConfigurationManager.isManualConfigurationLoading(file.originalFile.virtualFile)
|
||||
) {
|
||||
status.reasonWhySuspended = "Loading kotlin script dependencies"
|
||||
status.reasonWhySuspended = KotlinIdeaCoreBundle.message("text.loading.kotlin.script.dependencies")
|
||||
status.errorAnalyzingFinished = false
|
||||
}
|
||||
return status
|
||||
|
||||
+2
-1
@@ -13,6 +13,7 @@ import com.intellij.openapi.vfs.VirtualFile
|
||||
import com.intellij.util.Alarm
|
||||
import com.intellij.util.containers.HashSetQueue
|
||||
import org.jetbrains.kotlin.idea.core.script.debug
|
||||
import org.jetbrains.kotlin.idea.core.util.KotlinIdeaCoreBundle
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
@@ -203,7 +204,7 @@ internal class DefaultBackgroundExecutor(
|
||||
override fun start() {
|
||||
super.start()
|
||||
|
||||
object : Task.Backgroundable(project, "Kotlin: Loading script dependencies...", true) {
|
||||
object : Task.Backgroundable(project, KotlinIdeaCoreBundle.message("text.kotlin.loading.script.dependencies"), true) {
|
||||
override fun run(indicator: ProgressIndicator) {
|
||||
progressIndicator = indicator
|
||||
updateProgress()
|
||||
|
||||
+3
-3
@@ -9,9 +9,9 @@ import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.kotlin.idea.KotlinBundle;
|
||||
import org.jetbrains.kotlin.idea.caches.resolve.ResolutionUtils;
|
||||
import org.jetbrains.kotlin.idea.core.util.CodeInsightUtils;
|
||||
import org.jetbrains.kotlin.idea.core.util.KotlinIdeaCoreBundle;
|
||||
import org.jetbrains.kotlin.psi.KtBlockExpression;
|
||||
import org.jetbrains.kotlin.psi.KtExpression;
|
||||
import org.jetbrains.kotlin.resolve.BindingContext;
|
||||
@@ -19,8 +19,8 @@ import org.jetbrains.kotlin.resolve.bindingContextUtil.BindingContextUtilsKt;
|
||||
import org.jetbrains.kotlin.resolve.lazy.BodyResolveMode;
|
||||
|
||||
public class KotlinSurrounderUtils {
|
||||
public static String SURROUND_WITH = KotlinBundle.message("surround.with");
|
||||
public static String SURROUND_WITH_ERROR = KotlinBundle.message("surround.with.cannot.perform.action");
|
||||
public static String SURROUND_WITH = KotlinIdeaCoreBundle.message("hint.text.surround.with");
|
||||
public static String SURROUND_WITH_ERROR = KotlinIdeaCoreBundle.message("hint.text.surround.with.cannot.perform.action");
|
||||
|
||||
private KotlinSurrounderUtils() {
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.idea.core.util
|
||||
|
||||
import com.intellij.AbstractBundle
|
||||
import org.jetbrains.annotations.NonNls
|
||||
import org.jetbrains.annotations.PropertyKey
|
||||
|
||||
@NonNls
|
||||
private const val BUNDLE = "messages.KotlinIdeaCoreBundle"
|
||||
|
||||
object KotlinIdeaCoreBundle : AbstractBundle(BUNDLE) {
|
||||
@JvmStatic
|
||||
fun message(@PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any): String = getMessage(key, *params)
|
||||
}
|
||||
Reference in New Issue
Block a user