Translate EULA copyright year.

This commit is contained in:
Jimmy Shih
2012-05-16 18:03:57 -07:00
parent c2fd6b8794
commit 3269af0add
3 changed files with 23 additions and 20 deletions
+5
View File
@@ -581,6 +581,11 @@ limitations under the License.
translation_description="In the 'Terms of Service' dialog, the button to accept.">
Accept
</string>
<string name="eula_copyright_year"
translation_description="The copyright year in the 'Terms of Service'. See
http://m.google.com/toscountry. \u00A9 is the unicode value for the copyright symbol.">
\u00A92012
</string>
<string name="eula_decline"
translation_description="In the 'Terms of Service' dialog, the button to decline.">
Decline
@@ -35,6 +35,7 @@ public class EulaDialogFragment extends DialogFragment {
public static final String EULA_DIALOG_TAG = "eulaDialog";
private static final String KEY_HAS_ACCEPTED = "hasAccepted";
private static final String GOOGLE_URL = "m.google.com";
/**
* Creates a new instance of {@link EulaDialogFragment}.
@@ -61,7 +62,7 @@ public class EulaDialogFragment extends DialogFragment {
public Dialog onCreateDialog(Bundle savedInstanceState) {
boolean hasAccepted = getArguments().getBoolean(KEY_HAS_ACCEPTED);
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity())
.setMessage(EulaUtils.getEulaMessage(getActivity()))
.setMessage(getEulaText())
.setTitle(R.string.eula_title);
if (hasAccepted) {
@@ -84,11 +85,25 @@ public class EulaDialogFragment extends DialogFragment {
}
return builder.create();
}
/**
* Exits the application.
*/
private void exitApp() {
getActivity().finish();
}
/**
* Gets the EULA text.
*
*/
private String getEulaText() {
return getString(R.string.eula_date)
+ "\n\n"
+ getString(R.string.eula_body, GOOGLE_URL)
+ "\n\n"
+ getString(R.string.eula_footer, GOOGLE_URL)
+ "\n\n"
+ getString(R.string.eula_copyright_year);
}
}
@@ -15,17 +15,13 @@
*/
package com.google.android.apps.mytracks.util;
import com.google.android.maps.mytracks.R;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import java.util.Calendar;
/**
* Utilities for EULA.
*
*
* @author Jimmy Shih
*/
public class EulaUtils {
@@ -35,9 +31,6 @@ public class EulaUtils {
// Accepting Google mobile terms of service
private static final String EULA_PREFERENCE_KEY = "eula.google_mobile_tos_accepted";
// Google's mobile page
private static final String HOST_NAME = "m.google.com";
private EulaUtils() {}
public static boolean getEulaValue(Context context) {
@@ -53,14 +46,4 @@ public class EulaUtils {
editor.putBoolean(EULA_PREFERENCE_KEY, true);
ApiAdapterFactory.getApiAdapter().applyPreferenceChanges(editor);
}
public static String getEulaMessage(Context context) {
return context.getString(R.string.eula_date)
+ "\n\n"
+ context.getString(R.string.eula_body, HOST_NAME)
+ "\n\n"
+ context.getString(R.string.eula_footer, HOST_NAME)
+ "\n\n"
+ "©" + Calendar.getInstance().get(Calendar.YEAR);
}
}