diff --git a/CMakeLists.txt b/CMakeLists.txt index b3feb8a4..329eb91e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -460,6 +460,7 @@ function(sono_add_custom_plugin_target target_name product_name formats is_instr localization/localized_pt-pt.txt localization/localized_ko.txt localization/localized_ru.txt + localization/localized_zh-hans.txt images/bar_click.wav images/beat_click.wav images/chat.svg diff --git a/Source/ChatView.cpp b/Source/ChatView.cpp index a8cc001b..42985cdc 100644 --- a/Source/ChatView.cpp +++ b/Source/ChatView.cpp @@ -648,50 +648,44 @@ void ChatView::showSaveChat() { SafePointer safeThis (this); - if (FileChooser::isPlatformDialogAvailable()) - { - File recdir; // = File::getSpecialLocation(File::userDocumentsDirectory).getChildFile("SonoBus Setups"); + File recdir; // = File::getSpecialLocation(File::userDocumentsDirectory).getChildFile("SonoBus Setups"); - // TODO - on iOS we need to give it a name first + // TODO - on iOS we need to give it a name first //#if (JUCE_IOS || JUCE_ANDROID) - String filename = String("SonoBusChat_") + Time::getCurrentTime().formatted("%Y-%m-%d_%H.%M.%S"); - recdir = File::getSpecialLocation(File::userDocumentsDirectory).getNonexistentChildFile (filename, ".txt"); + String filename = String("SonoBusChat_") + Time::getCurrentTime().formatted("%Y-%m-%d_%H.%M.%S"); + recdir = File::getSpecialLocation(File::userDocumentsDirectory).getNonexistentChildFile (filename, ".txt"); //#endif - mFileChooser.reset(new FileChooser(TRANS("Choose a location and name to store the setup"), - recdir, - "*.txt", - true, false, getTopLevelComponent())); + mFileChooser.reset(new FileChooser(TRANS("Choose a location and name to store the setup"), + recdir, + "*.txt", + true, false, getTopLevelComponent())); - mFileChooser->launchAsync (FileBrowserComponent::saveMode | FileBrowserComponent::doNotClearFileNameOnRootChange, - [safeThis] (const FileChooser& chooser) mutable - { - auto results = chooser.getURLResults(); - if (safeThis != nullptr && results.size() > 0) - { - auto url = results.getReference (0); + mFileChooser->launchAsync (FileBrowserComponent::saveMode | FileBrowserComponent::doNotClearFileNameOnRootChange, + [safeThis] (const FileChooser& chooser) mutable + { + auto results = chooser.getURLResults(); + if (safeThis != nullptr && results.size() > 0) + { + auto url = results.getReference (0); - DBG("Chose file to save chat: " << url.toString(false)); + DBG("Chose file to save chat: " << url.toString(false)); - if (url.isLocalFile()) { - File lfile = url.getLocalFile(); + if (url.isLocalFile()) { + File lfile = url.getLocalFile(); - lfile.replaceWithText(safeThis->mChatTextEditor->getText()); - } + lfile.replaceWithText(safeThis->mChatTextEditor->getText()); } + } - if (safeThis) { - safeThis->mFileChooser.reset(); - } + if (safeThis) { + safeThis->mFileChooser.reset(); + } - }, nullptr); + }, nullptr); - } - else { - DBG("Need to enable code signing"); - } } diff --git a/Source/ConnectView.cpp b/Source/ConnectView.cpp index 89d3e0e4..e4cad099 100644 --- a/Source/ConnectView.cpp +++ b/Source/ConnectView.cpp @@ -819,7 +819,7 @@ void ConnectView::publicGroupLogin() DBG("Public host enter pressed"); // parse it StringArray toks = StringArray::fromTokens(hostport, ":", ""); - String host = "aoo.sonobus.net"; + String host = DEFAULT_SERVER_HOST; int port = DEFAULT_SERVER_PORT; if (toks.size() >= 1) { @@ -866,7 +866,7 @@ bool ConnectView::copyInfoToClipboard(bool singleURL, String * retmessage) String hostport = mServerHostEditor->getText(); if (hostport.isEmpty()) { - hostport = "aoo.sonobus.net"; + hostport = DEFAULT_SERVER_HOST; } String groupName; @@ -1028,7 +1028,7 @@ void ConnectView::buttonClicked (Button* buttonThatWasClicked) // parse it StringArray toks = StringArray::fromTokens(hostport, ":", ""); - String host = "aoo.sonobus.net"; + String host = DEFAULT_SERVER_HOST; int port = DEFAULT_SERVER_PORT; if (toks.size() >= 1) { @@ -1059,7 +1059,7 @@ void ConnectView::buttonClicked (Button* buttonThatWasClicked) // parse it StringArray toks = StringArray::fromTokens(hostport, ":", ""); - String host = "aoo.sonobus.net"; + String host = DEFAULT_SERVER_HOST; int port = DEFAULT_SERVER_PORT; if (toks.size() >= 1) { @@ -1557,7 +1557,9 @@ void ConnectView::RecentsListModel::paintListBoxItem (int rowNumber, Graphics &g float iconsize = height*yratio; float groupheight = height*yratio; g.drawImageWithin(groupImage, 0, 0, iconsize, iconsize, RectanglePlacement::fillDestination); - g.drawFittedText (info.groupName, iconsize + 4, 0, adjwidth*xratio - 8 - iconsize, groupheight, Justification::centredLeft, true); + String grouptext; + grouptext << (info.groupIsPublic ? TRANS("[P] ") : "") << info.groupName; + g.drawFittedText (grouptext, iconsize + 4, 0, adjwidth*xratio - 8 - iconsize, groupheight, Justification::centredLeft, true); g.setFont (parent->recentsNameFont); g.setColour (parent->findColour(nameTextColourId).withAlpha(0.8f)); @@ -1576,7 +1578,7 @@ void ConnectView::RecentsListModel::paintListBoxItem (int rowNumber, Graphics &g infostr += TRANS("on") + " " + Time(info.timestamp).toString(true, true, false) + " " ; - if (info.serverHost != "aoo.sonobus.net") { + if (info.serverHost != DEFAULT_SERVER_HOST) { infostr += TRANS("to") + " " + info.serverHost; } diff --git a/Source/OptionsView.cpp b/Source/OptionsView.cpp index a05fff96..acb82f4e 100644 --- a/Source/OptionsView.cpp +++ b/Source/OptionsView.cpp @@ -56,8 +56,9 @@ void OptionsView::initializeLanguages() languages.add(TRANS("Korean")); languagesNative.add("Korean"); codes.add("ko"); // TODO fix and use above when we have a font that can display this all the time languages.add(TRANS("Russian")); languagesNative.add(juce::CharPointer_UTF8 ("p\xd1\x83\xd1\x81\xd1\x81\xd0\xba\xd0\xb8\xd0\xb9")); codes.add("ru"); - //languages.add(TRANS("Chinese (Simplified)")); languagesNative.add(CharPointer_UTF8 ("\xe4\xb8\xad\xe6\x96\x87\xef\xbc\x88\xe7\xae\x80\xe4\xbd\x93\xef\xbc\x89")); codes.add("zh_hans"); - //languages.add(TRANS("Chinese (Traditional)")); languagesNative.add(CharPointer_UTF8 ("\xe4\xb8\xad\xe6\x96\x87\xef\xbc\x88\xe7\xb9\x81\xe9\xab\x94\xef\xbc\x89")); codes.add("zh_hant"); + languages.add(TRANS("Chinese (Simplified)")); languagesNative.add("Chinese (Simplified)"); codes.add("zh-hans"); + //languages.add(TRANS("Chinese (Simplified)")); languagesNative.add(CharPointer_UTF8 ("\xe4\xb8\xad\xe6\x96\x87\xef\xbc\x88\xe7\xae\x80\xe4\xbd\x93\xef\xbc\x89")); codes.add("zh_hans");languages.add(TRANS("Chinese (Simplified)")); languagesNative.add(CharPointer_UTF8 ("\xe4\xb8\xad\xe6\x96\x87\xef\xbc\x88\xe7\xae\x80\xe4\xbd\x93\xef\xbc\x89")); codes.add("zh-hans"); + //languages.add(TRANS("Chinese (Traditional)")); languagesNative.add(CharPointer_UTF8 ("\xe4\xb8\xad\xe6\x96\x87\xef\xbc\x88\xe7\xb9\x81\xe9\xab\x94\xef\xbc\x89")); codes.add("zh-hant"); // TOOD - parse any user files with localized_%s.txt in our settings folder and add as options if not existing already @@ -331,11 +332,7 @@ OptionsView::OptionsView(SonobusAudioProcessor& proc, std::function("", TRANS("Version: ") + String(SONOBUS_BUILD_VERSION)); // temporary -#else mVersionLabel = std::make_unique