mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-01 12:44:42 +00:00
Localize warning message
This commit is contained in:
parent
1ab397ba4c
commit
f478242ca2
4 changed files with 7 additions and 8 deletions
|
@ -1242,7 +1242,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
|||
|
||||
// Write decrypted body
|
||||
EntityMessage m = db.message().getMessage(id);
|
||||
m.write(context, parts.getHtml());
|
||||
m.write(context, parts.getHtml(context));
|
||||
|
||||
// Remove previously decrypted attachments
|
||||
for (EntityAttachment a : attachments)
|
||||
|
|
|
@ -537,7 +537,7 @@ public class MessageHelper {
|
|||
private List<AttachmentPart> attachments = new ArrayList<>();
|
||||
private List<String> warnings = new ArrayList<>();
|
||||
|
||||
String getHtml() throws MessagingException {
|
||||
String getHtml(Context context) throws MessagingException {
|
||||
if (plain == null && html == null)
|
||||
return null;
|
||||
|
||||
|
@ -562,12 +562,10 @@ public class MessageHelper {
|
|||
|
||||
ContentType ct = new ContentType(part.getContentType());
|
||||
String charset = ct.getParameter("charset");
|
||||
if (TextUtils.isEmpty(charset))
|
||||
warnings.add("Missing charset");
|
||||
else {
|
||||
if (!TextUtils.isEmpty(charset)) {
|
||||
if ("US-ASCII".equals(Charset.forName(charset).name()) &&
|
||||
!"US-ASCII".equals(charset.toUpperCase()))
|
||||
warnings.add("Unknown charset " + charset);
|
||||
warnings.add(context.getString(R.string.title_no_charset, charset));
|
||||
}
|
||||
|
||||
if (part.isMimeType("text/plain") || text)
|
||||
|
|
|
@ -1963,7 +1963,7 @@ public class ServiceSynchronize extends LifecycleService {
|
|||
|
||||
MessageHelper helper = new MessageHelper((MimeMessage) imessage);
|
||||
MessageHelper.MessageParts parts = helper.getMessageParts();
|
||||
String body = parts.getHtml();
|
||||
String body = parts.getHtml(this);
|
||||
String preview = HtmlHelper.getPreview(body);
|
||||
message.write(this, body);
|
||||
db.message().setMessageContent(message.id, true, preview);
|
||||
|
@ -2625,7 +2625,7 @@ public class ServiceSynchronize extends LifecycleService {
|
|||
|
||||
if (!message.content)
|
||||
if (!metered || (message.size != null && message.size < maxSize)) {
|
||||
String body = parts.getHtml();
|
||||
String body = parts.getHtml(context);
|
||||
message.write(context, body);
|
||||
db.message().setMessageContent(message.id, true, HtmlHelper.getPreview(body));
|
||||
String warnings = parts.getWarnings();
|
||||
|
|
|
@ -439,6 +439,7 @@
|
|||
<string name="title_report">Report</string>
|
||||
<string name="title_no_ask_again">Do not ask this again</string>
|
||||
<string name="title_no_adobe">Adobe Acrobat reader cannot open safely shared files, see the FAQ for more information</string>
|
||||
<string name="title_no_charset">Unsupported encoding: %1$s</string>
|
||||
|
||||
<string name="title_try">Try FairEmail, an open source, privacy friendly email app for Android</string>
|
||||
|
||||
|
|
Loading…
Reference in a new issue