Make notification translatable

This commit is contained in:
Oizaro 2020-08-23 21:11:58 +02:00
parent 1e233f01b4
commit 8703fb3138
22 changed files with 14 additions and 44 deletions

View File

@ -1,28 +0,0 @@
/*
* SPDX-FileCopyrightText: 2020, microG Project Team
* SPDX-License-Identifier: Apache-2.0
*/
apply plugin: 'com.android.library'
dependencies {
api project(':play-services-basement')
implementation "androidx.annotation:annotation:$annotationVersion"
}
android {
compileSdkVersion androidCompileSdk
buildToolsVersion "$androidBuildVersionTools"
defaultConfig {
versionName version
minSdkVersion androidMinSdk
targetSdkVersion androidTargetSdk
}
compileOptions {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
}

View File

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ SPDX-FileCopyrightText: 2020, microG Project Team
~ SPDX-License-Identifier: Apache-2.0
-->
<manifest package="org.microg.gms.base.core">
<application />
</manifest>

View File

@ -30,7 +30,6 @@ dependencies {
// Specified manually due to
// https://github.com/vitalidze/chromecast-java-api-v2/issues/91
implementation project(':play-services-base-core')
implementation project(':play-services-core-proto')
implementation project(':play-services-core:microg-ui-tools') // deprecated
implementation project(':play-services-api')

View File

@ -10,6 +10,7 @@ import android.content.ComponentName;
import android.content.Context;
import android.content.ContextWrapper;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Build;
import android.os.PowerManager;
import android.provider.Settings;
@ -17,7 +18,7 @@ import android.util.Log;
import androidx.annotation.RequiresApi;
import org.microg.gms.base.core.R;
import com.mgoogle.android.gms.R;
import java.util.List;
@ -69,7 +70,7 @@ public class ForegroundServiceContext extends ContextWrapper {
@RequiresApi(api = Build.VERSION_CODES.O)
private static Notification buildForegroundNotification(Context context) {
NotificationChannel channel = new NotificationChannel("foreground-service", "Foreground Service", NotificationManager.IMPORTANCE_MIN);
NotificationChannel channel = new NotificationChannel("foreground-service", Resources.getSystem().getString(R.string.notification_service_name), NotificationManager.IMPORTANCE_MIN);
channel.setShowBadge(false);
channel.setLockscreenVisibility(0);
channel.setVibrationPattern(new long[0]);
@ -81,8 +82,8 @@ public class ForegroundServiceContext extends ContextWrapper {
return new Notification.Builder(context, channel.getId())
.setOngoing(true)
.setContentIntent(pendingIntent)
.setContentTitle("Running in background")
.setContentText("Tap me to disable battery optimisations for microG")
.setContentTitle(Resources.getSystem().getString(R.string.notification_service_title))
.setContentText(Resources.getSystem().getString(R.string.notification_service_content))
.setSmallIcon(R.drawable.ic_foreground_notification)
.build();
}

View File

@ -16,6 +16,11 @@
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="gms_settings_name">Impostazioni di Vanced microG</string>
<string name="gms_settings_summary">Configura Vanced microG.</string>
<string name="notification_service_name">Servizio in Primo Piano</string>
<string name="notification_service_title">Esecuzione in secondo piano</string>
<string name="notification_service_content">Tocca per disattivare il risparmio energetico per microG</string>
<string name="just_a_sec">Giusto un secondo…</string>
<string name="ask_permission_tos">Continuando autorizzi questa applicazione e Google ad usare le tue informazioni in accordo con i rispettivi termini di servizio e politiche di riservatezza.</string>

View File

@ -18,6 +18,10 @@
<string name="gms_settings_name">Vanced microG Settings</string>
<string name="gms_settings_summary">Setup Vanced microG.</string>
<string name="notification_service_name">Foreground Service</string>
<string name="notification_service_title">Running in background</string>
<string name="notification_service_content">Tap me to disable battery saving for microG</string>
<string name="just_a_sec">Just a sec…</string>
<string name="ask_permission_tos">By continuing, you allow this app and Google to use your information in accordance with their respective terms of service and privacy policies.</string>
<string name="ask_scope_permission_title"><xliff:g example="F-Droid">%1$s</xliff:g> would like to:</string>

View File

@ -11,8 +11,6 @@ include ':play-services-base-api'
include ':play-services-tasks'
include ':play-services-core-proto'
include ':play-services-base-core'
include ':play-services-core'
include ':play-services-core:microg-ui-tools'