[i18n github] fix more unannotated places

GitOrigin-RevId: afae6e00fc3d9837e39540bc119679ff7707aa66
This commit is contained in:
Ivan Semenov
2020-10-22 12:53:50 +00:00
committed by intellij-monorepo-bot
parent b8064a1f6c
commit 5ecdcd4f91
8 changed files with 23 additions and 54 deletions
@@ -3,6 +3,7 @@ package org.jetbrains.plugins.github.api.data.pullrequest
import com.fasterxml.jackson.annotation.JsonIgnore
import com.fasterxml.jackson.annotation.JsonProperty
import com.intellij.openapi.util.NlsSafe
import org.jetbrains.plugins.github.api.data.GHActor
import org.jetbrains.plugins.github.api.data.GHLabel
import org.jetbrains.plugins.github.api.data.GHNodes
@@ -21,7 +22,7 @@ class GHPullRequest(id: String,
@JsonProperty("labels") labels: GHNodes<GHLabel>,
viewerCanUpdate: Boolean,
viewerDidAuthor: Boolean,
val bodyHTML: String,
@NlsSafe val bodyHTML: String,
@JsonProperty("reviewRequests") reviewRequests: GHNodes<GHPullRequestReviewRequest>,
val baseRefName: String,
val baseRefOid: String,
@@ -4,6 +4,7 @@ package org.jetbrains.plugins.github.pullrequest.comment.ui
import com.intellij.icons.AllIcons
import com.intellij.ide.BrowserUtil
import com.intellij.openapi.progress.EmptyProgressIndicator
import com.intellij.openapi.util.NlsSafe
import com.intellij.ui.components.JBLabel
import com.intellij.ui.components.labels.LinkLabel
import com.intellij.util.ui.JBUI
@@ -109,7 +110,8 @@ object GHPRReviewCommentComponent {
val href = model.authorLinkUrl?.let { """href='${it}'""" }.orEmpty()
//language=HTML
val authorName = """<a $href>${model.authorUsername ?: "unknown"}</a>"""
@NlsSafe
val authorName = """<a $href>${model.authorUsername ?: GithubBundle.message("user.someone")}</a>"""
when (model.state) {
GHPullRequestReviewCommentState.PENDING -> {
@@ -2,6 +2,9 @@
package org.jetbrains.plugins.github.pullrequest.ui.timeline
import com.intellij.openapi.progress.EmptyProgressIndicator
import com.intellij.openapi.util.NlsSafe
import com.intellij.openapi.util.text.HtmlBuilder
import com.intellij.openapi.util.text.HtmlChunk
import com.intellij.ui.ColorUtil
import com.intellij.ui.components.panels.NonOpaquePanel
import com.intellij.util.ui.UI
@@ -71,10 +74,15 @@ internal object GHPRTitleComponent {
return layout(icon, title)
}
private fun getTitleBody(title: String, number: String): String {
@NlsSafe
private fun getTitleBody(@NlsSafe title: String, @NlsSafe number: String): String {
val contextHelpColorText = ColorUtil.toHtmlColor(UIUtil.getContextHelpForeground())
//language=html
return title + "&nbsp<span style='color: $contextHelpColorText'>#${number}</span>"
return HtmlBuilder()
.append(title)
.nbsp()
.append(HtmlChunk.span("color: $contextHelpColorText").addText("#${number}"))
.toString()
}
private fun layout(icon: JLabel, title: HtmlEditorPane, editButton: JComponent? = null): NonOpaquePanel {
@@ -8,6 +8,7 @@ import com.intellij.openapi.actionSystem.DefaultActionGroup
import com.intellij.openapi.application.invokeLater
import com.intellij.openapi.roots.ui.componentsList.components.ScrollablePanel
import com.intellij.openapi.util.Key
import com.intellij.openapi.util.NlsSafe
import com.intellij.openapi.vcs.ui.FontUtil
import com.intellij.ui.*
import com.intellij.ui.components.JBList
@@ -27,7 +28,6 @@ import org.jetbrains.plugins.github.i18n.GithubBundle
import org.jetbrains.plugins.github.pullrequest.ui.changes.GHPRCommitsListCellRenderer
import org.jetbrains.plugins.github.ui.util.HtmlEditorPane
import org.jetbrains.plugins.github.ui.util.SingleValueModel
import org.jetbrains.plugins.github.util.GithubUIUtil
import java.awt.Rectangle
import javax.swing.JComponent
import javax.swing.JList
@@ -153,6 +153,7 @@ internal object GHPRCommitsBrowserComponent {
return commitDetailsScrollPane
}
@NlsSafe
private fun getHashAndAuthorText(hash: String, author: GHGitActor?, committer: GHGitActor?): String {
val authorUser = createUser(author)
val authorTime = author?.date?.time ?: 0L
@@ -5,6 +5,7 @@ import com.intellij.ui.BrowserHyperlinkListener
import com.intellij.ui.components.panels.Wrapper
import com.intellij.util.ui.JBUI
import com.intellij.util.ui.UIUtil
import org.jetbrains.annotations.Nls
import org.jetbrains.plugins.github.ui.util.HtmlEditorPane
import java.awt.Cursor
import javax.swing.event.HyperlinkEvent
@@ -34,7 +35,7 @@ class HtmlInfoPanel : Wrapper() {
isVisible = false
}
fun setInfo(text: String?, severity: Severity = Severity.INFO, linkActivationListener: ((HyperlinkEvent) -> Unit)? = null) {
fun setInfo(@Nls text: String?, severity: Severity = Severity.INFO, linkActivationListener: ((HyperlinkEvent) -> Unit)? = null) {
if (text == null) {
errorPane.text = ""
currentSeverity = null
@@ -22,8 +22,6 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.plugins.github.exceptions.GithubOperationCanceledException;
import java.awt.*;
import static com.intellij.openapi.util.NlsContexts.NotificationContent;
import static com.intellij.openapi.util.NlsContexts.NotificationTitle;
import static org.jetbrains.plugins.github.util.GithubUtil.getErrorTextFromException;
@@ -175,20 +173,6 @@ public final class GithubNotifications {
NotificationListener.URL_OPENING_LISTENER);
}
public static void showInfoDialog(@Nullable Project project,
@NotificationTitle @NotNull String title,
@NotificationContent @NotNull String message) {
LOG.info(title + "; " + message);
Messages.showInfoMessage(project, message, title);
}
public static void showInfoDialog(@NotNull Component component,
@NotificationTitle @NotNull String title,
@NotificationContent @NotNull String message) {
LOG.info(title + "; " + message);
Messages.showInfoMessage(component, message, title);
}
public static void showWarningDialog(@Nullable Project project,
@NotificationTitle @NotNull String title,
@NotificationContent @NotNull String message) {
@@ -196,13 +180,6 @@ public final class GithubNotifications {
Messages.showWarningDialog(project, message, title);
}
public static void showWarningDialog(@NotNull Component component,
@NotificationTitle @NotNull String title,
@NotificationContent @NotNull String message) {
LOG.info(title + "; " + message);
Messages.showWarningDialog(component, message, title);
}
public static void showErrorDialog(@Nullable Project project,
@NotificationTitle @NotNull String title,
@NotificationContent @NotNull String message) {
@@ -210,31 +187,6 @@ public final class GithubNotifications {
Messages.showErrorDialog(project, message, title);
}
public static void showErrorDialog(@Nullable Project project,
@NotificationTitle @NotNull String title,
@NotNull Throwable e) {
LOG.warn(title, e);
if (isOperationCanceled(e)) return;
Messages.showErrorDialog(project, getErrorTextFromException(e), title);
}
public static void showErrorDialog(@NotNull Component component,
@NotificationTitle @NotNull String title,
@NotNull Throwable e) {
LOG.info(title, e);
if (isOperationCanceled(e)) return;
Messages.showErrorDialog(component, getErrorTextFromException(e), title);
}
public static void showErrorDialog(@NotNull Component component,
@NotificationTitle @NotNull String title,
@NotNull String prefix,
@NotNull Exception e) {
LOG.info(title, e);
if (isOperationCanceled(e)) return;
Messages.showErrorDialog(component, prefix + getErrorTextFromException(e), title);
}
@Messages.YesNoResult
public static boolean showYesNoDialog(@Nullable Project project,
@NotificationTitle @NotNull String title,
@@ -9,6 +9,7 @@ import com.intellij.openapi.ui.popup.JBPopupListener
import com.intellij.openapi.ui.popup.LightweightWindowEvent
import com.intellij.openapi.util.NlsActions
import com.intellij.openapi.util.NlsContexts
import com.intellij.openapi.util.NlsSafe
import com.intellij.openapi.util.Pair
import com.intellij.openapi.util.text.StringUtil
import com.intellij.openapi.vcs.changes.issueLinks.LinkMouseListenerBase
@@ -53,6 +54,7 @@ object GithubUIUtil {
GHPullRequestState.OPEN -> GithubIcons.PullRequestOpen
}
@NlsSafe
fun getPullRequestStateText(state: GHPullRequestState, isDraft: Boolean): String =
if (isDraft) GithubBundle.message("pull.request.state.draft")
else when (state) {
@@ -67,6 +69,7 @@ object GithubUIUtil {
GithubIssueState.closed -> GithubIcons.IssueClosed
}
@NlsSafe
fun getIssueStateText(state: GithubIssueState): String =
when (state) {
GithubIssueState.open -> GithubBundle.message("issue.state.open")
@@ -64,6 +64,7 @@ object GithubUtil {
}
}
@NlsSafe
@JvmStatic
fun getErrorTextFromException(e: Throwable): String {
return if (e is UnknownHostException) {