From bba39a5337de39f14cff1923a2886ab753f2a4a1 Mon Sep 17 00:00:00 2001 From: cyian-1756 Date: Thu, 10 May 2018 12:42:15 -0400 Subject: [PATCH] Added getResourceBundle func --- .../java/com/rarchives/ripme/utils/Utils.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/rarchives/ripme/utils/Utils.java b/src/main/java/com/rarchives/ripme/utils/Utils.java index 9517c528..156c6ac0 100644 --- a/src/main/java/com/rarchives/ripme/utils/Utils.java +++ b/src/main/java/com/rarchives/ripme/utils/Utils.java @@ -1,9 +1,6 @@ package com.rarchives.ripme.utils; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.io.UnsupportedEncodingException; +import java.io.*; import java.lang.reflect.Constructor; import java.net.URISyntaxException; import java.net.URL; @@ -579,4 +576,14 @@ public class Utils { } return domainCookies; } + + public static ResourceBundle getResourceBundle() { + try { + ResourceBundle rb = ResourceBundle.getBundle("LabelsBundle", Locale.getDefault()); + return rb; + } catch (MissingResourceException e) { + ResourceBundle rb = ResourceBundle.getBundle("LabelsBundle", Locale.ROOT); + return rb; + } + } }