diff --git a/src/main/kotlin/translations/TranslationEditorNotificationProvider.kt b/src/main/kotlin/translations/TranslationEditorNotificationProvider.kt index d0adccaa2..161058119 100644 --- a/src/main/kotlin/translations/TranslationEditorNotificationProvider.kt +++ b/src/main/kotlin/translations/TranslationEditorNotificationProvider.kt @@ -60,16 +60,14 @@ class TranslationEditorNotificationProvider : EditorNotificationProvider { return null } - val hasDefaultTranslations = TranslationIndex.hasDefaultTranslations(project, file.mcDomain) val hasMcpModule = file.findPsiFile(project)?.findMcpModule() != null return Function { - createNotificationPanel(missingTranslations, hasDefaultTranslations, hasMcpModule, file, project) + createNotificationPanel(missingTranslations, hasMcpModule, file, project) } } private fun createNotificationPanel( missingTranslations: Sequence, - hasDefaultTranslations: Boolean, hasMcpModule: Boolean, file: VirtualFile, project: Project @@ -97,12 +95,7 @@ class TranslationEditorNotificationProvider : EditorNotificationProvider { .ask(project) if (sort) { try { - TranslationSorter.query( - project, - psi, - hasDefaultTranslations, - Ordering.LIKE_DEFAULT - ) + TranslationSorter.query(project, psi, true, Ordering.LIKE_DEFAULT) } catch (e: Exception) { Notification( "Translations sorting error", diff --git a/src/main/kotlin/translations/index/TranslationIndex.kt b/src/main/kotlin/translations/index/TranslationIndex.kt index 158c79315..8abffdd17 100644 --- a/src/main/kotlin/translations/index/TranslationIndex.kt +++ b/src/main/kotlin/translations/index/TranslationIndex.kt @@ -64,9 +64,14 @@ class TranslationIndex : FileBasedIndexExtension( getProjectDefaultEntries(project, domain).flatten() fun hasDefaultTranslations(project: Project, domain: String? = null): Boolean { - return !FileBasedIndex.getInstance().processValues(NAME, TranslationConstants.DEFAULT_LOCALE, null, { _, entry -> - return@processValues entry.sourceDomain == domain - }, GlobalSearchScope.projectScope(project)) + return !FileBasedIndex.getInstance() + .processValues( + NAME, + TranslationConstants.DEFAULT_LOCALE, + null, + { _, entry -> entry.sourceDomain != domain }, + GlobalSearchScope.projectScope(project) + ) } fun getTranslations(project: Project, file: VirtualFile): Sequence {