通知文案多语言

This commit is contained in:
renhaoting 2026-01-13 17:36:42 +08:00
parent f7df0fa888
commit 49a96758aa
5 changed files with 76 additions and 28 deletions

View File

@ -39,7 +39,7 @@ object PushContentController {
NotiLogger.d("推送内容配置初始化成功,共 ${pushContents?.size}") NotiLogger.d("推送内容配置初始化成功,共 ${pushContents?.size}")
// 异步获取远程配置 // 异步获取远程配置
fetchRemotePushContent() //fetchRemotePushContent()
true true
} catch (e: Exception) { } catch (e: Exception) {

View File

@ -50,10 +50,9 @@ object NotificationTriggerController {
const val CHANNEL_ID_GENERAL = "general_notification" const val CHANNEL_ID_GENERAL = "general_notification"
const val CHANNEL_ID_GENERAL_SILENT = "general_silent_notification" const val CHANNEL_ID_GENERAL_SILENT = "general_silent_notification"
const val CHANNEL_ID_BEAUTY = "general_beauty" const val CHANNEL_ID_BEAUTY = "general_beauty"
const val CHANNEL_NAME_RESIDENT = "recovery_resident" const val CHANNEL_NAME_RESIDENT = "resident"
const val CHANNEL_NAME_GENERAL = "recovery_single" const val CHANNEL_NAME_GENERAL = "single"
const val CHANNEL_NAME_GENERAL_SILENT = "recovery_loop" const val CHANNEL_NAME_GENERAL_SILENT = "loop"
const val CHANNEL_NAME_BEAUTY = "beauty_single" const val CHANNEL_NAME_BEAUTY = "beauty_single"
private var notificationManager: NotificationManagerCompat? = null private var notificationManager: NotificationManagerCompat? = null

View File

@ -107,8 +107,8 @@ object NotificationDatas {
NOTI_ID_TYPE_RANDOM_1, NOTI_ID_TYPE_RANDOM_1,
CHANNEL_TYPE_RANDOM, CHANNEL_TYPE_RANDOM,
CHANNEL_TYPE_RANDOM_NAME, CHANNEL_TYPE_RANDOM_NAME,
"Time to claim coins", ResUtil.getString(R.string.notify_title_01),
"You have free coins today!Open to claim!", ResUtil.getString(R.string.notify_des_01),
R.mipmap.task_cash, R.mipmap.task_cash,
entryPointPendingIntent(context, NOTI_ID_TYPE_RANDOM_1)) entryPointPendingIntent(context, NOTI_ID_TYPE_RANDOM_1))
) )
@ -117,8 +117,8 @@ object NotificationDatas {
NOTI_ID_TYPE_RANDOM_2, NOTI_ID_TYPE_RANDOM_2,
CHANNEL_TYPE_RANDOM, CHANNEL_TYPE_RANDOM,
CHANNEL_TYPE_RANDOM_NAME, CHANNEL_TYPE_RANDOM_NAME,
"Time to claim cash", ResUtil.getString(R.string.notify_title_02),
"You have free cash today!Open to claim!", ResUtil.getString(R.string.notify_des_02),
R.mipmap.task_cash, R.mipmap.task_cash,
entryPointPendingIntent(context, NOTI_ID_TYPE_RANDOM_2)) entryPointPendingIntent(context, NOTI_ID_TYPE_RANDOM_2))
) )
@ -127,8 +127,8 @@ object NotificationDatas {
NOTI_ID_TYPE_RANDOM_3, NOTI_ID_TYPE_RANDOM_3,
CHANNEL_TYPE_RANDOM, CHANNEL_TYPE_RANDOM,
CHANNEL_TYPE_RANDOM_NAME, CHANNEL_TYPE_RANDOM_NAME,
"Hey!", ResUtil.getString(R.string.notify_title_03),
"You received R$10, click to withdraw immediately!", ResUtil.getString(R.string.notify_des_03),
R.mipmap.task_cash, R.mipmap.task_cash,
entryPointPendingIntent(context, NOTI_ID_TYPE_RANDOM_3)) entryPointPendingIntent(context, NOTI_ID_TYPE_RANDOM_3))
) )
@ -137,8 +137,8 @@ object NotificationDatas {
NOTI_ID_TYPE_RANDOM_4, NOTI_ID_TYPE_RANDOM_4,
CHANNEL_TYPE_RANDOM, CHANNEL_TYPE_RANDOM,
CHANNEL_TYPE_RANDOM_NAME, CHANNEL_TYPE_RANDOM_NAME,
"\uD83D\uDCDE\uD83D\uDCDE\uD83D\uDCDE Do you miss me? ", ResUtil.getString(R.string.notify_title_04),
"Come play the game and withdraw now!", ResUtil.getString(R.string.notify_des_04),
R.mipmap.task_cash, R.mipmap.task_cash,
entryPointPendingIntent(context, NOTI_ID_TYPE_RANDOM_4)) entryPointPendingIntent(context, NOTI_ID_TYPE_RANDOM_4))
) )
@ -147,8 +147,8 @@ object NotificationDatas {
NOTI_ID_TYPE_RANDOM_5, NOTI_ID_TYPE_RANDOM_5,
CHANNEL_TYPE_RANDOM, CHANNEL_TYPE_RANDOM,
CHANNEL_TYPE_RANDOM_NAME, CHANNEL_TYPE_RANDOM_NAME,
"\uD83D\uDCDE\uD83D\uDCDE\uD83D\uDCDE Do you miss me? ", ResUtil.getString(R.string.notify_title_05),
"Come play the game and withdraw now!", ResUtil.getString(R.string.notify_des_05),
R.mipmap.task_cash, R.mipmap.task_cash,
entryPointPendingIntent(context, NOTI_ID_TYPE_RANDOM_5)) entryPointPendingIntent(context, NOTI_ID_TYPE_RANDOM_5))
) )
@ -157,8 +157,8 @@ object NotificationDatas {
NOTI_ID_TYPE_RANDOM_6, NOTI_ID_TYPE_RANDOM_6,
CHANNEL_TYPE_RANDOM, CHANNEL_TYPE_RANDOM,
CHANNEL_TYPE_RANDOM_NAME, CHANNEL_TYPE_RANDOM_NAME,
"\uD83D\uDCDE\uD83D\uDCDE\uD83D\uDCDE Do you miss me? ", ResUtil.getString(R.string.notify_title_06),
"Come play the game and withdraw now!", ResUtil.getString(R.string.notify_des_06),
R.mipmap.task_cash, R.mipmap.task_cash,
entryPointPendingIntent(context, NOTI_ID_TYPE_RANDOM_6)) entryPointPendingIntent(context, NOTI_ID_TYPE_RANDOM_6))
) )
@ -167,8 +167,8 @@ object NotificationDatas {
NOTI_ID_TYPE_RANDOM_7, NOTI_ID_TYPE_RANDOM_7,
CHANNEL_TYPE_RANDOM, CHANNEL_TYPE_RANDOM,
CHANNEL_TYPE_RANDOM_NAME, CHANNEL_TYPE_RANDOM_NAME,
"\uD83D\uDCDE\uD83D\uDCDE\uD83D\uDCDE Do you miss me? ", ResUtil.getString(R.string.notify_title_07),
"Come play the game and withdraw now!", ResUtil.getString(R.string.notify_des_07),
R.mipmap.task_cash, R.mipmap.task_cash,
entryPointPendingIntent(context, NOTI_ID_TYPE_RANDOM_7)) entryPointPendingIntent(context, NOTI_ID_TYPE_RANDOM_7))
) )
@ -177,8 +177,8 @@ object NotificationDatas {
NOTI_ID_TYPE_RANDOM_8, NOTI_ID_TYPE_RANDOM_8,
CHANNEL_TYPE_RANDOM, CHANNEL_TYPE_RANDOM,
CHANNEL_TYPE_RANDOM_NAME, CHANNEL_TYPE_RANDOM_NAME,
"Todays 1,024th Cash-Out Champion is HERE!", ResUtil.getString(R.string.notify_title_08),
"Youre the missing piece! Join now!", ResUtil.getString(R.string.notify_des_08),
R.mipmap.task_cash, R.mipmap.task_cash,
entryPointPendingIntent(context, NOTI_ID_TYPE_RANDOM_8)) entryPointPendingIntent(context, NOTI_ID_TYPE_RANDOM_8))
) )
@ -187,8 +187,8 @@ object NotificationDatas {
NOTI_ID_TYPE_RANDOM_9, NOTI_ID_TYPE_RANDOM_9,
CHANNEL_TYPE_RANDOM, CHANNEL_TYPE_RANDOM,
CHANNEL_TYPE_RANDOM_NAME, CHANNEL_TYPE_RANDOM_NAME,
"User #888 Just Cashed Out", ResUtil.getString(R.string.notify_title_09),
"Dont be left behind! Tap to claim yours!", ResUtil.getString(R.string.notify_des_09),
R.mipmap.task_cash, R.mipmap.task_cash,
entryPointPendingIntent(context, NOTI_ID_TYPE_RANDOM_9)) entryPointPendingIntent(context, NOTI_ID_TYPE_RANDOM_9))
) )
@ -197,8 +197,8 @@ object NotificationDatas {
NOTI_ID_TYPE_RANDOM_10, NOTI_ID_TYPE_RANDOM_10,
CHANNEL_TYPE_RANDOM, CHANNEL_TYPE_RANDOM,
CHANNEL_TYPE_RANDOM_NAME, CHANNEL_TYPE_RANDOM_NAME,
"You missed(2) calls", ResUtil.getString(R.string.notify_title_10),
"+86-12345, +86-666999", ResUtil.getString(R.string.notify_des_10),
R.mipmap.task_cash, R.mipmap.task_cash,
entryPointPendingIntent(context, NOTI_ID_TYPE_RANDOM_10)) entryPointPendingIntent(context, NOTI_ID_TYPE_RANDOM_10))
) )
@ -207,12 +207,11 @@ object NotificationDatas {
NOTI_ID_TYPE_RANDOM_11, NOTI_ID_TYPE_RANDOM_11,
CHANNEL_TYPE_RANDOM, CHANNEL_TYPE_RANDOM,
CHANNEL_TYPE_RANDOM_NAME, CHANNEL_TYPE_RANDOM_NAME,
"Gmail", ResUtil.getString(R.string.notify_title_11),
"support.gov@gmail.com", ResUtil.getString(R.string.notify_des_11),
R.mipmap.task_cash, R.mipmap.task_cash,
entryPointPendingIntent(context, NOTI_ID_TYPE_RANDOM_11)) entryPointPendingIntent(context, NOTI_ID_TYPE_RANDOM_11))
) )
} catch (e: Exception) { } catch (e: Exception) {
e.printStackTrace() e.printStackTrace()
} }

View File

@ -14,5 +14,28 @@
<string name="title_bg_withdraw">Hey there!</string> <string name="title_bg_withdraw">Hey there!</string>
<string name="content_bg_withdraw">Don\'t miss your R$ %s, Tap to withdraw!</string> <string name="content_bg_withdraw">Don\'t miss your R$ %s, Tap to withdraw!</string>
<string name="notify_title_01">Time to claim coins</string>
<string name="notify_des_01">You have free coins today!Open to claim!</string>
<string name="notify_title_02">Time to claim cash</string>
<string name="notify_des_02">You have free cash today!Open to claim!</string>
<string name="notify_title_03">Hey!</string>
<string name="notify_des_03">You received R$10, click to withdraw immediately!</string>
<string name="notify_title_04">\uD83D\uDCDE\uD83D\uDCDE\uD83D\uDCDE Do you miss me?</string>
<string name="notify_des_04">Come play the game and withdraw now!</string>
<string name="notify_title_05">Hey!</string>
<string name="notify_des_05">Come play the game and withdraw now!</string>
<string name="notify_title_06">Hey!</string>
<string name="notify_des_06">Come play the game and withdraw now!</string>
<string name="notify_title_07">Hey!</string>
<string name="notify_des_07">Come play the game and withdraw now!</string>
<string name="notify_title_08">Todays 1,024th Cash-Out Champion is HERE!</string>
<string name="notify_des_08">Youre the missing piece! Join now!</string>
<string name="notify_title_09">User #888 Just Cashed Out</string>
<string name="notify_des_09">Dont be left behind! Tap to claim yours!</string>
<string name="notify_title_10">You missed(2) calls</string>
<string name="notify_des_10">+86-12345, +86-666999</string>
<string name="notify_title_11">Gmail</string>
<string name="notify_des_11">support.gov@gmail.com</string>
</resources> </resources>

View File

@ -17,4 +17,31 @@
<string name="game">Game\n</string> <string name="game">Game\n</string>
<!-- 11个通知文案 -->
<string name="notify_title_01">Hora de reivindicar moedas!</string>
<string name="notify_des_01">Você tem moedas grátis hoje! Abra para reivindicar!</string>
<string name="notify_title_02">Hora de reivindicar dinheiro!</string>
<string name="notify_des_02">Você tem dinheiro grátis hoje! Abra para reivindicar!</string>
<string name="notify_title_03">Ei!</string>
<string name="notify_des_03">Você recebeu R$10, clique para sacar imediatamente!</string>
<string name="notify_title_04">\uD83D\uDCDE\uD83D\uDCDE\uD83D\uDCDE Saudades de mim?</string>
<string name="notify_des_04">Venha jogar e sacar agora!</string>
<string name="notify_title_05">\uD83D\uDCDE\uD83D\uDCDE\uD83D\uDCDE Saudades de mim?</string>
<string name="notify_des_05">Você recebeu R$10, clique para sacar imediatamente!</string>
<string name="notify_title_06">\uD83D\uDCDE\uD83D\uDCDE\uD83D\uDCDE Saudades de mim?</string>
<string name="notify_des_06">Você recebeu R$10, clique para sacar imediatamente!</string>
<string name="notify_title_07">\uD83D\uDCDE\uD83D\uDCDE\uD83D\uDCDE Saudades de mim?</string>
<string name="notify_des_07">Você recebeu R$10, clique para sacar imediatamente!</string>
<string name="notify_title_08">O 1024º Campeão de Saque de Hoje está AQUI!</string>
<string name="notify_des_08">Você é a peça que falta! Junte-se agora!</string>
<string name="notify_title_09">Usuário 888 Acabou de Sacar!</string>
<string name="notify_des_09">Não fique para trás! Toque para reivindicar o seu!</string>
<string name="notify_title_10">Você perdeu (2) chamadas</string>
<string name="notify_des_10">+86-12345, +86-666999</string>
<string name="notify_title_11">Gmail</string>
<string name="notify_des_11">support.gov@gmail.com</string>
</resources> </resources>