Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daniloercoli/cf6381c3bb4316bf625689a08466bbf8 to your computer and use it in GitHub Desktop.
Save daniloercoli/cf6381c3bb4316bf625689a08466bbf8 to your computer and use it in GitHub Desktop.
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