translations and mentions enabled for channel messages while printing

This commit is contained in:
Vishal 2022-09-04 02:27:14 +05:30
parent 512547dda5
commit 3e8a4e87d6
2 changed files with 8 additions and 5 deletions

View File

@ -177,6 +177,7 @@ class EventData {
switch(kind) {
case 1:
case 42:
evaluatedContent = expandMentions(content);
if( translator != null && gTranslate && !evaluatedContent.isEnglish()) {
if( gDebug > 0) print("found that this comment is non-English: $evaluatedContent");
@ -287,11 +288,12 @@ class EventData {
}
String getAsLine({int len = 20}) {
if( len == 0 || len > content.length) {
len = content.length;
String contentToPrint = evaluatedContent.isEmpty? content: evaluatedContent;
if( len == 0 || len > contentToPrint.length) {
len = contentToPrint.length;
}
return '"${content.substring(0, len)}..." - ${getAuthorName(pubkey)}';
return '"${contentToPrint.substring(0, len)}..." - ${getAuthorName(pubkey)}';
}
String getStrForChannel(int depth) {
@ -299,7 +301,7 @@ class EventData {
String name = getAuthorName(pubkey);
String strDate = getPrintableDate(createdAt);
String tempEvaluatedContent = evaluatedContent;
String tempContent = content;
String tempContent = evaluatedContent.isEmpty? content: evaluatedContent;
if( isHidden) {
name = "<hidden>";

View File

@ -1,7 +1,8 @@
name: nostr_console
description: A multi-platform nostr client built for terminal/console.
version: 0.0.7-beta
homepage: https://github.com/vishalxl/nostr_console for 3-4 sept 2022
homepage: https://github.com/vishalxl/nostr_console
# translations and mentions enabled for channel messages while printing
# build where dm can be read