🐛 Fix the usage of new localization system
This commit is contained in:
@@ -466,12 +466,12 @@ public class AccountService(
|
|||||||
contact.Content,
|
contact.Content,
|
||||||
localizer.Get("codeEmailTitle", account.Language),
|
localizer.Get("codeEmailTitle", account.Language),
|
||||||
"FactorCode",
|
"FactorCode",
|
||||||
account.Language,
|
|
||||||
new VerificationEmailModel
|
new VerificationEmailModel
|
||||||
{
|
{
|
||||||
Name = account.Name,
|
Name = account.Name,
|
||||||
Code = code
|
Code = code
|
||||||
}
|
},
|
||||||
|
account.Language
|
||||||
);
|
);
|
||||||
|
|
||||||
await _SetFactorCode(factor, code, TimeSpan.FromMinutes(30));
|
await _SetFactorCode(factor, code, TimeSpan.FromMinutes(30));
|
||||||
|
|||||||
@@ -99,12 +99,12 @@ public class MagicSpellService(
|
|||||||
contact.Content,
|
contact.Content,
|
||||||
localizer.Get("regConfirmTitle", accountLanguage),
|
localizer.Get("regConfirmTitle", accountLanguage),
|
||||||
"Welcome",
|
"Welcome",
|
||||||
accountLanguage,
|
|
||||||
new LandingEmailModel
|
new LandingEmailModel
|
||||||
{
|
{
|
||||||
Name = contact.Account.Name,
|
Name = contact.Account.Name,
|
||||||
Link = link
|
Link = link
|
||||||
}
|
},
|
||||||
|
accountLanguage
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
case MagicSpellType.AccountRemoval:
|
case MagicSpellType.AccountRemoval:
|
||||||
@@ -113,12 +113,12 @@ public class MagicSpellService(
|
|||||||
contact.Content,
|
contact.Content,
|
||||||
localizer.Get("accountDeletionTitle", accountLanguage),
|
localizer.Get("accountDeletionTitle", accountLanguage),
|
||||||
"AccountDeletion",
|
"AccountDeletion",
|
||||||
accountLanguage,
|
|
||||||
new AccountDeletionEmailModel
|
new AccountDeletionEmailModel
|
||||||
{
|
{
|
||||||
Name = contact.Account.Name,
|
Name = contact.Account.Name,
|
||||||
Link = link
|
Link = link
|
||||||
}
|
},
|
||||||
|
accountLanguage
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
case MagicSpellType.AuthPasswordReset:
|
case MagicSpellType.AuthPasswordReset:
|
||||||
@@ -127,12 +127,12 @@ public class MagicSpellService(
|
|||||||
contact.Content,
|
contact.Content,
|
||||||
localizer.Get("passwordResetTitle", accountLanguage),
|
localizer.Get("passwordResetTitle", accountLanguage),
|
||||||
"PasswordReset",
|
"PasswordReset",
|
||||||
accountLanguage,
|
|
||||||
new PasswordResetEmailModel
|
new PasswordResetEmailModel
|
||||||
{
|
{
|
||||||
Name = contact.Account.Name,
|
Name = contact.Account.Name,
|
||||||
Link = link
|
Link = link
|
||||||
}
|
},
|
||||||
|
accountLanguage
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
case MagicSpellType.ContactVerification:
|
case MagicSpellType.ContactVerification:
|
||||||
@@ -143,12 +143,12 @@ public class MagicSpellService(
|
|||||||
contactMethod!,
|
contactMethod!,
|
||||||
localizer.Get("contractMethodVerificationTitle", accountLanguage),
|
localizer.Get("contractMethodVerificationTitle", accountLanguage),
|
||||||
"ContactVerification",
|
"ContactVerification",
|
||||||
accountLanguage,
|
|
||||||
new ContactVerificationEmailModel
|
new ContactVerificationEmailModel
|
||||||
{
|
{
|
||||||
Name = contact.Account.Name,
|
Name = contact.Account.Name,
|
||||||
Link = link
|
Link = link
|
||||||
}
|
},
|
||||||
|
accountLanguage
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
case MagicSpellType.AccountDeactivation:
|
case MagicSpellType.AccountDeactivation:
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ public class RelationshipService(
|
|||||||
Notification = new PushNotification
|
Notification = new PushNotification
|
||||||
{
|
{
|
||||||
Topic = "relationships.friends.request",
|
Topic = "relationships.friends.request",
|
||||||
Title = localizer.Get("friendRequestTitle", locale: sender.Language, args: new { sender.Nick }),
|
Title = localizer.Get("friendRequestTitle", locale: sender.Language, args: new { sender = sender.Nick }),
|
||||||
Body = localizer.Get("friendRequestBody", locale: sender.Language),
|
Body = localizer.Get("friendRequestBody", locale: sender.Language),
|
||||||
ActionUri = "/account/relationships",
|
ActionUri = "/account/relationships",
|
||||||
IsSavable = true
|
IsSavable = true
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ public class RealmServiceGrpc(
|
|||||||
{
|
{
|
||||||
Topic = "invites.realms",
|
Topic = "invites.realms",
|
||||||
Title = localizer.Get("realmInviteTitle", account.Language),
|
Title = localizer.Get("realmInviteTitle", account.Language),
|
||||||
Body = localizer.Get("realmInviteBody", locale: account.Language, args: new { realmName = member?.Name ?? "Unknown Realm" }),
|
Body = localizer.Get("realmInviteBody", locale: account.Language, args: new { realmName = member?.Realm?.Name ?? "Unknown Realm" }),
|
||||||
ActionUri = "/realms",
|
ActionUri = "/realms",
|
||||||
IsSavable = true
|
IsSavable = true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -230,7 +230,7 @@ public partial class PostService(
|
|||||||
Notification = new PushNotification
|
Notification = new PushNotification
|
||||||
{
|
{
|
||||||
Topic = "post.replies",
|
Topic = "post.replies",
|
||||||
Title = localizer.Get("postReplyTitle", args: new { senderNick = sender!.Nick }),
|
Title = localizer.Get("postReplyTitle", args: new { user = sender!.Nick }),
|
||||||
Body = ChopPostForNotification(post).content,
|
Body = ChopPostForNotification(post).content,
|
||||||
IsSavable = true,
|
IsSavable = true,
|
||||||
ActionUri = $"/posts/{post.Id}"
|
ActionUri = $"/posts/{post.Id}"
|
||||||
@@ -704,10 +704,10 @@ public partial class PostService(
|
|||||||
Notification = new PushNotification
|
Notification = new PushNotification
|
||||||
{
|
{
|
||||||
Topic = "posts.reactions.new",
|
Topic = "posts.reactions.new",
|
||||||
Title = localizer.Get("postReactTitle", args: new { senderNick = sender.Nick }),
|
Title = localizer.Get("postReactTitle", args: new { user = sender.Nick }),
|
||||||
Body = string.IsNullOrWhiteSpace(post.Title)
|
Body = string.IsNullOrWhiteSpace(post.Title)
|
||||||
? localizer.Get("postReactBody", args: new { senderNick = sender.Nick, reaction.Symbol })
|
? localizer.Get("postReactBody", args: new { user = sender.Nick, reaction = reaction.Symbol })
|
||||||
: localizer.Get("postReactContentBody", args: new { senderNick = sender.Nick, reaction.Symbol, post.Title }),
|
: localizer.Get("postReactContentBody", args: new { user = sender.Nick, reaction = reaction.Symbol, title = post.Title }),
|
||||||
IsSavable = true,
|
IsSavable = true,
|
||||||
ActionUri = $"/posts/{post.Id}"
|
ActionUri = $"/posts/{post.Id}"
|
||||||
}
|
}
|
||||||
@@ -1157,10 +1157,10 @@ public partial class PostService(
|
|||||||
Notification = new PushNotification
|
Notification = new PushNotification
|
||||||
{
|
{
|
||||||
Topic = "posts.awards.new",
|
Topic = "posts.awards.new",
|
||||||
Title = localizer.Get("postAwardedTitle", args: new { senderNick = sender.Nick }),
|
Title = localizer.Get("postAwardedTitle", args: new { user = sender.Nick }),
|
||||||
Body = string.IsNullOrWhiteSpace(post.Title)
|
Body = string.IsNullOrWhiteSpace(post.Title)
|
||||||
? localizer.Get("postAwardedBody", args: new { senderNick = sender.Nick, amount })
|
? localizer.Get("postAwardedBody", args: new { user = sender.Nick, amount })
|
||||||
: localizer.Get("postAwardedContentBody", args: new { senderNick = sender.Nick, amount, post.Title }),
|
: localizer.Get("postAwardedContentBody", args: new { user = sender.Nick, amount, title = post.Title }),
|
||||||
IsSavable = true,
|
IsSavable = true,
|
||||||
ActionUri = $"/posts/{post.Id}"
|
ActionUri = $"/posts/{post.Id}"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ public class PublisherSubscriptionService(
|
|||||||
var notification = new PushNotification
|
var notification = new PushNotification
|
||||||
{
|
{
|
||||||
Topic = "posts.new",
|
Topic = "posts.new",
|
||||||
Title = localizer.Get("postSubscriptionTitle", args: new { publisherNick = post.Publisher!.Nick, title }),
|
Title = localizer.Get("postSubscriptionTitle", args: new { publisher = post.Publisher!.Nick, title }),
|
||||||
Body = message,
|
Body = message,
|
||||||
Meta = GrpcTypeHelper.ConvertObjectToByteString(data),
|
Meta = GrpcTypeHelper.ConvertObjectToByteString(data),
|
||||||
IsSavable = true,
|
IsSavable = true,
|
||||||
|
|||||||
@@ -20,5 +20,5 @@
|
|||||||
"subscriptionAppliedTitle": "Subscription {plan} just activated for your account",
|
"subscriptionAppliedTitle": "Subscription {plan} just activated for your account",
|
||||||
"subscriptionAppliedBody": "Thank for supporting the Solar Network! Your {days} days {plan} subscription just begun, feel free to explore the newly unlocked features!",
|
"subscriptionAppliedBody": "Thank for supporting the Solar Network! Your {days} days {plan} subscription just begun, feel free to explore the newly unlocked features!",
|
||||||
"orderPaidTitle": "Order {orderId} recipient",
|
"orderPaidTitle": "Order {orderId} recipient",
|
||||||
"orderPaidBody": "{amount} {currency} was removed from your wallet to pay for {item}"
|
"orderPaidBody": "{amount} {currency} was removed from your wallet to pay for {remark}"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,5 +20,5 @@
|
|||||||
"subscriptionAppliedTitle": "订阅 {plan} 刚刚为您的账户激活",
|
"subscriptionAppliedTitle": "订阅 {plan} 刚刚为您的账户激活",
|
||||||
"subscriptionAppliedBody": "感谢您支持 Solar Network!您的 {days} 天 {plan} 订阅刚刚开始,请尽情探索新解锁的功能!",
|
"subscriptionAppliedBody": "感谢您支持 Solar Network!您的 {days} 天 {plan} 订阅刚刚开始,请尽情探索新解锁的功能!",
|
||||||
"orderPaidTitle": "订单 {orderId} 收件人",
|
"orderPaidTitle": "订单 {orderId} 收件人",
|
||||||
"orderPaidBody": "{amount} {currency} 已从您的钱包中扣除以支付 {item}"
|
"orderPaidBody": "{amount} {currency} 已从您的钱包中扣除以支付 {remark}"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -425,7 +425,7 @@ public class SubscriptionService(
|
|||||||
{
|
{
|
||||||
Topic = "subscriptions.begun",
|
Topic = "subscriptions.begun",
|
||||||
Title = localizer.Get("subscriptionAppliedTitle", locale: locale, args: new { subscriptionName = humanReadableName }),
|
Title = localizer.Get("subscriptionAppliedTitle", locale: locale, args: new { subscriptionName = humanReadableName }),
|
||||||
Body = localizer.Get("subscriptionAppliedBody", locale: locale, args: new { duration, subscriptionName = humanReadableName }),
|
Body = localizer.Get("subscriptionAppliedBody", locale: locale, args: new { duration, subscription = humanReadableName }),
|
||||||
Meta = GrpcTypeHelper.ConvertObjectToByteString(new Dictionary<string, object>
|
Meta = GrpcTypeHelper.ConvertObjectToByteString(new Dictionary<string, object>
|
||||||
{
|
{
|
||||||
["subscription_id"] = subscription.Id.ToString()
|
["subscription_id"] = subscription.Id.ToString()
|
||||||
@@ -923,7 +923,7 @@ public class SubscriptionService(
|
|||||||
{
|
{
|
||||||
Topic = "gifts.claimed",
|
Topic = "gifts.claimed",
|
||||||
Title = localizer.Get("giftClaimedTitle", locale: locale),
|
Title = localizer.Get("giftClaimedTitle", locale: locale),
|
||||||
Body = localizer.Get("giftClaimedBody", locale: locale, args: new { subscriptionName = humanReadableName, redeemerName = redeemer.Name }),
|
Body = localizer.Get("giftClaimedBody", locale: locale, args: new { subscription = humanReadableName, user = redeemer.Name }),
|
||||||
Meta = GrpcTypeHelper.ConvertObjectToByteString(new Dictionary<string, object>
|
Meta = GrpcTypeHelper.ConvertObjectToByteString(new Dictionary<string, object>
|
||||||
{
|
{
|
||||||
["gift_id"] = gift.Id.ToString(),
|
["gift_id"] = gift.Id.ToString(),
|
||||||
|
|||||||
Reference in New Issue
Block a user