i18n: add bundle for idea/actions
This commit is contained in:
@@ -1221,4 +1221,26 @@ replace.with.0.call=Replace with ''{0}()'' call
|
|||||||
wrap.with.let.call=Wrap with '?.let { ... }' call
|
wrap.with.let.call=Wrap with '?.let { ... }' call
|
||||||
change.to.0=Change to ''{0}''
|
change.to.0=Change to ''{0}''
|
||||||
change.to.correct.long.suffix.l=Change to correct long suffix 'L'
|
change.to.correct.long.suffix.l=Change to correct long suffix 'L'
|
||||||
change.to.correct.primitive.type=Change to correct primitive type
|
change.to.correct.primitive.type=Change to correct primitive type
|
||||||
|
0.from.1={0} from {1}
|
||||||
|
checking.data.classes=Checking Data Classes
|
||||||
|
checking.data.class.0.of.1=Checking data class {0} of {1}...
|
||||||
|
difference.found.for.data.class.0.found.1.2=Difference found for data class {0}. Found {1} usage(s) but {2} expected
|
||||||
|
title.error=Error
|
||||||
|
analyzed.0.classes.no.difference.found=Analyzed {0} classes. No difference found.
|
||||||
|
title.success=Success
|
||||||
|
can.t.finish.while.indexing.is.in.progress=Can't finish while indexing is in progress
|
||||||
|
enable.tremble.dumb.mode=Enable Tremble Dumb Mode
|
||||||
|
disable.tremble.dumb.mode=Disable Tremble Dumb Mode
|
||||||
|
finding.implicit.nothing.s=Finding Implicit Nothing's
|
||||||
|
scanning.files.0.fo.1.file.2.occurrences.found=Scanning files: {0} of {1} file. {2} occurrences found
|
||||||
|
implicit.nothing.s=Implicit Nothing's
|
||||||
|
not.found.in.0.files=Not found in {0} file(s)
|
||||||
|
titile.not.found=Not Found
|
||||||
|
search.for.not.property.candidates=Search for Not Property candidates
|
||||||
|
enter.package.fqname=Enter package FqName
|
||||||
|
searching.for.not.property.candidates=Searching for Not Property candidates
|
||||||
|
step.1.collecting.0.1.2=Step 1: Collecting {0}:{1}:{2}
|
||||||
|
step.2.0.of.1=Step 2: {0} of {1}
|
||||||
|
step.3.0.of.1=Step 3: {0} of {1}
|
||||||
|
title.done=Done
|
||||||
@@ -338,7 +338,7 @@ private class GroupedImportVariant(
|
|||||||
) : AutoImportVariant {
|
) : AutoImportVariant {
|
||||||
override val excludeFqNameCheck: FqName = descriptors.first().importableFqName!!.parent()
|
override val excludeFqNameCheck: FqName = descriptors.first().importableFqName!!.parent()
|
||||||
override val descriptorsToImport: Collection<DeclarationDescriptor> get() = descriptors
|
override val descriptorsToImport: Collection<DeclarationDescriptor> get() = descriptors
|
||||||
override val hint: String get() = "$autoImportDescription from $excludeFqNameCheck"
|
override val hint: String get() = KotlinBundle.message("0.from.1", autoImportDescription, excludeFqNameCheck)
|
||||||
}
|
}
|
||||||
|
|
||||||
private class SingleImportVariant(
|
private class SingleImportVariant(
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ private val MEMBER_RENDERER = IdeDescriptorRenderers.SOURCE_CODE_SHORT_NAMES_NO_
|
|||||||
fun confirmMemberRewrite(targetClass: KtClass, vararg descriptors: FunctionDescriptor): Boolean {
|
fun confirmMemberRewrite(targetClass: KtClass, vararg descriptors: FunctionDescriptor): Boolean {
|
||||||
if (ApplicationManager.getApplication().isUnitTestMode) return true
|
if (ApplicationManager.getApplication().isUnitTestMode) return true
|
||||||
|
|
||||||
val functionsText = descriptors.joinToString(separator = " and ") { "'${MEMBER_RENDERER.render(it)}'" }
|
val functionsText = descriptors.joinToString(separator = " ${KotlinBundle.message("configuration.text.and")} ") { "'${MEMBER_RENDERER.render(it)}'" }
|
||||||
val message = KotlinBundle.message("action.generate.functions.already.defined", functionsText, targetClass.name.toString())
|
val message = KotlinBundle.message("action.generate.functions.already.defined", functionsText, targetClass.name.toString())
|
||||||
return Messages.showYesNoDialog(
|
return Messages.showYesNoDialog(
|
||||||
targetClass.project, message,
|
targetClass.project, message,
|
||||||
|
|||||||
+15
-6
@@ -18,6 +18,7 @@ import com.intellij.openapi.vfs.VirtualFile
|
|||||||
import com.intellij.openapi.vfs.VirtualFileVisitor
|
import com.intellij.openapi.vfs.VirtualFileVisitor
|
||||||
import com.intellij.psi.PsiManager
|
import com.intellij.psi.PsiManager
|
||||||
import com.intellij.psi.search.searches.ReferencesSearch
|
import com.intellij.psi.search.searches.ReferencesSearch
|
||||||
|
import org.jetbrains.kotlin.idea.KotlinBundle
|
||||||
import org.jetbrains.kotlin.idea.search.usagesSearch.ExpressionsOfTypeProcessor
|
import org.jetbrains.kotlin.idea.search.usagesSearch.ExpressionsOfTypeProcessor
|
||||||
import org.jetbrains.kotlin.idea.util.application.runReadAction
|
import org.jetbrains.kotlin.idea.util.application.runReadAction
|
||||||
import org.jetbrains.kotlin.psi.KtClass
|
import org.jetbrains.kotlin.psi.KtClass
|
||||||
@@ -34,7 +35,7 @@ class CheckComponentsUsageSearchAction : AnAction() {
|
|||||||
{
|
{
|
||||||
runReadAction { process(selectedKotlinFiles, project) }
|
runReadAction { process(selectedKotlinFiles, project) }
|
||||||
},
|
},
|
||||||
"Checking Data Classes",
|
KotlinBundle.message("checking.data.classes"),
|
||||||
true,
|
true,
|
||||||
project
|
project
|
||||||
)
|
)
|
||||||
@@ -49,7 +50,7 @@ class CheckComponentsUsageSearchAction : AnAction() {
|
|||||||
|
|
||||||
val progressIndicator = ProgressManager.getInstance().progressIndicator
|
val progressIndicator = ProgressManager.getInstance().progressIndicator
|
||||||
for ((i, dataClass) in dataClasses.withIndex()) {
|
for ((i, dataClass) in dataClasses.withIndex()) {
|
||||||
progressIndicator?.text = "Checking data class ${i + 1} of ${dataClasses.size}..."
|
progressIndicator?.text = KotlinBundle.message("checking.data.class.0.of.1", i + 1, dataClasses.size)
|
||||||
progressIndicator?.text2 = dataClass.fqName?.asString() ?: ""
|
progressIndicator?.text2 = dataClass.fqName?.asString() ?: ""
|
||||||
|
|
||||||
val parameter = dataClass.primaryConstructor?.valueParameters?.firstOrNull()
|
val parameter = dataClass.primaryConstructor?.valueParameters?.firstOrNull()
|
||||||
@@ -75,9 +76,13 @@ class CheckComponentsUsageSearchAction : AnAction() {
|
|||||||
SwingUtilities.invokeLater {
|
SwingUtilities.invokeLater {
|
||||||
Messages.showInfoMessage(
|
Messages.showInfoMessage(
|
||||||
project,
|
project,
|
||||||
"Difference found for data class ${dataClass.fqName
|
KotlinBundle.message(
|
||||||
?.asString()}. Found $smartRefsCount usage(s) but $goldRefsCount expected",
|
"difference.found.for.data.class.0.found.1.2",
|
||||||
"Error"
|
dataClass.fqName?.asString().toString(),
|
||||||
|
smartRefsCount,
|
||||||
|
goldRefsCount
|
||||||
|
),
|
||||||
|
KotlinBundle.message("title.error")
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
@@ -91,7 +96,11 @@ class CheckComponentsUsageSearchAction : AnAction() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
SwingUtilities.invokeLater {
|
SwingUtilities.invokeLater {
|
||||||
Messages.showInfoMessage(project, "Analyzed ${dataClasses.size} classes. No difference found.", "Success")
|
Messages.showInfoMessage(
|
||||||
|
project,
|
||||||
|
KotlinBundle.message("analyzed.0.classes.no.difference.found", dataClasses.size),
|
||||||
|
KotlinBundle.message("title.success")
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -17,6 +17,7 @@ import com.intellij.openapi.project.DumbService
|
|||||||
import com.intellij.openapi.project.IndexNotReadyException
|
import com.intellij.openapi.project.IndexNotReadyException
|
||||||
import com.intellij.openapi.project.Project
|
import com.intellij.openapi.project.Project
|
||||||
import com.intellij.util.ui.EmptyClipboardOwner
|
import com.intellij.util.ui.EmptyClipboardOwner
|
||||||
|
import org.jetbrains.kotlin.idea.KotlinBundle
|
||||||
import org.jetbrains.kotlin.idea.KotlinPluginUtil
|
import org.jetbrains.kotlin.idea.KotlinPluginUtil
|
||||||
import org.jetbrains.kotlin.idea.configuration.*
|
import org.jetbrains.kotlin.idea.configuration.*
|
||||||
import org.jetbrains.kotlin.idea.util.buildNumber
|
import org.jetbrains.kotlin.idea.util.buildNumber
|
||||||
@@ -39,7 +40,7 @@ class CopyKotlinProjectOverviewAction : AnAction() {
|
|||||||
val clipboard = Toolkit.getDefaultToolkit().systemClipboard
|
val clipboard = Toolkit.getDefaultToolkit().systemClipboard
|
||||||
clipboard.setContents(StringSelection(result), EmptyClipboardOwner.INSTANCE)
|
clipboard.setContents(StringSelection(result), EmptyClipboardOwner.INSTANCE)
|
||||||
} catch (_: IndexNotReadyException) {
|
} catch (_: IndexNotReadyException) {
|
||||||
DumbService.getInstance(project).showDumbModeNotification("Can't finish while indexing is in progress")
|
DumbService.getInstance(project).showDumbModeNotification(KotlinBundle.message("can.t.finish.while.indexing.is.in.progress"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import com.intellij.openapi.project.Project
|
|||||||
import com.intellij.openapi.util.Key
|
import com.intellij.openapi.util.Key
|
||||||
import com.intellij.openapi.util.registry.Registry
|
import com.intellij.openapi.util.registry.Registry
|
||||||
import com.intellij.util.TimeoutUtil
|
import com.intellij.util.TimeoutUtil
|
||||||
|
import org.jetbrains.kotlin.idea.KotlinBundle
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import kotlin.random.Random
|
import kotlin.random.Random
|
||||||
|
|
||||||
@@ -39,7 +40,10 @@ class DumbModeTrembleAction : DumbAwareAction() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
val isTrembleDumb = isTrembleDumb(project)
|
val isTrembleDumb = isTrembleDumb(project)
|
||||||
e.presentation.text = if (isTrembleDumb) "Disable Tremble Dumb Mode" else "Enable Tremble Dumb Mode"
|
e.presentation.text = if (isTrembleDumb)
|
||||||
|
KotlinBundle.message("disable.tremble.dumb.mode")
|
||||||
|
else
|
||||||
|
KotlinBundle.message("enable.tremble.dumb.mode")
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ import org.jetbrains.kotlin.builtins.KotlinBuiltIns
|
|||||||
import org.jetbrains.kotlin.builtins.getReturnTypeFromFunctionType
|
import org.jetbrains.kotlin.builtins.getReturnTypeFromFunctionType
|
||||||
import org.jetbrains.kotlin.builtins.isFunctionType
|
import org.jetbrains.kotlin.builtins.isFunctionType
|
||||||
import org.jetbrains.kotlin.descriptors.CallableDescriptor
|
import org.jetbrains.kotlin.descriptors.CallableDescriptor
|
||||||
|
import org.jetbrains.kotlin.idea.KotlinBundle
|
||||||
import org.jetbrains.kotlin.idea.caches.resolve.getResolutionFacade
|
import org.jetbrains.kotlin.idea.caches.resolve.getResolutionFacade
|
||||||
import org.jetbrains.kotlin.psi.*
|
import org.jetbrains.kotlin.psi.*
|
||||||
import org.jetbrains.kotlin.resolve.BindingContext
|
import org.jetbrains.kotlin.resolve.BindingContext
|
||||||
@@ -58,7 +59,7 @@ class FindImplicitNothingAction : AnAction() {
|
|||||||
|
|
||||||
ProgressManager.getInstance().runProcessWithProgressSynchronously(
|
ProgressManager.getInstance().runProcessWithProgressSynchronously(
|
||||||
{ find(selectedFiles, project) },
|
{ find(selectedFiles, project) },
|
||||||
"Finding Implicit Nothing's",
|
KotlinBundle.message("finding.implicit.nothing.s"),
|
||||||
true,
|
true,
|
||||||
project
|
project
|
||||||
)
|
)
|
||||||
@@ -68,7 +69,7 @@ class FindImplicitNothingAction : AnAction() {
|
|||||||
val progressIndicator = ProgressManager.getInstance().progressIndicator
|
val progressIndicator = ProgressManager.getInstance().progressIndicator
|
||||||
val found = ArrayList<KtCallExpression>()
|
val found = ArrayList<KtCallExpression>()
|
||||||
for ((i, file) in files.withIndex()) {
|
for ((i, file) in files.withIndex()) {
|
||||||
progressIndicator?.text = "Scanning files: $i of ${files.size} file. ${found.size} occurrences found"
|
progressIndicator?.text = KotlinBundle.message("scanning.files.0.fo.1.file.2.occurrences.found", i, files.size, found.size)
|
||||||
progressIndicator?.text2 = file.virtualFile.path
|
progressIndicator?.text2 = file.virtualFile.path
|
||||||
|
|
||||||
val resolutionFacade = file.getResolutionFacade()
|
val resolutionFacade = file.getResolutionFacade()
|
||||||
@@ -102,10 +103,14 @@ class FindImplicitNothingAction : AnAction() {
|
|||||||
if (found.isNotEmpty()) {
|
if (found.isNotEmpty()) {
|
||||||
val usages = found.map { UsageInfo2UsageAdapter(UsageInfo(it)) }.toTypedArray()
|
val usages = found.map { UsageInfo2UsageAdapter(UsageInfo(it)) }.toTypedArray()
|
||||||
val presentation = UsageViewPresentation()
|
val presentation = UsageViewPresentation()
|
||||||
presentation.tabName = "Implicit Nothing's"
|
presentation.tabName = KotlinBundle.message("implicit.nothing.s")
|
||||||
UsageViewManager.getInstance(project).showUsages(arrayOf<UsageTarget>(), usages, presentation)
|
UsageViewManager.getInstance(project).showUsages(arrayOf<UsageTarget>(), usages, presentation)
|
||||||
} else {
|
} else {
|
||||||
Messages.showInfoMessage(project, "Not found in ${files.size} file(s)", "Not Found")
|
Messages.showInfoMessage(
|
||||||
|
project,
|
||||||
|
KotlinBundle.message("not.found.in.0.files", files.size),
|
||||||
|
KotlinBundle.message("titile.not.found")
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+11
-5
@@ -28,6 +28,7 @@ import com.intellij.openapi.ui.Messages
|
|||||||
import com.intellij.psi.PsiMethod
|
import com.intellij.psi.PsiMethod
|
||||||
import com.intellij.psi.PsiModifier
|
import com.intellij.psi.PsiModifier
|
||||||
import org.jetbrains.kotlin.descriptors.*
|
import org.jetbrains.kotlin.descriptors.*
|
||||||
|
import org.jetbrains.kotlin.idea.KotlinBundle
|
||||||
import org.jetbrains.kotlin.idea.caches.resolve.findModuleDescriptor
|
import org.jetbrains.kotlin.idea.caches.resolve.findModuleDescriptor
|
||||||
import org.jetbrains.kotlin.idea.codeInsight.DescriptorToSourceUtilsIde
|
import org.jetbrains.kotlin.idea.codeInsight.DescriptorToSourceUtilsIde
|
||||||
import org.jetbrains.kotlin.idea.util.application.runReadAction
|
import org.jetbrains.kotlin.idea.util.application.runReadAction
|
||||||
@@ -43,7 +44,9 @@ class SearchNotPropertyCandidatesAction : AnAction() {
|
|||||||
val psiFile = e.getData(CommonDataKeys.PSI_FILE) as? KtFile ?: return
|
val psiFile = e.getData(CommonDataKeys.PSI_FILE) as? KtFile ?: return
|
||||||
|
|
||||||
val desc = psiFile.findModuleDescriptor()
|
val desc = psiFile.findModuleDescriptor()
|
||||||
val result = Messages.showInputDialog("Enter package FqName", "Search for Not Property candidates", Messages.getQuestionIcon())
|
val result = Messages.showInputDialog(
|
||||||
|
KotlinBundle.message("enter.package.fqname"),
|
||||||
|
KotlinBundle.message("search.for.not.property.candidates"), Messages.getQuestionIcon())
|
||||||
val packageDesc = try {
|
val packageDesc = try {
|
||||||
val fqName = FqName.fromSegments(result!!.split('.'))
|
val fqName = FqName.fromSegments(result!!.split('.'))
|
||||||
desc.getPackage(fqName)
|
desc.getPackage(fqName)
|
||||||
@@ -58,7 +61,7 @@ class SearchNotPropertyCandidatesAction : AnAction() {
|
|||||||
processAllDescriptors(packageDesc, project)
|
processAllDescriptors(packageDesc, project)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Searching for Not Property candidates",
|
KotlinBundle.message("searching.for.not.property.candidates"),
|
||||||
true,
|
true,
|
||||||
project
|
project
|
||||||
)
|
)
|
||||||
@@ -72,7 +75,10 @@ class SearchNotPropertyCandidatesAction : AnAction() {
|
|||||||
|
|
||||||
fun recursive(desc: DeclarationDescriptor) {
|
fun recursive(desc: DeclarationDescriptor) {
|
||||||
if (desc in processed) return
|
if (desc in processed) return
|
||||||
progress("Step 1: Collecting ${processed.size}:$pFunctions:${matchedDescriptors.size}", "$desc")
|
progress(
|
||||||
|
KotlinBundle.message("step.1.collecting.0.1.2", processed.size, pFunctions, matchedDescriptors.size),
|
||||||
|
"$desc"
|
||||||
|
)
|
||||||
when (desc) {
|
when (desc) {
|
||||||
|
|
||||||
is ModuleDescriptor -> recursive(desc.getPackage(FqName("java")))
|
is ModuleDescriptor -> recursive(desc.getPackage(FqName("java")))
|
||||||
@@ -118,7 +124,7 @@ class SearchNotPropertyCandidatesAction : AnAction() {
|
|||||||
|
|
||||||
var i = 0
|
var i = 0
|
||||||
resultDescriptors.forEach { functionDescriptor ->
|
resultDescriptors.forEach { functionDescriptor ->
|
||||||
progress("Step 2: ${i++} of ${resultDescriptors.size}", "$functionDescriptor")
|
progress(KotlinBundle.message("step.2.0.of.1", i++, resultDescriptors.size), "$functionDescriptor")
|
||||||
val source = DescriptorToSourceUtilsIde.getAllDeclarations(project, functionDescriptor)
|
val source = DescriptorToSourceUtilsIde.getAllDeclarations(project, functionDescriptor)
|
||||||
.filterIsInstance<PsiMethod>()
|
.filterIsInstance<PsiMethod>()
|
||||||
.firstOrNull() ?: return@forEach
|
.firstOrNull() ?: return@forEach
|
||||||
@@ -133,7 +139,7 @@ class SearchNotPropertyCandidatesAction : AnAction() {
|
|||||||
val nonTrivial = mutableSetOf<FunctionDescriptor>()
|
val nonTrivial = mutableSetOf<FunctionDescriptor>()
|
||||||
i = 0
|
i = 0
|
||||||
descriptorToPsiBinding.forEach { (t, u) ->
|
descriptorToPsiBinding.forEach { (t, u) ->
|
||||||
progress("Step 3: ${i++} of ${descriptorToPsiBinding.size}", "$t")
|
progress(KotlinBundle.message("step.3.0.of.1", i++, descriptorToPsiBinding.size), "$t")
|
||||||
val descriptors = t.overriddenDescriptors
|
val descriptors = t.overriddenDescriptors
|
||||||
var impl = false
|
var impl = false
|
||||||
descriptors.forEach {
|
descriptors.forEach {
|
||||||
|
|||||||
+2
-1
@@ -37,6 +37,7 @@ import com.intellij.ui.components.JBLabel
|
|||||||
import com.intellij.ui.components.JBTextField
|
import com.intellij.ui.components.JBTextField
|
||||||
import com.intellij.uiDesigner.core.GridConstraints
|
import com.intellij.uiDesigner.core.GridConstraints
|
||||||
import kotlinx.coroutines.*
|
import kotlinx.coroutines.*
|
||||||
|
import org.jetbrains.kotlin.idea.KotlinBundle
|
||||||
import org.jetbrains.kotlin.idea.KotlinFileType
|
import org.jetbrains.kotlin.idea.KotlinFileType
|
||||||
import org.jetbrains.kotlin.idea.caches.project.ModuleOrigin
|
import org.jetbrains.kotlin.idea.caches.project.ModuleOrigin
|
||||||
import org.jetbrains.kotlin.idea.caches.project.getNullableModuleInfo
|
import org.jetbrains.kotlin.idea.caches.project.getNullableModuleInfo
|
||||||
@@ -211,7 +212,7 @@ internal abstract class AbstractCompletionBenchmarkScenario(
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
AbstractCompletionBenchmarkAction.showPopup(project, "Done")
|
AbstractCompletionBenchmarkAction.showPopup(project, KotlinBundle.message("title.done"))
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract suspend fun doBenchmark()
|
abstract suspend fun doBenchmark()
|
||||||
|
|||||||
+2
-1
@@ -37,6 +37,7 @@ import com.intellij.ui.components.JBLabel
|
|||||||
import com.intellij.ui.components.JBTextField
|
import com.intellij.ui.components.JBTextField
|
||||||
import com.intellij.uiDesigner.core.GridConstraints
|
import com.intellij.uiDesigner.core.GridConstraints
|
||||||
import kotlinx.coroutines.*
|
import kotlinx.coroutines.*
|
||||||
|
import org.jetbrains.kotlin.idea.KotlinBundle
|
||||||
import org.jetbrains.kotlin.idea.KotlinFileType
|
import org.jetbrains.kotlin.idea.KotlinFileType
|
||||||
import org.jetbrains.kotlin.idea.caches.project.ModuleOrigin
|
import org.jetbrains.kotlin.idea.caches.project.ModuleOrigin
|
||||||
import org.jetbrains.kotlin.idea.caches.project.getNullableModuleInfo
|
import org.jetbrains.kotlin.idea.caches.project.getNullableModuleInfo
|
||||||
@@ -213,7 +214,7 @@ internal abstract class AbstractCompletionBenchmarkScenario(
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
AbstractCompletionBenchmarkAction.showPopup(project, "Done")
|
AbstractCompletionBenchmarkAction.showPopup(project, KotlinBundle.message("title.done"))
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract suspend fun doBenchmark()
|
abstract suspend fun doBenchmark()
|
||||||
|
|||||||
Reference in New Issue
Block a user