mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Python: localize string
GitOrigin-RevId: 63f2e888bff6d4e9ebccf67d43c6d9a927cba900
This commit is contained in:
committed by
intellij-monorepo-bot
parent
5e098a2239
commit
3156c22dee
@@ -0,0 +1 @@
|
||||
py.system.python.service.python.is.broken=Python {0} is broken
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package com.intellij.python.community.services.systemPython.impl
|
||||
|
||||
import com.intellij.DynamicBundle
|
||||
import org.jetbrains.annotations.Nls
|
||||
import org.jetbrains.annotations.PropertyKey
|
||||
|
||||
internal object PySystemPythonBundle {
|
||||
private const val BUNDLE = "messages.PySystemPythonBundle"
|
||||
|
||||
private val INSTANCE = DynamicBundle(PySystemPythonBundle::class.java, BUNDLE)
|
||||
|
||||
fun message(key: @PropertyKey(resourceBundle = BUNDLE) String, vararg params: Any): @Nls String {
|
||||
return INSTANCE.getMessage(key, *params)
|
||||
}
|
||||
}
|
||||
+3
-1
@@ -16,6 +16,7 @@ import com.intellij.python.community.services.shared.UICustomization
|
||||
import com.intellij.python.community.services.systemPython.SystemPythonServiceImpl.MyServiceState
|
||||
import com.intellij.python.community.services.systemPython.impl.Cache
|
||||
import com.intellij.python.community.services.systemPython.impl.CoreSystemPythonProvider
|
||||
import com.intellij.python.community.services.systemPython.impl.PySystemPythonBundle
|
||||
import com.jetbrains.python.PythonBinary
|
||||
import com.jetbrains.python.Result
|
||||
import com.jetbrains.python.errorProcessing.PyResult
|
||||
@@ -63,7 +64,8 @@ internal class SystemPythonServiceImpl(scope: CoroutineScope) : SystemPythonServ
|
||||
}
|
||||
|
||||
override suspend fun registerSystemPython(pythonPath: PythonBinary): PyResult<SystemPython> {
|
||||
val pythonWithLangLevel = VanillaPythonWithLanguageLevelImpl.createByPythonBinary(pythonPath).getOr("Python {$pythonPath} is broken") { return it }
|
||||
val pythonWithLangLevel = VanillaPythonWithLanguageLevelImpl.createByPythonBinary(pythonPath)
|
||||
.getOr(PySystemPythonBundle.message("py.system.python.service.python.is.broken", pythonPath)) { return it }
|
||||
val systemPython = SystemPython(pythonWithLangLevel, null)
|
||||
state.userProvidedPythons.add(pythonPath.pathString)
|
||||
cache()?.get(pythonPath.getEelDescriptor())?.add(systemPython)
|
||||
|
||||
Reference in New Issue
Block a user