Skip to content

Commit

Permalink
Merge pull request #111 from marhali/feat/next
Browse files Browse the repository at this point in the history
Feat/next
  • Loading branch information
marhali authored Apr 22, 2022
2 parents bad6c27 + 1c28da4 commit 18868c8
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

### Fixed
- AlreadyDisposedException on FileChangeListener after project dispose
- Request-URL limit for error reports

## [3.2.0]
### Added
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ This plugin can be used for any project based on one of the formats and structur
- UI Tool-Window which supports _tree-view_ and _table-view_
- Easily **`Add`** / **`Edit`** / **`Delete`** translations
- Filter all translations with _full-text-search_ support
- Editor Assistance: Key completion, annotation and referencing
- Editor Assistance: translation intention, completion-contributor, key-annotation and -folding
- Translation key sorting and nesting can be configured
- Configurable locales directory & preferred locale for ui presentation
- Extensive configuration options: locales directory, preferred locale, key delimiters
- Missing language translations will be indicated red
- Automatically reloads translation data if any locale file was changed

Expand All @@ -48,6 +48,9 @@ This plugin can be used for any project based on one of the formats and structur
- Modularized (**<kbd>Locale</kbd>** \ **<kbd>Namespace</kbd>**)
- Modularized (**<kbd>Namespace</kbd>** \ **<kbd>Locale</kbd>**)

### Language Support
**<kbd>JavaScript / TypeScript</kbd>** - **<kbd>Vue</kbd>** - **<kbd>Java</kbd>** - **<kbd>Kotlin</kbd>** - **<kbd>PHP</kbd>**

<!-- Plugin description end -->

## Installation
Expand Down
Binary file modified example/images/settings.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 18 additions & 2 deletions src/main/java/de/marhali/easyi18n/service/ErrorReportHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@

import com.intellij.ide.BrowserUtil;
import com.intellij.ide.DataManager;
import com.intellij.ide.plugins.IdeaPluginDescriptor;
import com.intellij.ide.plugins.PluginManagerCore;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.diagnostic.ErrorReportSubmitter;
import com.intellij.openapi.diagnostic.IdeaLoggingEvent;
import com.intellij.openapi.diagnostic.SubmittedReportInfo;
import com.intellij.openapi.extensions.PluginId;
import com.intellij.openapi.progress.ProgressIndicator;
import com.intellij.openapi.progress.Task;
import com.intellij.openapi.project.Project;
Expand Down Expand Up @@ -45,7 +48,14 @@ public boolean submit(IdeaLoggingEvent @NotNull [] events, @Nullable String addi
DataContext context = mgr.getDataContext(parentComponent);
Project project = CommonDataKeys.PROJECT.getData(context);

String title = "IDE Error Report";
if(additionalInfo == null) {
additionalInfo = "/";
}

IdeaPluginDescriptor plugin = PluginManagerCore.getPlugin(PluginId.getId("de.marhali.easyi18n"));
String version = plugin != null ? plugin.getVersion() : "???";

String title = "IDE Error Report (v" + version + ")";
String labels = "ide report";
String body = "# Additional information\n"
+ additionalInfo + "\n"
Expand All @@ -58,10 +68,16 @@ public boolean submit(IdeaLoggingEvent @NotNull [] events, @Nullable String addi
String url = "https://github.com/marhali/easy-i18n/issues/new?title="
+ encodeParam(title) + "&labels=" + encodeParam(labels) + "&body=" + encodeParam(body);

if(url.length() > 8201) { // Consider github request url limit
url = url.substring(0, 8201);
}

String finalUrl = url;

new Task.Backgroundable(project, "Sending error report") {
@Override
public void run(@NotNull ProgressIndicator indicator) {
BrowserUtil.browse(url);
BrowserUtil.browse(finalUrl);

ApplicationManager.getApplication().invokeLater(() ->
consumer.consume(new SubmittedReportInfo(SubmittedReportInfo.SubmissionStatus.NEW_ISSUE)));
Expand Down

0 comments on commit 18868c8

Please sign in to comment.