mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 01:08:50 -06:00
Update translation links
This commit is contained in:
@@ -94,6 +94,13 @@ public class AboutRootView extends BaseRootView
|
||||
getContext().startActivity(intent);
|
||||
}
|
||||
|
||||
@OnClick(R.id.tvTranslate)
|
||||
public void onClickTranslate()
|
||||
{
|
||||
Intent intent = intents.helpTranslate(getContext());
|
||||
getContext().startActivity(intent);
|
||||
}
|
||||
|
||||
@OnClick(R.id.tvRate)
|
||||
public void onClickRate()
|
||||
{
|
||||
|
||||
@@ -61,9 +61,6 @@ public class SettingsFragment extends PreferenceFragmentCompat
|
||||
setResultOnPreferenceClick("bugReport", ListHabitsScreen.RESULT_BUG_REPORT);
|
||||
|
||||
updateRingtoneDescription();
|
||||
|
||||
if (InterfaceUtils.isLocaleFullyTranslated())
|
||||
removePreference("translate", "linksCategory");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -110,14 +107,6 @@ public class SettingsFragment extends PreferenceFragmentCompat
|
||||
BackupManager.dataChanged("org.isoron.uhabits");
|
||||
}
|
||||
|
||||
private void removePreference(String preferenceKey, String categoryKey)
|
||||
{
|
||||
PreferenceCategory cat =
|
||||
(PreferenceCategory) findPreference(categoryKey);
|
||||
Preference pref = findPreference(preferenceKey);
|
||||
cat.removePreference(pref);
|
||||
}
|
||||
|
||||
private void setResultOnPreferenceClick(String key, final int result)
|
||||
{
|
||||
Preference pref = findPreference(key);
|
||||
|
||||
@@ -39,6 +39,12 @@ public class IntentFactory
|
||||
{
|
||||
}
|
||||
|
||||
public Intent helpTranslate(Context context)
|
||||
{
|
||||
String url = context.getString(R.string.translateURL);
|
||||
return buildViewIntent(url);
|
||||
}
|
||||
|
||||
public Intent rateApp(Context context)
|
||||
{
|
||||
String url = context.getString(R.string.playStoreURL);
|
||||
|
||||
@@ -24,17 +24,8 @@ import android.content.res.*;
|
||||
import android.graphics.*;
|
||||
import android.util.*;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public abstract class InterfaceUtils
|
||||
{
|
||||
|
||||
// TODO: Move this to another place, or detect automatically
|
||||
private static String fullyTranslatedLanguages[] = {
|
||||
"ca", "zh", "en", "de", "in", "it", "ko", "pl", "pt", "es", "tk", "uk",
|
||||
"ja", "fr", "hr", "sl"
|
||||
};
|
||||
|
||||
private static Typeface fontAwesome;
|
||||
|
||||
public static Typeface getFontAwesome(Context context)
|
||||
@@ -58,15 +49,4 @@ public abstract class InterfaceUtils
|
||||
DisplayMetrics metrics = resources.getDisplayMetrics();
|
||||
return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, sp, metrics);
|
||||
}
|
||||
|
||||
public static boolean isLocaleFullyTranslated()
|
||||
{
|
||||
final String currentLanguage = Locale.getDefault().getLanguage();
|
||||
|
||||
for(String lang : fullyTranslatedLanguages)
|
||||
if(currentLanguage.equals(lang)) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -87,6 +87,11 @@
|
||||
style="@style/About.Item.Clickable"
|
||||
android:text="@string/pref_send_feedback"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvTranslate"
|
||||
style="@style/About.Item.Clickable"
|
||||
android:text="@string/help_translate"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvSource"
|
||||
style="@style/About.Item.Clickable"
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<string name="feedbackURL" formatted="false">mailto:dev@loophabits.org?subject=Feedback%20about%20Loop%20Habit%20Tracker</string>
|
||||
<string name="bugReportURL" formatted="false">mailto:dev@loophabits.org?subject=Bug%20Report%20-%20Loop%20Habit%20Tracker</string>
|
||||
<string name="sourceCodeURL">https://github.com/iSoron/uhabits</string>
|
||||
<string name="translateURL">https://poeditor.com/join/project/8DWX5pfjS0</string>
|
||||
<string name="translateURL">http://translate.loophabits.org/</string>
|
||||
<string name="bugReportTo">dev@loophabits.org</string>
|
||||
<string name="bugReportSubject">Bug Report - Loop Habit Tracker</string>
|
||||
|
||||
|
||||
@@ -124,20 +124,6 @@
|
||||
android:data="@string/playStoreURL"/>
|
||||
</Preference>
|
||||
|
||||
<Preference android:title="@string/pref_send_feedback">
|
||||
<intent
|
||||
android:action="android.intent.action.SENDTO"
|
||||
android:data="@string/feedbackURL"/>
|
||||
</Preference>
|
||||
|
||||
<Preference
|
||||
android:key="translate"
|
||||
android:title="@string/help_translate">
|
||||
<intent
|
||||
android:action="android.intent.action.VIEW"
|
||||
android:data="@string/feedbackURL"/>
|
||||
</Preference>
|
||||
|
||||
<Preference android:title="@string/about">
|
||||
<intent
|
||||
android:action="android.intent.action.VIEW"
|
||||
|
||||
Reference in New Issue
Block a user