mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IJPL-157080 Simplified the getLanguageTagFromDescriptor method in Localization242
GitOrigin-RevId: 6a7157db5b55f34be3822b3b3cd537a2fbb7366d
This commit is contained in:
committed by
intellij-monorepo-bot
parent
209f58d979
commit
23e3c13432
+9
-8
@@ -47,19 +47,20 @@ internal fun enableL10nIfPluginInstalled(previousVersion: String?, oldPluginsDir
|
||||
* @param descriptor the descriptor of the plugin to be checked
|
||||
* @return `true` if the plugin is a localization plugin; `false` otherwise
|
||||
*/
|
||||
private fun isLocalizationPlugin(descriptor: IdeaPluginDescriptor): Boolean {
|
||||
private fun isLocalizationPlugin(descriptor: IdeaPluginDescriptor): Boolean {
|
||||
if (descriptor !is IdeaPluginDescriptorImpl) return false
|
||||
val extensionPoints = descriptor.epNameToExtensions
|
||||
val epName = "com.intellij.languageBundle"
|
||||
return extensionPoints.containsKey(epName)
|
||||
}
|
||||
|
||||
private fun getLanguageTagFromDescriptor(descriptor: IdeaPluginDescriptor): String? {
|
||||
if (descriptor !is IdeaPluginDescriptorImpl) return null
|
||||
val extensionPoints = descriptor.epNameToExtensions
|
||||
val epName = "com.intellij.languageBundle"
|
||||
if (extensionPoints.containsKey(epName)) {
|
||||
return extensionPoints[epName]?.firstOrNull()?.element?.attributes?.get("locale")
|
||||
private fun getLanguageTagFromDescriptor(descriptor: IdeaPluginDescriptor): String? {
|
||||
return if (isLocalizationPlugin(descriptor)) {
|
||||
val extensionPoints = (descriptor as IdeaPluginDescriptorImpl).epNameToExtensions
|
||||
val epName = "com.intellij.languageBundle"
|
||||
extensionPoints[epName]?.firstOrNull()?.element?.attributes?.get("locale")
|
||||
}
|
||||
else {
|
||||
null
|
||||
}
|
||||
return null
|
||||
}
|
||||
Reference in New Issue
Block a user