Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
26806d3
Give the translations to gutenberg as a param
Tug Feb 11, 2019
882ef91
Fix context not attached to fragment
Tug Feb 14, 2019
154d11d
Pass down the locale to gutenberg-mobile
Tug Feb 14, 2019
af7cb42
Merge remote-tracking branch 'origin/develop' into update/send-gutenb…
Tug Feb 19, 2019
ba2e6f0
Merge remote-tracking branch 'origin/develop' into update/send-gutenb…
Tug Feb 19, 2019
c575a52
Update libs/gutenberg-mobile ref
Tug Feb 19, 2019
4d5096c
Update Aztec ref and wrap translation values in an array
Tug Feb 19, 2019
4a94466
Get the locale slug from the app settings instead and support locales…
Tug Feb 19, 2019
c1bb23a
Update gutenberg-mobile ref
Tug Feb 19, 2019
013186d
Filter out non-gutenberg mobile related strings
Tug Feb 20, 2019
644579d
Log error instead of printing stacktrace
Tug Feb 20, 2019
ac433d6
Update gutenberg-mobile ref after merge from develop
Tug Feb 20, 2019
444bc1e
Load resource class from the main package using the Application class…
Tug Feb 20, 2019
90c591e
Make sure Package is not null
Tug Feb 21, 2019
dd1f1da
Update gutenberg-mobile ref
Tug Feb 21, 2019
fdf04b6
Fix spacing lint issue
Tug Feb 21, 2019
3afa68e
Fix more lint issues
Tug Feb 21, 2019
41ddfaa
Fix more lint issues
Tug Feb 21, 2019
90fcc93
Fix more lint issues
Tug Feb 21, 2019
5508ee5
Fix more lint issues
Tug Feb 21, 2019
4f4c1d1
Update gutenberg-mobile ref
Tug Feb 21, 2019
63498b1
Merge remote-tracking branch 'origin/develop' into update/send-gutenb…
Tug Feb 21, 2019
fd308ea
Update gutenberg-mobile ref
Tug Feb 21, 2019
2407b09
Add comments to getTranslations
Tug Feb 21, 2019
2b10286
Update gutenberg-mobile ref
Tug Feb 21, 2019
dc5bbce
Make sure we get the resources from the application context not from …
Tug Feb 21, 2019
d53a9f4
Merge branch 'develop' into update/send-gutenberg-translations
hypest Feb 21, 2019
067e721
Update gb-mobile hash to the merged commit
hypest Feb 21, 2019
15a9701
Trim comments just to make the method 200-lines long
hypest Feb 21, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Pass down the locale to gutenberg-mobile
  • Loading branch information
Tug committed Feb 14, 2019
commit 154d11d9d51ea6f7349d42196fa7f38357365fd0
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,19 @@ public class GutenbergContainerFragment extends Fragment {
public static final String TAG = "gutenberg_container_fragment_tag";

private static final String ARG_IS_NEW_POST = "param_is_new_post";
private static final String ARG_LOCALE = "param_locale";
private static final String ARG_TRANSLATIONS = "param_translations";

private boolean mHtmlModeEnabled;
private boolean mHasReceivedAnyContent;

private WPAndroidGlueCode mWPAndroidGlueCode;

public static GutenbergContainerFragment newInstance(boolean isNewPost, Bundle translations) {
public static GutenbergContainerFragment newInstance(boolean isNewPost, String localeString, Bundle translations) {
GutenbergContainerFragment fragment = new GutenbergContainerFragment();
Bundle args = new Bundle();
args.putBoolean(ARG_IS_NEW_POST, isNewPost);
args.putString(ARG_LOCALE, localeString);
args.putBundle(ARG_TRANSLATIONS, translations);
fragment.setArguments(args);
return fragment;
Expand All @@ -43,6 +45,7 @@ public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

boolean isNewPost = getArguments() != null && getArguments().getBoolean(ARG_IS_NEW_POST);
String localeString = getArguments().getString(ARG_LOCALE);
Bundle translations = getArguments().getBundle(ARG_TRANSLATIONS);

mWPAndroidGlueCode = new WPAndroidGlueCode();
Expand All @@ -54,6 +57,7 @@ public void onCreate(Bundle savedInstanceState) {
BuildConfig.DEBUG,
BuildConfig.BUILD_GUTENBERG_FROM_SOURCE,
isNewPost,
localeString,
translations);

// clear the content initialization flag since a new ReactRootView has been created;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,9 @@ public void onCreate(Bundle savedInstanceState) {

FragmentManager fragmentManager = getChildFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
String localeString = getResources().getConfiguration().locale.getLanguage();
GutenbergContainerFragment gutenbergContainerFragment =
GutenbergContainerFragment.newInstance(isNewPost, this.getTranslations());
GutenbergContainerFragment.newInstance(isNewPost, localeString, this.getTranslations());
gutenbergContainerFragment.setRetainInstance(true);
fragmentTransaction.add(gutenbergContainerFragment, GutenbergContainerFragment.TAG);
fragmentTransaction.commitNow();
Expand Down