i18n: update bundle in idea-analysis

#KT-37483
This commit is contained in:
Dmitry Gridin
2020-03-26 12:41:16 +07:00
parent 871a6caddb
commit 986bc3fb8f
10 changed files with 24 additions and 15 deletions
@@ -64,7 +64,7 @@ declaration.kind.class=class
declaration.kind.interface=interface
declaration.kind.fun=fun
declaration.kind.parameter=parameter
where=where
type.parameters.where=where
cannot.be.inferred=cannot be inferred
i.for.i.br.0=<i> for </i><br/>{0}
defined.in=defined in
@@ -86,3 +86,7 @@ object.0=object{0}
show.non.public=Show non-public
klib.metadata.short=Klib Metadata
function.arguments=arguments:\u0020
function.receiver.0=receiver: {0}
kotlin.built.in.declarations=Kotlin built-in declarations
kotlin.javascript.meta.file=Kotlin JavaScript meta file
@@ -534,8 +534,7 @@ data class PlatformModuleInfo(
override fun modulesWhoseInternalsAreVisible() = containedModules.flatMap { it.modulesWhoseInternalsAreVisible() }
override val name: Name
get() = Name.special("<Platform module ${platformModule.name} including ${commonModules.map { it.name }}>")
override val name: Name = Name.special("<Platform module ${platformModule.name} including ${commonModules.map { it.name }}>")
override val displayedName: String
get() = KotlinIdeaAnalysisBundle.message(
@@ -19,12 +19,13 @@ package org.jetbrains.kotlin.idea.decompiler.builtIns
import com.intellij.openapi.fileTypes.FileType
import com.intellij.openapi.vfs.VirtualFile
import org.jetbrains.kotlin.idea.KotlinIcons
import org.jetbrains.kotlin.idea.KotlinIdeaAnalysisBundle
import org.jetbrains.kotlin.serialization.deserialization.builtins.BuiltInSerializerProtocol
object KotlinBuiltInFileType : FileType {
override fun getName() = "kotlin_builtins"
override fun getDescription() = "Kotlin built-in declarations"
override fun getDescription() = KotlinIdeaAnalysisBundle.message("kotlin.built.in.declarations")
override fun getDefaultExtension() = BuiltInSerializerProtocol.BUILTINS_FILE_EXTENSION
@@ -12,10 +12,10 @@ import org.jetbrains.kotlin.metadata.deserialization.BinaryVersion
private const val FILE_ABI_VERSION_MARKER: String = "FILE_ABI"
private const val CURRENT_ABI_VERSION_MARKER: String = "CURRENT_ABI"
val INCOMPATIBLE_ABI_VERSION_GENERAL_COMMENT: String =
const val INCOMPATIBLE_ABI_VERSION_GENERAL_COMMENT: String =
"// This class file was compiled with different version of Kotlin compiler and can't be decompiled."
private val INCOMPATIBLE_ABI_VERSION_COMMENT: String = "$INCOMPATIBLE_ABI_VERSION_GENERAL_COMMENT\n" +
private const val INCOMPATIBLE_ABI_VERSION_COMMENT: String = "$INCOMPATIBLE_ABI_VERSION_GENERAL_COMMENT\n" +
"//\n" +
"// Current compiler ABI version is $CURRENT_ABI_VERSION_MARKER\n" +
"// File ABI version is $FILE_ABI_VERSION_MARKER"
@@ -18,13 +18,14 @@ package org.jetbrains.kotlin.idea.decompiler.js
import com.intellij.openapi.fileTypes.FileType
import com.intellij.openapi.vfs.VirtualFile
import org.jetbrains.kotlin.idea.KotlinIdeaAnalysisBundle
import org.jetbrains.kotlin.serialization.js.KotlinJavascriptSerializationUtil
object KotlinJavaScriptMetaFileType : FileType {
override fun getName() = "KJSM"
override fun getDescription() = "Kotlin JavaScript meta file"
override fun getDescription() = KotlinIdeaAnalysisBundle.message("kotlin.javascript.meta.file")
override fun getDefaultExtension() = KotlinJavascriptSerializationUtil.CLASS_METADATA_FILE_EXTENSION
@@ -29,6 +29,7 @@ import org.jetbrains.kotlin.diagnostics.rendering.TabledDescriptorRenderer;
import org.jetbrains.kotlin.diagnostics.rendering.TabledDescriptorRenderer.TableRenderer.DescriptorRow;
import org.jetbrains.kotlin.diagnostics.rendering.TabledDescriptorRenderer.TableRenderer.FunctionArgumentsRow;
import org.jetbrains.kotlin.diagnostics.rendering.TabledDescriptorRenderer.TableRenderer.TableRow;
import org.jetbrains.kotlin.idea.KotlinIdeaAnalysisBundle;
import org.jetbrains.kotlin.idea.highlighter.renderersUtil.RenderersUtilKt;
import org.jetbrains.kotlin.renderer.DescriptorRenderer;
import org.jetbrains.kotlin.renderer.DescriptorRendererModifier;
@@ -139,10 +140,10 @@ public class HtmlTabledDescriptorRenderer extends TabledDescriptorRenderer {
if (isErrorPosition.test(RECEIVER_POSITION.position())) {
error = true;
}
receiver = "receiver: " + RenderersUtilKt.renderStrong(getTypeRenderer().render(receiverType, context), error);
receiver = KotlinIdeaAnalysisBundle.message("function.receiver.0", RenderersUtilKt.renderStrong(getTypeRenderer().render(receiverType, context), error));
}
td(result, receiver);
td(result, hasReceiver ? "arguments: " : "");
td(result, hasReceiver ? KotlinIdeaAnalysisBundle.message("function.arguments") : "");
if (argumentTypes.isEmpty()) {
tdBold(result, "( )");
return;
@@ -33,8 +33,10 @@ internal class VariablesHighlightingVisitor(holder: AnnotationHolder, bindingCon
override fun visitSimpleNameExpression(expression: KtSimpleNameExpression) {
val target = bindingContext.get(REFERENCE_TARGET, expression) ?: return
if (target is ValueParameterDescriptor && bindingContext.get(AUTO_CREATED_IT, target) == true) {
createInfoAnnotation(expression, FUNCTION_LITERAL_DEFAULT_PARAMETER,
KotlinIdeaAnalysisBundle.message("automatically.declared.based.on.the.expected.type")
createInfoAnnotation(
expression,
FUNCTION_LITERAL_DEFAULT_PARAMETER,
KotlinIdeaAnalysisBundle.message("automatically.declared.based.on.the.expected.type")
)
} else if (expression.parent !is KtValueArgumentName) { // highlighted separately
highlightVariable(expression, target)
@@ -68,7 +68,7 @@ fun renderResolvedCall(resolvedCall: ResolvedCall<*>, context: RenderingContext)
val typeParameters = resolvedCall.candidateDescriptor.typeParameters
val (inferredTypeParameters, notInferredTypeParameters) = typeParameters.partition(TypeParameterDescriptor::isInferred)
append("<br/>$indent<i>${KotlinIdeaAnalysisBundle.message("where")}</i> ")
append("<br/>$indent<i>${KotlinIdeaAnalysisBundle.message("type.parameters.where")}</i> ")
if (notInferredTypeParameters.isNotEmpty()) {
append(notInferredTypeParameters.joinToString { typeParameter -> renderError(typeParameter.name) })
append("<i> ${KotlinIdeaAnalysisBundle.message("cannot.be.inferred")}</i>")
@@ -29,8 +29,9 @@ import org.jetbrains.kotlin.resolve.lazy.BodyResolveMode
import org.jetbrains.kotlin.util.OperatorNameConventions
class OperatorToFunctionIntention :
SelfTargetingIntention<KtExpression>(KtExpression::class.java,
KotlinIdeaAnalysisBundle.message("replace.overloaded.operator.with.function.call")
SelfTargetingIntention<KtExpression>(
KtExpression::class.java,
KotlinIdeaAnalysisBundle.message("replace.overloaded.operator.with.function.call")
) {
companion object {
private fun isApplicableUnary(element: KtUnaryExpression, caretOffset: Int): Boolean {
@@ -26,7 +26,7 @@ import org.jetbrains.kotlin.psi.psiUtil.getChildOfType
class KDocElementFactory(val project: Project) {
fun createKDocFromText(text: String): KDoc {
val fileText = text + " fun foo { }"
val fileText = "$text fun foo { }"
val function = KtPsiFactory(project).createDeclaration<KtFunction>(fileText)
return PsiTreeUtil.findChildOfType(function, KDoc::class.java)!!
}