Created
August 8, 2019 07:59
-
-
Save daniloercoli/cf6381c3bb4316bf625689a08466bbf8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/libs/editor/WordPressEditor/src/main/java/org/wordpress/android/editor/GutenbergEditorFragment.java b/libs/editor/WordPressEditor/src/main/java/org/wordpress/android/editor/GutenbergEditorFragment.java | |
index 790e3566a7..74eeaf60e4 100644 | |
--- a/libs/editor/WordPressEditor/src/main/java/org/wordpress/android/editor/GutenbergEditorFragment.java | |
+++ b/libs/editor/WordPressEditor/src/main/java/org/wordpress/android/editor/GutenbergEditorFragment.java | |
@@ -121,19 +121,17 @@ public class GutenbergEditorFragment extends EditorFragmentAbstract implements | |
Bundle translations = new Bundle(); | |
Locale defaultLocale = new Locale("en"); | |
Resources currentResources = getActivity().getResources(); | |
- Context localizedContextCurrent = getActivity() | |
- .createConfigurationContext(currentResources.getConfiguration()); | |
+ Configuration currentConfiguration = currentResources.getConfiguration(); | |
// if the current locale of the app is english stop here and return an empty map | |
- Configuration currentConfiguration = localizedContextCurrent.getResources().getConfiguration(); | |
if (currentConfiguration.locale.equals(defaultLocale)) { | |
return translations; | |
} | |
// Let's create a Resources object for the default locale (english) to get the original values for our strings | |
- Configuration defaultLocaleConfiguration = new Configuration(currentConfiguration); | |
- defaultLocaleConfiguration.setLocale(defaultLocale); | |
+ Configuration defaultENLocaleConfiguration = new Configuration(currentConfiguration); | |
+ defaultENLocaleConfiguration.setLocale(defaultLocale); | |
Context localizedContextDefault = getActivity() | |
- .createConfigurationContext(defaultLocaleConfiguration); | |
+ .createConfigurationContext(defaultENLocaleConfiguration); | |
Resources defaultResources = localizedContextDefault.getResources(); | |
// Strings are only being translated in the WordPress package |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment