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
|
||||
change.to.0=Change to ''{0}''
|
||||
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 {
|
||||
override val excludeFqNameCheck: FqName = descriptors.first().importableFqName!!.parent()
|
||||
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(
|
||||
|
||||
@@ -60,7 +60,7 @@ private val MEMBER_RENDERER = IdeDescriptorRenderers.SOURCE_CODE_SHORT_NAMES_NO_
|
||||
fun confirmMemberRewrite(targetClass: KtClass, vararg descriptors: FunctionDescriptor): Boolean {
|
||||
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())
|
||||
return Messages.showYesNoDialog(
|
||||
targetClass.project, message,
|
||||
|
||||
+15
-6
@@ -18,6 +18,7 @@ import com.intellij.openapi.vfs.VirtualFile
|
||||
import com.intellij.openapi.vfs.VirtualFileVisitor
|
||||
import com.intellij.psi.PsiManager
|
||||
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.util.application.runReadAction
|
||||
import org.jetbrains.kotlin.psi.KtClass
|
||||
@@ -34,7 +35,7 @@ class CheckComponentsUsageSearchAction : AnAction() {
|
||||
{
|
||||
runReadAction { process(selectedKotlinFiles, project) }
|
||||
},
|
||||
"Checking Data Classes",
|
||||
KotlinBundle.message("checking.data.classes"),
|
||||
true,
|
||||
project
|
||||
)
|
||||
@@ -49,7 +50,7 @@ class CheckComponentsUsageSearchAction : AnAction() {
|
||||
|
||||
val progressIndicator = ProgressManager.getInstance().progressIndicator
|
||||
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() ?: ""
|
||||
|
||||
val parameter = dataClass.primaryConstructor?.valueParameters?.firstOrNull()
|
||||
@@ -75,9 +76,13 @@ class CheckComponentsUsageSearchAction : AnAction() {
|
||||
SwingUtilities.invokeLater {
|
||||
Messages.showInfoMessage(
|
||||
project,
|
||||
"Difference found for data class ${dataClass.fqName
|
||||
?.asString()}. Found $smartRefsCount usage(s) but $goldRefsCount expected",
|
||||
"Error"
|
||||
KotlinBundle.message(
|
||||
"difference.found.for.data.class.0.found.1.2",
|
||||
dataClass.fqName?.asString().toString(),
|
||||
smartRefsCount,
|
||||
goldRefsCount
|
||||
),
|
||||
KotlinBundle.message("title.error")
|
||||
)
|
||||
}
|
||||
return
|
||||
@@ -91,7 +96,11 @@ class CheckComponentsUsageSearchAction : AnAction() {
|
||||
}
|
||||
|
||||
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.Project
|
||||
import com.intellij.util.ui.EmptyClipboardOwner
|
||||
import org.jetbrains.kotlin.idea.KotlinBundle
|
||||
import org.jetbrains.kotlin.idea.KotlinPluginUtil
|
||||
import org.jetbrains.kotlin.idea.configuration.*
|
||||
import org.jetbrains.kotlin.idea.util.buildNumber
|
||||
@@ -39,7 +40,7 @@ class CopyKotlinProjectOverviewAction : AnAction() {
|
||||
val clipboard = Toolkit.getDefaultToolkit().systemClipboard
|
||||
clipboard.setContents(StringSelection(result), EmptyClipboardOwner.INSTANCE)
|
||||
} 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.registry.Registry
|
||||
import com.intellij.util.TimeoutUtil
|
||||
import org.jetbrains.kotlin.idea.KotlinBundle
|
||||
import java.util.*
|
||||
import kotlin.random.Random
|
||||
|
||||
@@ -39,7 +40,10 @@ class DumbModeTrembleAction : DumbAwareAction() {
|
||||
}
|
||||
|
||||
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 {
|
||||
|
||||
@@ -38,6 +38,7 @@ import org.jetbrains.kotlin.builtins.KotlinBuiltIns
|
||||
import org.jetbrains.kotlin.builtins.getReturnTypeFromFunctionType
|
||||
import org.jetbrains.kotlin.builtins.isFunctionType
|
||||
import org.jetbrains.kotlin.descriptors.CallableDescriptor
|
||||
import org.jetbrains.kotlin.idea.KotlinBundle
|
||||
import org.jetbrains.kotlin.idea.caches.resolve.getResolutionFacade
|
||||
import org.jetbrains.kotlin.psi.*
|
||||
import org.jetbrains.kotlin.resolve.BindingContext
|
||||
@@ -58,7 +59,7 @@ class FindImplicitNothingAction : AnAction() {
|
||||
|
||||
ProgressManager.getInstance().runProcessWithProgressSynchronously(
|
||||
{ find(selectedFiles, project) },
|
||||
"Finding Implicit Nothing's",
|
||||
KotlinBundle.message("finding.implicit.nothing.s"),
|
||||
true,
|
||||
project
|
||||
)
|
||||
@@ -68,7 +69,7 @@ class FindImplicitNothingAction : AnAction() {
|
||||
val progressIndicator = ProgressManager.getInstance().progressIndicator
|
||||
val found = ArrayList<KtCallExpression>()
|
||||
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
|
||||
|
||||
val resolutionFacade = file.getResolutionFacade()
|
||||
@@ -102,10 +103,14 @@ class FindImplicitNothingAction : AnAction() {
|
||||
if (found.isNotEmpty()) {
|
||||
val usages = found.map { UsageInfo2UsageAdapter(UsageInfo(it)) }.toTypedArray()
|
||||
val presentation = UsageViewPresentation()
|
||||
presentation.tabName = "Implicit Nothing's"
|
||||
presentation.tabName = KotlinBundle.message("implicit.nothing.s")
|
||||
UsageViewManager.getInstance(project).showUsages(arrayOf<UsageTarget>(), usages, presentation)
|
||||
} 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.PsiModifier
|
||||
import org.jetbrains.kotlin.descriptors.*
|
||||
import org.jetbrains.kotlin.idea.KotlinBundle
|
||||
import org.jetbrains.kotlin.idea.caches.resolve.findModuleDescriptor
|
||||
import org.jetbrains.kotlin.idea.codeInsight.DescriptorToSourceUtilsIde
|
||||
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 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 fqName = FqName.fromSegments(result!!.split('.'))
|
||||
desc.getPackage(fqName)
|
||||
@@ -58,7 +61,7 @@ class SearchNotPropertyCandidatesAction : AnAction() {
|
||||
processAllDescriptors(packageDesc, project)
|
||||
}
|
||||
},
|
||||
"Searching for Not Property candidates",
|
||||
KotlinBundle.message("searching.for.not.property.candidates"),
|
||||
true,
|
||||
project
|
||||
)
|
||||
@@ -72,7 +75,10 @@ class SearchNotPropertyCandidatesAction : AnAction() {
|
||||
|
||||
fun recursive(desc: DeclarationDescriptor) {
|
||||
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) {
|
||||
|
||||
is ModuleDescriptor -> recursive(desc.getPackage(FqName("java")))
|
||||
@@ -118,7 +124,7 @@ class SearchNotPropertyCandidatesAction : AnAction() {
|
||||
|
||||
var i = 0
|
||||
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)
|
||||
.filterIsInstance<PsiMethod>()
|
||||
.firstOrNull() ?: return@forEach
|
||||
@@ -133,7 +139,7 @@ class SearchNotPropertyCandidatesAction : AnAction() {
|
||||
val nonTrivial = mutableSetOf<FunctionDescriptor>()
|
||||
i = 0
|
||||
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
|
||||
var impl = false
|
||||
descriptors.forEach {
|
||||
|
||||
+2
-1
@@ -37,6 +37,7 @@ import com.intellij.ui.components.JBLabel
|
||||
import com.intellij.ui.components.JBTextField
|
||||
import com.intellij.uiDesigner.core.GridConstraints
|
||||
import kotlinx.coroutines.*
|
||||
import org.jetbrains.kotlin.idea.KotlinBundle
|
||||
import org.jetbrains.kotlin.idea.KotlinFileType
|
||||
import org.jetbrains.kotlin.idea.caches.project.ModuleOrigin
|
||||
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()
|
||||
|
||||
+2
-1
@@ -37,6 +37,7 @@ import com.intellij.ui.components.JBLabel
|
||||
import com.intellij.ui.components.JBTextField
|
||||
import com.intellij.uiDesigner.core.GridConstraints
|
||||
import kotlinx.coroutines.*
|
||||
import org.jetbrains.kotlin.idea.KotlinBundle
|
||||
import org.jetbrains.kotlin.idea.KotlinFileType
|
||||
import org.jetbrains.kotlin.idea.caches.project.ModuleOrigin
|
||||
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()
|
||||
|
||||
Reference in New Issue
Block a user