From f1d21b02e92299bced404d08707325f0e20dd4e2 Mon Sep 17 00:00:00 2001 From: Yan Zhulanow Date: Tue, 18 Feb 2020 22:25:56 +0900 Subject: [PATCH] i18n: Add bundle for idea-native --- .../ide/konan/KotlinNativeBundle.properties | 4 ++++ .../kotlin/ide/konan/KotlinNativeBundle.kt | 24 +++++++++++++++++++ .../kotlin/ide/konan/NativeDefinitions.kt | 5 ++-- .../decompiler/KotlinNativeMetaFileType.kt | 3 ++- 4 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 idea/idea-native/resources/org/jetbrains/kotlin/ide/konan/KotlinNativeBundle.properties create mode 100644 idea/idea-native/src/org/jetbrains/kotlin/ide/konan/KotlinNativeBundle.kt diff --git a/idea/idea-native/resources/org/jetbrains/kotlin/ide/konan/KotlinNativeBundle.properties b/idea/idea-native/resources/org/jetbrains/kotlin/ide/konan/KotlinNativeBundle.properties new file mode 100644 index 00000000000..9c2f2310025 --- /dev/null +++ b/idea/idea-native/resources/org/jetbrains/kotlin/ide/konan/KotlinNativeBundle.properties @@ -0,0 +1,4 @@ +kotlin.native.metadata.short=Kotlin/Native Metadata + +kotlin.native.definitions.short=Kotlin/Native Def +kotlin.native.definitions.description=Definitions file for Kotlin/Native C interoperability \ No newline at end of file diff --git a/idea/idea-native/src/org/jetbrains/kotlin/ide/konan/KotlinNativeBundle.kt b/idea/idea-native/src/org/jetbrains/kotlin/ide/konan/KotlinNativeBundle.kt new file mode 100644 index 00000000000..a56a07d4a4d --- /dev/null +++ b/idea/idea-native/src/org/jetbrains/kotlin/ide/konan/KotlinNativeBundle.kt @@ -0,0 +1,24 @@ +/* + * 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.ide.konan + +import com.intellij.CommonBundle +import org.jetbrains.annotations.NonNls +import org.jetbrains.annotations.PropertyKey +import org.jetbrains.kotlin.idea.core.util.KotlinBundleBase +import java.util.* + +object KotlinNativeBundle : KotlinBundleBase() { + @NonNls + private const val BUNDLE = "org.jetbrains.kotlin.ide.konan.KotlinNativeBundle" + + override fun createBundle(): ResourceBundle = ResourceBundle.getBundle(BUNDLE) + + @JvmStatic + fun message(@NonNls @PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any?): String { + return CommonBundle.message(bundle, key, *params) + } +} \ No newline at end of file diff --git a/idea/idea-native/src/org/jetbrains/kotlin/ide/konan/NativeDefinitions.kt b/idea/idea-native/src/org/jetbrains/kotlin/ide/konan/NativeDefinitions.kt index d663e1ed211..8f337435c50 100644 --- a/idea/idea-native/src/org/jetbrains/kotlin/ide/konan/NativeDefinitions.kt +++ b/idea/idea-native/src/org/jetbrains/kotlin/ide/konan/NativeDefinitions.kt @@ -24,8 +24,9 @@ import org.jetbrains.kotlin.idea.KotlinIcons const val KOTLIN_NATIVE_DEFINITIONS_FILE_EXTENSION = "def" const val KOTLIN_NATIVE_DEFINITIONS_ID = "KND" -const val KOTLIN_NATIVE_DEFINITIONS_NAME = "Kotlin/Native Def" -const val KOTLIN_NATIVE_DEFINITIONS_DESCRIPTION = "Definitions file for Kotlin/Native C interop" + +val KOTLIN_NATIVE_DEFINITIONS_NAME = KotlinNativeBundle.message("kotlin.native.definitions.short") +val KOTLIN_NATIVE_DEFINITIONS_DESCRIPTION = KotlinNativeBundle.message("kotlin.native.definitions.description") object NativeDefinitionsFileType : LanguageFileType(NativeDefinitionsLanguage.INSTANCE) { diff --git a/idea/idea-native/src/org/jetbrains/kotlin/ide/konan/decompiler/KotlinNativeMetaFileType.kt b/idea/idea-native/src/org/jetbrains/kotlin/ide/konan/decompiler/KotlinNativeMetaFileType.kt index a2f81ae80a6..649d4d0c11c 100644 --- a/idea/idea-native/src/org/jetbrains/kotlin/ide/konan/decompiler/KotlinNativeMetaFileType.kt +++ b/idea/idea-native/src/org/jetbrains/kotlin/ide/konan/decompiler/KotlinNativeMetaFileType.kt @@ -7,11 +7,12 @@ package org.jetbrains.kotlin.ide.konan.decompiler import com.intellij.openapi.fileTypes.FileType import com.intellij.openapi.vfs.VirtualFile +import org.jetbrains.kotlin.ide.konan.KotlinNativeBundle import org.jetbrains.kotlin.library.KLIB_METADATA_FILE_EXTENSION object KotlinNativeMetaFileType : FileType { override fun getName() = "KNM" - override fun getDescription() = "Kotlin/Native Metadata" + override fun getDescription() = KotlinNativeBundle.message("kotlin.native.metadata.short") override fun getDefaultExtension() = KLIB_METADATA_FILE_EXTENSION override fun getIcon(): Nothing? = null override fun isBinary() = true