Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Help button to show English document when localisation is english #68

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ class OpenDocAction :
override fun isEnable(e: AnActionEvent) = true

override fun actionPerformed(e: AnActionEvent) {
val config = CodeLocatorUserConfig.loadConfig()
val docUrl = if(config.isEnglish()) {
NetUtils.DOC_URL_EN
} else {
NetUtils.DOC_URL
}
IdeaUtils.openBrowser(e.project, NetUtils.DOC_URL)
Mob.mob(Mob.Action.CLICK, Mob.Button.DOC)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,10 @@ public void setAutoFormatCode(boolean autoFormatCode) {
this.autoFormatCode = autoFormatCode;
}

public boolean isEnglish() {
return this.res == "en"
}

@NotNull
public static CodeLocatorUserConfig loadConfig() {
if (sCodeLocatorConfig != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public class NetUtils {

public static final String DOC_URL = "https://github.com/bytedance/CodeLocator/blob/main/how_to_use_codelocator_zh.md";

public static final String DOC_URL_EN = "https://github.com/bytedance/CodeLocator/blob/main/how_to_use_codelocator.md";

public static final String SERVER_URL = "https://c76297c446.goho.co/log.php";

public static final String FILE_SERVER_URL = "https://c76297c446.goho.co/upload.php";
Expand Down