[IFT] Make possible to provide custom langName to get the feedback link

Sometimes feedback link suffix can differ from the language ID. For example, in C# language ID is 'C#', but link suffix is 'csharp'.

GitOrigin-RevId: 10305853a225c9bf10b5b133656137de5c1d61e0
This commit is contained in:
Konstantin Hudyakov
2023-06-28 12:00:48 +03:00
committed by intellij-monorepo-bot
parent 60a3a3ddaf
commit a146d41a4e

View File

@@ -131,9 +131,12 @@ fun isLearningProject(project: Project, languageId: String): Boolean {
}
fun getFeedbackLink(langSupport: LangSupport, ownRegistry: Boolean): String? {
val suffix = langSupport.primaryLanguage.toLowerCase()
val needToShow = Registry.`is`("ift.show.feedback.link" + if (ownRegistry) ".$suffix" else "", false)
return if (needToShow) "https://surveys.jetbrains.com/s3/features-trainer-feedback-$suffix" else null
return getFeedbackLink(langSupport.primaryLanguage.lowercase(), ownRegistry)
}
fun getFeedbackLink(langName: String, ownRegistry: Boolean): String? {
val needToShow = Registry.`is`("ift.show.feedback.link" + if (ownRegistry) ".$langName" else "", false)
return if (needToShow) "https://surveys.jetbrains.com/s3/features-trainer-feedback-$langName" else null
}
val switchOnExperimentalLessons: Boolean