From 0f979efa51345cfd022422a26d7c2f5f705a2199 Mon Sep 17 00:00:00 2001 From: Hossam Hassan Date: Mon, 30 Jan 2017 19:29:36 +0200 Subject: [PATCH] Add missed switch case keywords --- .../RNInstabugReactnativeModule.java | 70 ++++++++++--------- 1 file changed, 36 insertions(+), 34 deletions(-) diff --git a/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java b/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java index 5c7851c..a6b71e0 100644 --- a/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java +++ b/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java @@ -432,40 +432,42 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule { private Locale getLocaleByKey(String instabugLocale) { String localeInLowerCase = instabugLocale.toLowerCase(); - case LOCALE_ARABIC: - return new Locale(InstabugLocale.ARABIC.getCode(), InstabugLocale.ARABIC.getCountry()); - case LOCALE_ENGLISH: - return new Locale(InstabugLocale.ENGLISH.getCode(), InstabugLocale.ENGLISH.getCountry()); - case LOCALE_CZECH: - return new Locale(InstabugLocale.CZECH.getCode(), InstabugLocale.CZECH.getCountry()); - case LOCALE_FRENCH: - return new Locale(InstabugLocale.FRENCH.getCode(), InstabugLocale.FRENCH.getCountry()); - case LOCALE_GERMAN: - return new Locale(InstabugLocale.GERMAN.getCode(), InstabugLocale.GERMAN.getCountry()); - case LOCALE_ITALIAN: - return new Locale(InstabugLocale.ITALIAN.getCode(), InstabugLocale.ITALIAN.getCountry()); - case LOCALE_JAPANESE: - return new Locale(InstabugLocale.JAPANESE.getCode(), InstabugLocale.JAPANESE.getCountry()); - case LOCALE_POLISH: - return new Locale(InstabugLocale.POLISH.getCode(), InstabugLocale.POLISH.getCountry()); - case LOCALE_RUSSIAN: - return new Locale(InstabugLocale.RUSSIAN.getCode(), InstabugLocale.RUSSIAN.getCountry()); - case LOCALE_SPANISH: - return new Locale(InstabugLocale.SPANISH.getCode(), InstabugLocale.SPANISH.getCountry()); - case LOCALE_SWEDISH: - return new Locale(InstabugLocale.SWEDISH.getCode(), InstabugLocale.SWEDISH.getCountry()); - case LOCALE_TURKISH: - return new Locale(InstabugLocale.TURKISH.getCode(), InstabugLocale.TURKISH.getCountry()); - case LOCALE_PORTUGUESE_BRAZIL: - return new Locale(InstabugLocale.PORTUGUESE_BRAZIL.getCode(), InstabugLocale.PORTUGUESE_BRAZIL.getCountry()); - case LOCALE_CHINESE_SIMPLIFIED: - return new Locale(InstabugLocale.SIMPLIFIED_CHINESE.getCode(), InstabugLocale.SIMPLIFIED_CHINESE.getCountry()); - case LOCALE_CHINESE_TRADITIONAL: - return new Locale(InstabugLocale.TRADITIONAL_CHINESE.getCode(), InstabugLocale.TRADITIONAL_CHINESE.getCountry()); - case LOCALE_KOREAN: - return new Locale(InstabugLocale.KOREAN.getCode(), InstabugLocale.KOREAN.getCountry()); - default: - return new Locale(InstabugLocale.ENGLISH.getCode(), InstabugLocale.ENGLISH.getCountry()); + switch (localeInLowerCase) { + case LOCALE_ARABIC: + return new Locale(InstabugLocale.ARABIC.getCode(), InstabugLocale.ARABIC.getCountry()); + case LOCALE_ENGLISH: + return new Locale(InstabugLocale.ENGLISH.getCode(), InstabugLocale.ENGLISH.getCountry()); + case LOCALE_CZECH: + return new Locale(InstabugLocale.CZECH.getCode(), InstabugLocale.CZECH.getCountry()); + case LOCALE_FRENCH: + return new Locale(InstabugLocale.FRENCH.getCode(), InstabugLocale.FRENCH.getCountry()); + case LOCALE_GERMAN: + return new Locale(InstabugLocale.GERMAN.getCode(), InstabugLocale.GERMAN.getCountry()); + case LOCALE_ITALIAN: + return new Locale(InstabugLocale.ITALIAN.getCode(), InstabugLocale.ITALIAN.getCountry()); + case LOCALE_JAPANESE: + return new Locale(InstabugLocale.JAPANESE.getCode(), InstabugLocale.JAPANESE.getCountry()); + case LOCALE_POLISH: + return new Locale(InstabugLocale.POLISH.getCode(), InstabugLocale.POLISH.getCountry()); + case LOCALE_RUSSIAN: + return new Locale(InstabugLocale.RUSSIAN.getCode(), InstabugLocale.RUSSIAN.getCountry()); + case LOCALE_SPANISH: + return new Locale(InstabugLocale.SPANISH.getCode(), InstabugLocale.SPANISH.getCountry()); + case LOCALE_SWEDISH: + return new Locale(InstabugLocale.SWEDISH.getCode(), InstabugLocale.SWEDISH.getCountry()); + case LOCALE_TURKISH: + return new Locale(InstabugLocale.TURKISH.getCode(), InstabugLocale.TURKISH.getCountry()); + case LOCALE_PORTUGUESE_BRAZIL: + return new Locale(InstabugLocale.PORTUGUESE_BRAZIL.getCode(), InstabugLocale.PORTUGUESE_BRAZIL.getCountry()); + case LOCALE_CHINESE_SIMPLIFIED: + return new Locale(InstabugLocale.SIMPLIFIED_CHINESE.getCode(), InstabugLocale.SIMPLIFIED_CHINESE.getCountry()); + case LOCALE_CHINESE_TRADITIONAL: + return new Locale(InstabugLocale.TRADITIONAL_CHINESE.getCode(), InstabugLocale.TRADITIONAL_CHINESE.getCountry()); + case LOCALE_KOREAN: + return new Locale(InstabugLocale.KOREAN.getCode(), InstabugLocale.KOREAN.getCountry()); + default: + return new Locale(InstabugLocale.ENGLISH.getCode(), InstabugLocale.ENGLISH.getCountry()); + } } @Override