Chinese Localization

This commit is contained in:
True Zhuanjia committed 2024-06-30 22:26:52 +08:00
1 parent 9d57c22757
commit 070fbc8b52
15 files changed
+3836 -294

No files matched your search

File diff suppressed because it is too large. Load diff
@@ -0,0 +1,21 @@
//
// LocalizationHelper.h
// Moonlight
//
// Created by ZWM on 2024/6/30.
// Copyright © 2024 Moonlight Game Streaming Project. All rights reserved.
//
#ifndef LocalizationHelper_h
#define LocalizationHelper_h
#import <Foundation/Foundation.h>
@interface LocalizationHelper : NSObject
// Method to get localized string with format arguments
+ (NSString *)localizedStringForKey:(NSString *)key, ... NS_FORMAT_FUNCTION(1,2);
@end
#endif /* LocalizationHelper_h */
@@ -0,0 +1,22 @@
//
// LocalizationHelper.m
// Moonlight
//
// Created by Admin on 2024/6/30.
// Copyright © 2024 Moonlight Game Streaming Project. All rights reserved.
//
#import "LocalizationHelper.h"
@implementation LocalizationHelper
+ (NSString *)localizedStringForKey:(NSString *)key, ... {
va_list args;
va_start(args, key);
NSString *format = NSLocalizedStringFromTable(key, @"Localizable", nil);
NSString *result = [[NSString alloc] initWithFormat:format arguments:args];
va_end(args);
return result;
}
@end