i18n: add bundle for idea/update
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
name.android.studio=Android Studio
|
||||
reason.text.exception.during.verification=exception during verification {0}
|
||||
reason.text.no.verified.versions.for.this.build=No verified versions for this build.
|
||||
reason.text.unable.to.connect.to.compatibility.verification.repository=unable to connect to compatibility verification repository
|
||||
reason.text.unable.to.parse.compatibility.verification.metadata=unable to parse compatibility verification metadata
|
||||
reason.text.version.to.be.verified=Version to be verified.
|
||||
@@ -20,7 +20,7 @@ import javax.xml.bind.annotation.*
|
||||
|
||||
class GooglePluginUpdateVerifier : PluginUpdateVerifier() {
|
||||
override val verifierName: String
|
||||
get() = "Android Studio"
|
||||
get() = KotlinUpdateBundle.message("name.android.studio")
|
||||
|
||||
// Verifies if a plugin can be installed in Android Studio 3.2+.
|
||||
// Currently used only by KotlinPluginUpdater.
|
||||
@@ -42,19 +42,24 @@ class GooglePluginUpdateVerifier : PluginUpdateVerifier() {
|
||||
val pluginCompatibility = unmarshaller.unmarshal(stream) as PluginCompatibility
|
||||
|
||||
val release = getRelease(pluginCompatibility)
|
||||
?: return PluginVerifyResult.decline("No verified versions for this build.")
|
||||
?: return PluginVerifyResult.decline(KotlinUpdateBundle.message("reason.text.no.verified.versions.for.this.build"))
|
||||
|
||||
return if (release.plugins().any { KOTLIN_PLUGIN_ID == it.id && version == it.version })
|
||||
PluginVerifyResult.accept()
|
||||
else
|
||||
PluginVerifyResult.decline("Version to be verified.")
|
||||
PluginVerifyResult.decline(KotlinUpdateBundle.message("reason.text.version.to.be.verified"))
|
||||
} catch (e: Exception) {
|
||||
LOG.info("Exception when verifying plugin ${pluginDescriptor.pluginId.idString} version $version", e)
|
||||
return when (e) {
|
||||
is IOException ->
|
||||
PluginVerifyResult.decline("unable to connect to compatibility verification repository")
|
||||
is JAXBException -> PluginVerifyResult.decline("unable to parse compatibility verification metadata")
|
||||
else -> PluginVerifyResult.decline("exception during verification ${e.message}")
|
||||
PluginVerifyResult.decline(KotlinUpdateBundle.message("reason.text.unable.to.connect.to.compatibility.verification.repository"))
|
||||
is JAXBException -> PluginVerifyResult.decline(KotlinUpdateBundle.message("reason.text.unable.to.parse.compatibility.verification.metadata"))
|
||||
else -> PluginVerifyResult.decline(
|
||||
KotlinUpdateBundle.message(
|
||||
"reason.text.exception.during.verification",
|
||||
e.message.toString()
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ import javax.xml.bind.annotation.*
|
||||
|
||||
class GooglePluginUpdateVerifier : PluginUpdateVerifier() {
|
||||
override val verifierName: String
|
||||
get() = "Android Studio"
|
||||
get() = KotlinUpdateBundle.message("name.android.studio")
|
||||
|
||||
// Verifies if a plugin can be installed in Android Studio 3.2+.
|
||||
// Currently used only by KotlinPluginUpdater.
|
||||
@@ -42,19 +42,24 @@ class GooglePluginUpdateVerifier : PluginUpdateVerifier() {
|
||||
val pluginCompatibility = unmarshaller.unmarshal(stream) as PluginCompatibility
|
||||
|
||||
val release = getRelease(pluginCompatibility)
|
||||
?: return PluginVerifyResult.decline("No verified versions for this build.")
|
||||
?: return PluginVerifyResult.decline(KotlinUpdateBundle.message("reason.text.no.verified.versions.for.this.build"))
|
||||
|
||||
return if (release.plugins().any { KOTLIN_PLUGIN_ID == it.id && version == it.version })
|
||||
PluginVerifyResult.accept()
|
||||
else
|
||||
PluginVerifyResult.decline("Version to be verified.")
|
||||
PluginVerifyResult.decline(KotlinUpdateBundle.message("reason.text.version.to.be.verified"))
|
||||
} catch (e: Exception) {
|
||||
LOG.info("Exception when verifying plugin ${pluginDescriptor.pluginId.idString} version $version", e)
|
||||
return when (e) {
|
||||
is IOException ->
|
||||
PluginVerifyResult.decline("unable to connect to compatibility verification repository")
|
||||
is JAXBException -> PluginVerifyResult.decline("unable to parse compatibility verification metadata")
|
||||
else -> PluginVerifyResult.decline("exception during verification ${e.message}")
|
||||
PluginVerifyResult.decline(KotlinUpdateBundle.message("reason.text.unable.to.connect.to.compatibility.verification.repository"))
|
||||
is JAXBException -> PluginVerifyResult.decline(KotlinUpdateBundle.message("reason.text.unable.to.parse.compatibility.verification.metadata"))
|
||||
else -> PluginVerifyResult.decline(
|
||||
KotlinUpdateBundle.message(
|
||||
"reason.text.exception.during.verification",
|
||||
e.message.toString()
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ import javax.xml.bind.annotation.*
|
||||
|
||||
class GooglePluginUpdateVerifier : PluginUpdateVerifier() {
|
||||
override val verifierName: String
|
||||
get() = "Android Studio"
|
||||
get() = KotlinUpdateBundle.message("name.android.studio")
|
||||
|
||||
// Verifies if a plugin can be installed in Android Studio 3.2+.
|
||||
// Currently used only by KotlinPluginUpdater.
|
||||
@@ -42,19 +42,24 @@ class GooglePluginUpdateVerifier : PluginUpdateVerifier() {
|
||||
val pluginCompatibility = unmarshaller.unmarshal(stream) as PluginCompatibility
|
||||
|
||||
val release = getRelease(pluginCompatibility)
|
||||
?: return PluginVerifyResult.decline("No verified versions for this build.")
|
||||
?: return PluginVerifyResult.decline(KotlinUpdateBundle.message("reason.text.no.verified.versions.for.this.build"))
|
||||
|
||||
return if (release.plugins().any { KOTLIN_PLUGIN_ID == it.id && version == it.version })
|
||||
PluginVerifyResult.accept()
|
||||
else
|
||||
PluginVerifyResult.decline("Version to be verified.")
|
||||
PluginVerifyResult.decline(KotlinUpdateBundle.message("reason.text.version.to.be.verified"))
|
||||
} catch (e: Exception) {
|
||||
LOG.info("Exception when verifying plugin ${pluginDescriptor.pluginId.idString} version $version", e)
|
||||
return when (e) {
|
||||
is IOException ->
|
||||
PluginVerifyResult.decline("unable to connect to compatibility verification repository")
|
||||
is JAXBException -> PluginVerifyResult.decline("unable to parse compatibility verification metadata")
|
||||
else -> PluginVerifyResult.decline("exception during verification ${e.message}")
|
||||
PluginVerifyResult.decline(KotlinUpdateBundle.message("reason.text.unable.to.connect.to.compatibility.verification.repository"))
|
||||
is JAXBException -> PluginVerifyResult.decline(KotlinUpdateBundle.message("reason.text.unable.to.parse.compatibility.verification.metadata"))
|
||||
else -> PluginVerifyResult.decline(
|
||||
KotlinUpdateBundle.message(
|
||||
"reason.text.exception.during.verification",
|
||||
e.message.toString()
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.update
|
||||
|
||||
import org.jetbrains.annotations.NonNls
|
||||
import org.jetbrains.annotations.PropertyKey
|
||||
import org.jetbrains.kotlin.util.AbstractKotlinBundle
|
||||
|
||||
@NonNls
|
||||
private const val BUNDLE = "messages.KotlinUpdateBundle"
|
||||
|
||||
object KotlinUpdateBundle : AbstractKotlinBundle(BUNDLE) {
|
||||
@JvmStatic
|
||||
fun message(@PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any): String = getMessage(key, *params)
|
||||
}
|
||||
Reference in New Issue
Block a user