@@ -333,26 +333,31 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
333333 });
334334
335335 // Warning! Locales that are't exist will crash the app
336+ // Anything that is commented out is supported but the translation is not complete to at least 60%
336337 HashSet <String > supportedLocales = new HashSet <>();
338+ // supportedLocales.add("ar");
339+ // supportedLocales.add("ar_SA");
337340 supportedLocales .add ("cs" );
338341 supportedLocales .add ("de" );
339- supportedLocales .add ("el" );
342+ // supportedLocales.add("el");
343+ supportedLocales .add ("es" );
340344 supportedLocales .add ("es-rMX" );
341- supportedLocales .add ("et" );
345+ // supportedLocales.add("et");
342346 supportedLocales .add ("fr" );
343347 supportedLocales .add ("id" );
344348 supportedLocales .add ("it" );
345- supportedLocales .add ("ja" );
346- supportedLocales .add ("nb-rNO" );
349+ // supportedLocales.add("ja");
350+ // supportedLocales.add("nb-rNO");
347351 supportedLocales .add ("pl" );
348352 supportedLocales .add ("pt-rBR" );
349353 supportedLocales .add ("ro" );
350354 supportedLocales .add ("ru" );
351355 supportedLocales .add ("sk" );
352356 supportedLocales .add ("tr" );
353- supportedLocales .add ("vi" );
357+ supportedLocales .add ("uk" );
358+ // supportedLocales.add("vi");
354359 supportedLocales .add ("zh-rCH" );
355- supportedLocales .add ("zh-rTW" );
360+ // supportedLocales.add("zh-rTW");
356361 supportedLocales .add ("en" );
357362
358363 Preference languageSelector = findPreference ("pref_language_selector" );
@@ -363,6 +368,23 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
363368 return true ;
364369 });
365370
371+ // Handle pref_language_selector_cta by taking user to https://translate.nift4.org/engage/foxmmm/
372+ LongClickablePreference languageSelectorCta = findPreference ("pref_language_selector_cta" );
373+ languageSelectorCta .setOnPreferenceClickListener (preference -> {
374+ Intent browserIntent = new Intent (Intent .ACTION_VIEW , Uri .parse ("https://translate.nift4.org/engage/foxmmm/" ));
375+ startActivity (browserIntent );
376+ return true ;
377+ });
378+
379+ // Long click to copy url
380+ languageSelectorCta .setOnPreferenceLongClickListener (v -> {
381+ ClipboardManager clipboard = (ClipboardManager ) requireContext ().getSystemService (Context .CLIPBOARD_SERVICE );
382+ ClipData clip = ClipData .newPlainText ("URL" , "https://translate.nift4.org/engage/foxmmm/" );
383+ clipboard .setPrimaryClip (clip );
384+ Toast .makeText (requireContext (), R .string .link_copied , Toast .LENGTH_SHORT ).show ();
385+ return true ;
386+ });
387+
366388 int level = this .currentLanguageLevel ();
367389 if (level != LANGUAGE_SUPPORT_LEVEL ) {
368390 Log .e (TAG , "Detected language level " + level + ", latest is " + LANGUAGE_SUPPORT_LEVEL );
@@ -484,6 +506,8 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
484506 findPreference ("pref_report_bug" ).setVisible (false );
485507 }
486508 linkClickable = findPreference ("pref_source_code" );
509+ // Set summary to the last commit this build was built from
510+ linkClickable .setSummary (String .format (getString (R .string .source_code_summary ), BuildConfig .COMMIT_HASH ));
487511 linkClickable .setOnPreferenceClickListener (p -> {
488512 if (devModeStep == 2 ) {
489513 devModeStep = 0 ;
@@ -499,7 +523,8 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
499523 ExternalHelper .INSTANCE .refreshHelper (getContext ());
500524 return true ;
501525 }
502- IntentHelper .openUrl (p .getContext (), "https://github.com/Fox2Code/FoxMagiskModuleManager" );
526+ // build url from BuildConfig.REMOTE_URL and BuildConfig.COMMIT_HASH. May have to remove the .git at the end
527+ IntentHelper .openUrl (p .getContext (), BuildConfig .REMOTE_URL + "/tree/" + BuildConfig .COMMIT_HASH );
503528 return true ;
504529 });
505530 linkClickable .setOnPreferenceLongClickListener (p -> {
0 commit comments