Skip to content

Commit

Permalink
Update help page language
Browse files Browse the repository at this point in the history
  • Loading branch information
FangCunWuChang committed Feb 8, 2024
1 parent 9554fbd commit 9c2fc8f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/ui/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,11 @@ namespace utils {
}

const juce::URL getHelpPage(const juce::String& version,
const juce::String& branch) {
const juce::String& branch, const juce::String& language) {
return juce::URL{ "https://help.daw.org.cn" }
.withParameter("version", version)
.withParameter("branch", branch);
.withParameter("branch", branch)
.withParameter("language", language);
}

const juce::URL getUpdatePage(const juce::String& version,
Expand Down
4 changes: 3 additions & 1 deletion src/ui/Utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ namespace utils {
const juce::File getPluginDeadTempDir(
const juce::String& path = "./deadPlugins/");

const juce::URL getHelpPage(const juce::String& version, const juce::String& branch);
const juce::URL getHelpPage(
const juce::String& version, const juce::String& branch,
const juce::String& language);
const juce::URL getUpdatePage(const juce::String& version, const juce::String& branch);
const juce::URL getBilibiliPage();
const juce::URL getGithubPage();
Expand Down
8 changes: 7 additions & 1 deletion src/ui/menuAndCommand/GUICommandTarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "../component/ConfigWindow.h"
#include "../misc/MainThreadPool.h"
#include "../misc/Tools.h"
#include "../misc/ConfigManager.h"
#include <FlowUI.h>

juce::ApplicationCommandTarget* GUICommandTarget::getNextCommandTarget() {
Expand Down Expand Up @@ -474,8 +475,13 @@ void GUICommandTarget::openConfig(int page) const {
}

void GUICommandTarget::help() const {
/** Get Config */
auto& conf = ConfigManager::getInstance()->get("startup");
juce::String transName = conf["language"].toString();

/** Launch Page */
utils::getHelpPage(utils::getAudioPlatformVersionString(),
utils::getReleaseBranch()).launchInDefaultBrowser();
utils::getReleaseBranch(), transName).launchInDefaultBrowser();
}

void GUICommandTarget::update() const {
Expand Down

0 comments on commit 9c2fc8f

Please sign in to comment.