Skip to content

Commit

Permalink
Finalizing Translations
Browse files Browse the repository at this point in the history
  • Loading branch information
TechUnRestricted committed Jan 7, 2024
1 parent a92f820 commit 64f36e9
Show file tree
Hide file tree
Showing 9 changed files with 775 additions and 630 deletions.
608 changes: 319 additions & 289 deletions WinDiskWriter/LocalizedStrings/LocalizedStrings.h

Large diffs are not rendered by default.

648 changes: 344 additions & 304 deletions WinDiskWriter/LocalizedStrings/LocalizedStrings.m

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions WinDiskWriter/LocalizedStrings/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,30 @@
"ALERT_TITLE_WRITE_FILE_PROBLEM_OCCURRED" = "A problem occurred while writing the file to disk";


"AS_LOG_TYPE_ASSERTION_ERROR" = "AssertionFailure";


"AS_LOG_TYPE_FAILURE" = "Failure";


"AS_LOG_TYPE_FATAL" = "Fatal";


"AS_LOG_TYPE_LOG" = "Log";


"AS_LOG_TYPE_SKIPPED" = "Skipped";


"AS_LOG_TYPE_START" = "Start";


"AS_LOG_TYPE_SUCCESS" = "Success";


"AS_LOG_TYPE_WARNING" = "Warning";


"AUTHORIZATION_ERROR_BAD_ADDRESS" = "The requested socket address is invalid (must be 0-1023 inclusive).";


Expand Down Expand Up @@ -360,6 +384,12 @@
"LOGVIEW_ROW_CREATE_DIRECTORY_AT_APP_FOLDER_PATH" = "Create directory at Application Folder path: '%@'.";


"LOGVIEW_ROW_FOUND_LEGACY_BOOTLOADER_FILES" = "Found Legacy Bootloader files.";


"LOGVIEW_ROW_LEGACY_BOOTLOADER_FILES_NOT_FOUND" = "Legacy Bootloader files were not found.";


"LOGVIEW_ROW_PARTIAL_TITLE_ERROR_MESSAGE" = "(Error message: '%@')";


Expand Down
30 changes: 30 additions & 0 deletions WinDiskWriter/LocalizedStrings/ru.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,30 @@
"ALERT_TITLE_WRITE_FILE_PROBLEM_OCCURRED" = "Произошла проблема во время записи файла на диск";


"AS_LOG_TYPE_ASSERTION_ERROR" = "Нарушение условия";


"AS_LOG_TYPE_FAILURE" = "Ошибка";


"AS_LOG_TYPE_FATAL" = "Фатальная ошибка";


"AS_LOG_TYPE_LOG" = "Инфо";


"AS_LOG_TYPE_SKIPPED" = "Пропущено";


"AS_LOG_TYPE_START" = "Старт";


"AS_LOG_TYPE_SUCCESS" = "Успешно";


"AS_LOG_TYPE_WARNING" = "Предупреждение";


"AUTHORIZATION_ERROR_BAD_ADDRESS" = "Запрошенный адрес сокета не является валидным (должен быть в диапазоне 0-1023 включительно).";


Expand Down Expand Up @@ -360,6 +384,12 @@
"LOGVIEW_ROW_CREATE_DIRECTORY_AT_APP_FOLDER_PATH" = "Создание директории в директории приложения: '%@'.";


"LOGVIEW_ROW_FOUND_LEGACY_BOOTLOADER_FILES" = "Найдены файлы загрузчика Legacy BIOS.";


"LOGVIEW_ROW_LEGACY_BOOTLOADER_FILES_NOT_FOUND" = "Файла загрузчика Legacy BIOS не были найдены.";


"LOGVIEW_ROW_PARTIAL_TITLE_ERROR_MESSAGE" = "(Сообщение об ошибке: '%@')";


Expand Down
4 changes: 0 additions & 4 deletions WinDiskWriter/Views/AdvancedTextView/AdvancedTextView.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

NS_ASSUME_NONNULL_BEGIN

typedef NSString *ASLogType NS_TYPED_ENUM;

@interface AdvancedTextView : NSScrollView

@property (nonatomic, strong, readonly) VibrantTextView *textViewInstance;
Expand All @@ -23,8 +21,6 @@ typedef NSString *ASLogType NS_TYPED_ENUM;

- (void)appendTimestampedLine: (NSString *)message;

- (void)appendTimestampedLine: (NSString *)message
logType: (ASLogType)logType;
- (void)clear;

@end
Expand Down
8 changes: 0 additions & 8 deletions WinDiskWriter/Views/AdvancedTextView/AdvancedTextView.m
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,6 @@ - (BOOL)allowsVibrancy {
return YES;
}

- (void)appendTimestampedLine: (NSString *)message
logType: (ASLogType)logType {
NSString *timeString = [dateFormatter stringFromDate: NSDate.date];
NSString *timestampedString = [NSString stringWithFormat:@"[(%@) %@] %@", logType, timeString, message];

[self appendLine: timestampedString];
}

- (void)appendTimestampedLine: (NSString *)message {
NSString *timeString = [dateFormatter stringFromDate: NSDate.date];

Expand Down
22 changes: 11 additions & 11 deletions WinDiskWriter/Views/LogView/LogView.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@

NS_ASSUME_NONNULL_BEGIN

typedef NSString *ASLogType NS_TYPED_ENUM;

extern ASLogType const ASLogTypeStart;
extern ASLogType const ASLogTypeSuccess;
extern ASLogType const ASLogTypeFailure;
extern ASLogType const ASLogTypeSkipped;

extern ASLogType const ASLogTypeLog;
extern ASLogType const ASLogTypeWarning;
extern ASLogType const ASLogTypeFatal;
extern ASLogType const ASLogTypeAssertionError;
typedef NS_ENUM(NSUInteger, ASLogType) {
ASLogTypeStart,
ASLogTypeSuccess,
ASLogTypeFailure,
ASLogTypeSkipped,
ASLogTypeLog,
ASLogTypeWarning,
ASLogTypeFatal,
ASLogTypeAssertionError
};

@interface LogView : NSScrollView

Expand Down
51 changes: 39 additions & 12 deletions WinDiskWriter/Views/LogView/LogView.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,51 @@
#import "NSColor+Common.h"
#import "VibrantTableView.h"
#import "NSMutableAttributedString+Common.h"
#import "LocalizedStrings.h"
#import "ContaineredTableView.h"
#import "MiddleAlignedCell.h"

ASLogType const ASLogTypeStart = @"Start";
ASLogType const ASLogTypeSuccess = @"Success";
ASLogType const ASLogTypeFailure = @"Failure";
ASLogType const ASLogTypeSkipped = @"Skipped";

ASLogType const ASLogTypeLog = @"Log";
ASLogType const ASLogTypeWarning = @"Warning";
ASLogType const ASLogTypeFatal = @"Fatal";
ASLogType const ASLogTypeAssertionError = @"AssertionFailure";

/*
ASLogType ASLogTypeStart = @"Start";
ASLogType ASLogTypeSuccess = @"Success";
ASLogType ASLogTypeFailure = @"Failure";
ASLogType ASLogTypeSkipped = @"Skipped";
ASLogType ASLogTypeLog = @"Log";
ASLogType ASLogTypeWarning = @"Warning";
ASLogType ASLogTypeFatal = @"Fatal";
ASLogType ASLogTypeAssertionError = @"AssertionFailure";
*/

@implementation LogView {
NSDateFormatter *dateFormatter;
NSTextField *dummyTextField;
}

+ (NSString *)logTypeStringForKey: (ASLogType)logType {
switch (logType) {
case ASLogTypeStart:
return [LocalizedStrings asLogTypeStart];
case ASLogTypeSuccess:
return [LocalizedStrings asLogTypeSuccess];
case ASLogTypeFailure:
return [LocalizedStrings asLogTypeFailure];
case ASLogTypeSkipped:
return [LocalizedStrings asLogTypeSkipped];
case ASLogTypeLog:
return [LocalizedStrings asLogTypeLog];
case ASLogTypeWarning:
return [LocalizedStrings asLogTypeWarning];
case ASLogTypeFatal:
return [LocalizedStrings asLogTypeFatal];
case ASLogTypeAssertionError:
return [LocalizedStrings asLogTypeAssertionError];
}

// Fallback value
return [LocalizedStrings asLogTypeLog];
}

- (instancetype)init {
self = [super init];

Expand Down Expand Up @@ -106,14 +133,14 @@ - (void)appendRow:(NSString *)string {

- (void)appendTimestampedRow: (NSString *)string
logType: (ASLogType)logType {
NSString *timestampedString = [NSString stringWithFormat: @"[(%@) %@] %@", logType, [self timeString], string];
NSString *timestampedString = [NSString stringWithFormat: @"[(%@) %@] %@", [LogView logTypeStringForKey: logType], [self timeString], string];

[self appendRow: timestampedString];
}

- (void)appendRow: (NSString *)string
logType: (ASLogType)logType {
NSString *logTypedString = [NSString stringWithFormat: @"[%@] %@", logType, string];
NSString *logTypedString = [NSString stringWithFormat: @"[%@] %@", [LogView logTypeStringForKey: logType], string];

[self appendRow:logTypedString];
}
Expand Down
4 changes: 2 additions & 2 deletions WinDiskWriter/Windows/MainWindow/MainWindow.m
Original file line number Diff line number Diff line change
Expand Up @@ -866,9 +866,9 @@ - (void)writeAction {
if (installLegacyBoot) {
BOOL bootloaderLegacyFilesDownloaded = [self downloadLegacyBootloaderFiles];
if (bootloaderLegacyFilesDownloaded) {
[self->logsView appendRow:@"Found Legacy Bootloader files." logType:ASLogTypeSuccess];
[self->logsView appendRow:[LocalizedStrings logviewRowFoundLegacyBootloaderFiles] logType:ASLogTypeSuccess];
} else {
[self->logsView appendRow:@"Legacy Bootloader files were not found." logType:ASLogTypeFatal];
[self->logsView appendRow:[LocalizedStrings logviewRowLegacyBootloaderFilesNotFound] logType:ASLogTypeFatal];

WriteExitForce();
}
Expand Down

0 comments on commit 64f36e9

Please sign in to comment.