{"action":"created","issue":{"url":"https://api.github.com/repos/morinted/Bozzy/issues/58","repository_url":"https://api.github.com/repos/morinted/Bozzy","labels_url":"https://api.github.com/repos/morinted/Bozzy/issues/58/labels{/name}","comments_url":"https://api.github.com/repos/morinted/Bozzy/issues/58/comments","events_url":"https://api.github.com/repos/morinted/Bozzy/issues/58/events","html_url":"https://github.com/morinted/Bozzy/pull/58","id":148869004,"number":58,"title":"Resource bundle","user":{"login":"sofa13","id":9827185,"avatar_url":"https://avatars.githubusercontent.com/u/9827185?v=3","gravatar_id":"","url":"https://api.github.com/users/sofa13","html_url":"https://github.com/sofa13","followers_url":"https://api.github.com/users/sofa13/followers","following_url":"https://api.github.com/users/sofa13/following{/other_user}","gists_url":"https://api.github.com/users/sofa13/gists{/gist_id}","starred_url":"https://api.github.com/users/sofa13/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sofa13/subscriptions","organizations_url":"https://api.github.com/users/sofa13/orgs","repos_url":"https://api.github.com/users/sofa13/repos","events_url":"https://api.github.com/users/sofa13/events{/privacy}","received_events_url":"https://api.github.com/users/sofa13/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-16T16:46:30Z","updated_at":"2016-04-16T18:29:25Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/morinted/Bozzy/pulls/58","html_url":"https://github.com/morinted/Bozzy/pull/58","diff_url":"https://github.com/morinted/Bozzy/pull/58.diff","patch_url":"https://github.com/morinted/Bozzy/pull/58.patch"},"body":"- add resource.properties file to resources/bundle folder\r\n- include PropertyResourceBundle (could not find scala equiv, used java.util.PropertyResourceBundle)\r\n- replace all text with strings from resource file"},"comment":{"url":"https://api.github.com/repos/morinted/Bozzy/issues/comments/210869261","html_url":"https://github.com/morinted/Bozzy/pull/58#issuecomment-210869261","issue_url":"https://api.github.com/repos/morinted/Bozzy/issues/58","id":210869261,"user":{"login":"morinted","id":5840970,"avatar_url":"https://avatars.githubusercontent.com/u/5840970?v=3","gravatar_id":"","url":"https://api.github.com/users/morinted","html_url":"https://github.com/morinted","followers_url":"https://api.github.com/users/morinted/followers","following_url":"https://api.github.com/users/morinted/following{/other_user}","gists_url":"https://api.github.com/users/morinted/gists{/gist_id}","starred_url":"https://api.github.com/users/morinted/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/morinted/subscriptions","organizations_url":"https://api.github.com/users/morinted/orgs","repos_url":"https://api.github.com/users/morinted/repos","events_url":"https://api.github.com/users/morinted/events{/privacy}","received_events_url":"https://api.github.com/users/morinted/received_events","type":"User","site_admin":false},"created_at":"2016-04-16T18:29:25Z","updated_at":"2016-04-16T18:29:25Z","body":"Some adjustments (that you can apply with `git apply`\r\n\r\n```diff\r\ndiff --git a/src/main/scala/bozzy/Bozzy.scala b/src/main/scala/bozzy/Bozzy.scala\r\nindex 2650c7f..c74ae67 100644\r\n--- a/src/main/scala/bozzy/Bozzy.scala\r\n+++ b/src/main/scala/bozzy/Bozzy.scala\r\n@@ -9,10 +9,9 @@ import scalafx.Includes._\r\n import scalafx.application.JFXApp\r\n import scalafx.application.JFXApp.PrimaryStage\r\n import scalafx.scene.Scene\r\n-import scalafx.scene.input.{TransferMode, DragEvent}\r\n+import scalafx.scene.input.{DragEvent, TransferMode}\r\n import scalafx.scene.text.Font\r\n-import scalafxml.core.{NoDependencyResolver, FXMLView, FXMLLoader}\r\n-import javafx.{scene => jfxs}\r\n+import scalafxml.core.{FXMLLoader, NoDependencyResolver}\r\n \r\n /**\r\n   * Created by ted on 2016-04-06.\r\n@@ -23,20 +22,21 @@ object Bozzy extends JFXApp {\r\n     14\r\n   )\r\n \r\n-  val resource = getClass.getResource(\"/view/Main.fxml\")\r\n-  val bundle = new PropertyResourceBundle(getClass.getResource(\"/bundle/Resources.properties\").openStream)\r\n-  if (resource == null) {\r\n+  val main = getClass.getResource(\"/view/Main.fxml\")\r\n+  val i18n = new PropertyResourceBundle(getClass.getResource(\"/bundle/Resources.properties\").openStream)\r\n+  if (main == null) {\r\n     throw new FileNotFoundException(\"Cannot load resource: /view/Main.fxml\")\r\n   }\r\n-  if (bundle == null) {\r\n+  if (i18n == null) {\r\n     throw new FileNotFoundException(\"Cannot load resource: /bundle/Resources.properties\")\r\n   }\r\n-  val loader: FXMLLoader = new FXMLLoader(resource, NoDependencyResolver)\r\n-  loader.setResources(bundle)\r\n-  val root = loader.load[jfxs.Parent]\r\n+  val loader = new FXMLLoader(main, NoDependencyResolver) {\r\n+    setResources(i18n)\r\n+  }\r\n+  val root = loader.load[javafx.scene.Parent]\r\n \r\n   stage = new PrimaryStage() {\r\n-    title = bundle.getString(\"applicationTitle\")\r\n+    title = i18n.getString(\"applicationTitle\")\r\n     scene = new Scene(root) {\r\n       stylesheets = List(getClass.getResource(\"/css/style.css\").toExternalForm)\r\n       onDragOver = (event: DragEvent) => {\r\ndiff --git a/src/main/scala/bozzy/controllers/DictionaryListController.scala b/src/main/scala/bozzy/controllers/DictionaryListController.scala\r\nindex e727d33..f967eba 100644\r\n--- a/src/main/scala/bozzy/controllers/DictionaryListController.scala\r\n+++ b/src/main/scala/bozzy/controllers/DictionaryListController.scala\r\n@@ -7,23 +7,21 @@ package bozzy.controllers\r\n \r\n import java.util.PropertyResourceBundle\r\n \r\n+import bozzy.Bozzy\r\n+\r\n import scalafx.event.ActionEvent\r\n import scalafx.scene.control.ListView\r\n import scalafx.stage.FileChooser\r\n import scalafx.stage.FileChooser.ExtensionFilter\r\n import scalafxml.core.macros.sfxml\r\n-\r\n import bozzy.steno.StenoDictionary\r\n \r\n @sfxml\r\n class DictionaryListController (private val dictionary_list: ListView[StenoDictionary]) {\r\n-\r\n-  val bundle = new PropertyResourceBundle(getClass.getResource(\"/bundle/Resources.properties\").openStream)\r\n-\r\n   dictionary_list.items = MainDictionary.openDictionaries\r\n   def handleAdd (event: ActionEvent) {\r\n     val fileChooser = new FileChooser {\r\n-      title = bundle.getString(\"openResourceFileTitle\")\r\n+      title = Bozzy.i18n.getString(\"openResourceFileTitle\")\r\n       extensionFilters.add(\r\n         new ExtensionFilter(\"Steno Dictionaries\", Seq(\"*.json\", \"*.rtf\"))\r\n       )\r\ndiff --git a/src/main/scala/bozzy/controllers/FilterPaneController.scala b/src/main/scala/bozzy/controllers/FilterPaneController.scala\r\nindex ad79356..909bafe 100644\r\n--- a/src/main/scala/bozzy/controllers/FilterPaneController.scala\r\n+++ b/src/main/scala/bozzy/controllers/FilterPaneController.scala\r\n@@ -2,6 +2,8 @@ package bozzy.controllers\r\n \r\n import java.util.PropertyResourceBundle\r\n \r\n+import bozzy.Bozzy\r\n+\r\n import scala.math.Ordering.StringOrdering\r\n import scalafx.collections.ObservableBuffer\r\n import scalafx.collections.transformation.SortedBuffer\r\n@@ -10,8 +12,7 @@ import scalafx.scene.control.SpinnerValueFactory.ListSpinnerValueFactory\r\n import scalafx.scene.control._\r\n import scalafx.util.StringConverter\r\n import scalafxml.core.macros.sfxml\r\n-\r\n-import bozzy.steno.{StenoDictionary, DictionaryEntry}\r\n+import bozzy.steno.{DictionaryEntry, StenoDictionary}\r\n \r\n /**\r\n  * Created by Ian on 2/10/2016.\r\n@@ -25,14 +26,13 @@ class FilterPaneController (private val filterLabel: Label,\r\n                             private val wordCount: Spinner[String],\r\n                             private val collisions_checkbox: CheckBox,\r\n                             private val hide_duplicates_checkbox: CheckBox) {\r\n-  val bundle = new PropertyResourceBundle(getClass.getResource(\"/bundle/Resources.properties\").openStream)\r\n   dictionary_box.items = new SortedBuffer[String](MainDictionary.dictionaryFilterChoices) {\r\n     comparator = new StringOrdering {\r\n-      val anyOption = bundle.getString(\"anyDictionaryOption\")\r\n+      val anyOption = Bozzy.i18n.getString(\"anyDictionaryOption\")\r\n       override def compare(x: String, y: String) =\r\n         (x, y) match {\r\n-          case (anyOption, _) => -1\r\n-          case (_, anyOption) => 1\r\n+          case (`anyOption`, _) => -1\r\n+          case (_, `anyOption`) => 1\r\n           case _ => super.compare(x, y)\r\n         }\r\n       }\r\n@@ -43,7 +43,7 @@ class FilterPaneController (private val filterLabel: Label,\r\n   chordCount.setValueFactory(new ListSpinnerValueFactory[String](choicesWithoutZero))\r\n   wordCount.setValueFactory(new ListSpinnerValueFactory[String](choicesWithZero))\r\n \r\n-  val filterTitle = bundle.getString(\"filterTitle\")\r\n+  val filterTitle = Bozzy.i18n.getString(\"filterTitle\")\r\n   MainDictionary.filteredEntries.onChange((source, changes) =>\r\n     filterLabel.text = filterTitle + s\" (${source.size}/${MainDictionary.allEntries.size})\"\r\n   )\r\ndiff --git a/src/main/scala/bozzy/controllers/MainController.scala b/src/main/scala/bozzy/controllers/MainController.scala\r\nindex fafe0bf..4970613 100644\r\n--- a/src/main/scala/bozzy/controllers/MainController.scala\r\n+++ b/src/main/scala/bozzy/controllers/MainController.scala\r\n@@ -4,7 +4,9 @@\r\n \r\n package bozzy.controllers\r\n \r\n-import java.util.{PropertyResourceBundle}\r\n+import java.util.PropertyResourceBundle\r\n+\r\n+import bozzy.Bozzy\r\n \r\n import scala.collection.mutable.ListBuffer\r\n import scalafx.collections.ObservableBuffer\r\n@@ -14,19 +16,17 @@ import scalafx.stage.FileChooser\r\n import scalafx.stage.FileChooser.ExtensionFilter\r\n import scalafx.application.Platform\r\n import scalafxml.core.macros.sfxml\r\n-\r\n-import bozzy.steno.{DictionaryEntry, StenoDictionary, DictionaryFormat}\r\n+import bozzy.steno.{DictionaryEntry, DictionaryFormat, StenoDictionary}\r\n \r\n @sfxml\r\n class MainController {\r\n-  val bundle = new PropertyResourceBundle(getClass.getResource(\"/bundle/Resources.properties\").openStream)\r\n \r\n   def handleButtonPress(event: ActionEvent) {\r\n   }\r\n \r\n   def handleOpen(event: ActionEvent) {\r\n     val fileChooser = new FileChooser {\r\n-      title = bundle.getString(\"openResourceFileTitle\")\r\n+      title = Bozzy.i18n.getString(\"openResourceFileTitle\")\r\n       extensionFilters.add(\r\n         new ExtensionFilter(\"Steno Dictionaries\", Seq(\"*.json\", \"*.rtf\"))\r\n       )\r\n@@ -46,10 +46,9 @@ class MainController {\r\n }\r\n \r\n object MainDictionary {\r\n-  val bundle = new PropertyResourceBundle(getClass.getResource(\"/bundle/Resources.properties\").openStream)\r\n   val openDictionaryNames = new ObservableBuffer[String]\r\n   val dictionaryFilterChoices = new ObservableBuffer[String]\r\n-  dictionaryFilterChoices add bundle.getString(\"anyDictionaryOption\")\r\n+  dictionaryFilterChoices add Bozzy.i18n.getString(\"anyDictionaryOption\")\r\n \r\n   val openDictionaries = new ObservableBuffer[StenoDictionary]\r\n   val allEntries = new ObservableBuffer[DictionaryEntry]\r\n```"}}