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

JabRef throws exception when started in another language with missing fxml localization #3796

Closed
Siedlerchr opened this issue Mar 2, 2018 · 4 comments
Labels
bug Confirmed bugs or reports that are very likely to be bugs build-system internationalization i18n

Comments

@Siedlerchr
Copy link
Member

Tried to test #3795
@koppor It might actually be useful to add the missing keys to other language files.


16:07:34.023 [JavaFX Application Thread] ERROR org.jabref.gui.util.ControlHelper - Problem loading fxml for control
javafx.fxml.LoadException: Resource "Close window" not found.
/E:/workspace/JabRef/jabref/bin/main/org/jabref/gui/entryeditor/EntryEditor.fxml:22

	at javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2597) ~[jfxrt.jar:?]
	at javafx.fxml.FXMLLoader.access$100(FXMLLoader.java:103) ~[jfxrt.jar:?]
	at javafx.fxml.FXMLLoader$Element.resolvePrefixedValue(FXMLLoader.java:424) ~[jfxrt.jar:?]
	at javafx.fxml.FXMLLoader$Element.processValue(FXMLLoader.java:363) ~[jfxrt.jar:?]
	at javafx.fxml.FXMLLoader$Element.processPropertyAttribute(FXMLLoader.java:325) ~[jfxrt.jar:?]
	at javafx.fxml.FXMLLoader$Element.processInstancePropertyAttributes(FXMLLoader.java:235) ~[jfxrt.jar:?]
	at javafx.fxml.FXMLLoader$ValueElement.processEndElement(FXMLLoader.java:767) ~[jfxrt.jar:?]
	at javafx.fxml.FXMLLoader.processEndElement(FXMLLoader.java:2823) ~[jfxrt.jar:?]
	at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2532) ~[jfxrt.jar:?]
	at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2441) ~[jfxrt.jar:?]
	at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2409) ~[jfxrt.jar:?]
	at org.jabref.gui.util.ControlHelper.loadFXMLForControl(ControlHelper.java:29) ~[main/:?]
	at org.jabref.gui.entryeditor.EntryEditor.<init>(EntryEditor.java:76) ~[main/:?]
@Siedlerchr Siedlerchr added bug Confirmed bugs or reports that are very likely to be bugs internationalization i18n build-system labels Mar 2, 2018
@tobiasdiez
Copy link
Member

The relevant code in the FXMLLoader is

400  } else if (aValue.startsWith(RESOURCE_KEY_PREFIX)) {
401      aValue = aValue.substring(RESOURCE_KEY_PREFIX.length());
402      if (aValue.length() == 0) {
403          throw new LoadException("Missing resource key.");
404      }
405      if (aValue.startsWith(RESOURCE_KEY_PREFIX)) {
406          // The prefix was escaped
407          warnDeprecatedEscapeSequence(RESOURCE_KEY_PREFIX);
408          return aValue;
409      } else {
410          // Resolve the resource value
411          if (resources == null) {
412              throw new LoadException("No resources specified.");
413          }
414          if (!resources.containsKey(aValue)) {
415              throw new LoadException("Resource \"" + aValue + "\" not found.");
416          }
418          return resources.getString(aValue);
419      }
420  } else if (aValue.startsWith(EXPRESSION_PREFIX)) {

Hence, as soon as the resource does not contain the language key, the load exception is thrown. There are two ways to fix this:

@Siedlerchr
Copy link
Member Author

The problem is now that the Duplication finder complains about duplicates and I think this is a problem with the merge of #3798

@koppor
Copy link
Member

koppor commented Mar 9, 2018 via email

@Siedlerchr
Copy link
Member Author

We should remove the English values from the tl property again. Then the test should be green again (git merge probably kept the English values I initially added to make Jabref work)

Siedlerchr added a commit that referenced this issue Mar 9, 2018
…drop

* upstream/maintable-beta: (24 commits)
  Fixes #3796: Pretend that we have every translation for every key (#3820)
  adjust line wrapping on column
  replace open office install selection dialog with choice dialog Wrap error messages in fx executor (because abstract worker is swing thread)
  Convert swing error dialog in save db action to custom fx dialog
  Replace swing export dialog in ExportToClipboardAction with fx choices dlg
  run find fulltext dialog in fx thread
  fix cut, copy & paste action from toolbar
  Set resizable for custom dialog with dialog pane convert merge entries dlg to javafx and make action working again
  checkstyle argh!
  Update test order -> Execute checkstyle first (#3807)
  embed cleanup dialog in javafx
  Fix some non FX Thread issues Main drawback: Cleanup panel is in backgroung due to swing thread)
  Allow search field to be smaller
  Fix Codacy Unused Params, Fields (#3753)
  Dialogstojavafx (#3801)
  Remove unused import
  Add group coloring in maintable as replacement for marked entries (#3769)
  Enable travis build for maintable-beta (#3804)
  Remove setting of tooltip manually
  Change open last edited dialgo to javafx (#3800)
  ...

# Conflicts:
#	src/main/java/org/jabref/gui/maintable/MainTable.java
Siedlerchr added a commit that referenced this issue Mar 10, 2018
…tomjfx

* upstream/maintable-beta: (28 commits)
  Fixes #3796: Pretend that we have every translation for every key (#3820)
  adjust line wrapping on column
  replace open office install selection dialog with choice dialog Wrap error messages in fx executor (because abstract worker is swing thread)
  Convert swing error dialog in save db action to custom fx dialog
  Replace swing export dialog in ExportToClipboardAction with fx choices dlg
  run find fulltext dialog in fx thread
  fix cut, copy & paste action from toolbar
  Set resizable for custom dialog with dialog pane convert merge entries dlg to javafx and make action working again
  checkstyle argh!
  Update test order -> Execute checkstyle first (#3807)
  embed cleanup dialog in javafx
  Fix some non FX Thread issues Main drawback: Cleanup panel is in backgroung due to swing thread)
  Allow search field to be smaller
  Fix Codacy Unused Params, Fields (#3753)
  Dialogstojavafx (#3801)
  Remove unused import
  Add group coloring in maintable as replacement for marked entries (#3769)
  Enable travis build for maintable-beta (#3804)
  Remove setting of tooltip manually
  Change open last edited dialgo to javafx (#3800)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed bugs or reports that are very likely to be bugs build-system internationalization i18n
Projects
None yet
Development

No branches or pull requests

3 participants