添加印度尼西亚
This commit is contained in:
@@ -452,7 +452,7 @@
|
|||||||
"insetLeft": 4,
|
"insetLeft": 4,
|
||||||
"insetRight": 4,
|
"insetRight": 4,
|
||||||
"gap": 5,
|
"gap": 5,
|
||||||
"items": ["sym:-", "sym:/", "sym::", "sym:;", "sym:(", "sym:)", "sym:Rp", "sym:&", "sym:@", "sym:\""]
|
"items": ["sym:-", "sym:/", "sym::", "sym:;", "sym:(", "sym:)", "sym:¥", "sym:&", "sym:@", "sym:\""]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"align": "center",
|
"align": "center",
|
||||||
@@ -496,7 +496,7 @@
|
|||||||
"insetLeft": 4,
|
"insetLeft": 4,
|
||||||
"insetRight": 4,
|
"insetRight": 4,
|
||||||
"gap": 5,
|
"gap": 5,
|
||||||
"items": ["sym:_", "sym:\\", "sym:|", "sym:~", "sym:<", "sym:>", "sym:Rp", "sym:$", "sym:€", "sym:·"]
|
"items": ["sym:_", "sym:\\", "sym:|", "sym:~", "sym:<", "sym:>", "sym:$", "sym:€", "sym:£", "sym:·"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"align": "center",
|
"align": "center",
|
||||||
|
|||||||
@@ -742,99 +742,99 @@ static NSString * const kKBSkinMetadataThemeKey = @"theme_json";
|
|||||||
NSString *skinsRoot = [baseRoot stringByAppendingPathComponent:@"Skins"];
|
NSString *skinsRoot = [baseRoot stringByAppendingPathComponent:@"Skins"];
|
||||||
NSString *skinRoot = [skinsRoot stringByAppendingPathComponent:skinId];
|
NSString *skinRoot = [skinsRoot stringByAppendingPathComponent:skinId];
|
||||||
NSString *iconsDir = [skinRoot stringByAppendingPathComponent:@"icons"];
|
NSString *iconsDir = [skinRoot stringByAppendingPathComponent:@"icons"];
|
||||||
|
|
||||||
|
// 每次切换语言都强制重新解压,确保获取最新的皮肤资源
|
||||||
|
NSLog(@"[SkinBridge] Force reinstall skin: %@", skinId);
|
||||||
|
[fm removeItemAtPath:skinRoot error:nil];
|
||||||
[fm createDirectoryAtPath:iconsDir
|
[fm createDirectoryAtPath:iconsDir
|
||||||
withIntermediateDirectories:YES
|
withIntermediateDirectories:YES
|
||||||
attributes:nil
|
attributes:nil
|
||||||
error:NULL];
|
error:NULL];
|
||||||
BOOL isDir = NO;
|
|
||||||
BOOL hasIconsDir = [fm fileExistsAtPath:iconsDir isDirectory:&isDir] && isDir;
|
|
||||||
NSArray *contents = hasIconsDir ? [fm contentsOfDirectoryAtPath:iconsDir error:NULL] : nil;
|
|
||||||
BOOL hasCachedAssets = (contents.count > 0);
|
|
||||||
NSString *bgPath = [skinRoot stringByAppendingPathComponent:@"background.png"];
|
|
||||||
|
|
||||||
if (!hasCachedAssets) {
|
NSString *fileName = zipName;
|
||||||
NSString *fileName = zipName;
|
if ([fileName hasPrefix:@"bundle://"]) {
|
||||||
if ([fileName hasPrefix:@"bundle://"]) {
|
fileName = [fileName substringFromIndex:[@"bundle://" length]];
|
||||||
fileName = [fileName substringFromIndex:[@"bundle://" length]];
|
}
|
||||||
}
|
NSString *dir = [fileName stringByDeletingLastPathComponent];
|
||||||
NSString *dir = [fileName stringByDeletingLastPathComponent];
|
NSString *last = fileName.lastPathComponent;
|
||||||
NSString *last = fileName.lastPathComponent;
|
NSString *ext = last.pathExtension;
|
||||||
NSString *ext = last.pathExtension;
|
NSString *base = last;
|
||||||
NSString *base = last;
|
if (ext.length == 0) {
|
||||||
if (ext.length == 0) {
|
ext = @"zip";
|
||||||
ext = @"zip";
|
} else {
|
||||||
} else {
|
base = [last stringByDeletingPathExtension];
|
||||||
base = [last stringByDeletingPathExtension];
|
}
|
||||||
}
|
|
||||||
|
|
||||||
NSString *zipPath = nil;
|
NSString *zipPath = nil;
|
||||||
if (dir.length > 0) {
|
if (dir.length > 0) {
|
||||||
zipPath = [bundle pathForResource:base ofType:ext inDirectory:dir];
|
zipPath = [bundle pathForResource:base ofType:ext inDirectory:dir];
|
||||||
} else {
|
} else {
|
||||||
zipPath = [bundle pathForResource:base ofType:ext];
|
zipPath = [bundle pathForResource:base ofType:ext];
|
||||||
}
|
}
|
||||||
if (zipPath.length == 0) {
|
|
||||||
if (error) {
|
|
||||||
*error = [NSError errorWithDomain:KBSkinBridgeErrorDomain
|
|
||||||
code:KBSkinBridgeErrorZipMissing
|
|
||||||
userInfo:@{NSLocalizedDescriptionKey: @"Zip resource not found"}];
|
|
||||||
}
|
|
||||||
return NO;
|
|
||||||
}
|
|
||||||
|
|
||||||
NSError *unzipError = nil;
|
if (zipPath.length == 0) {
|
||||||
BOOL ok = [SSZipArchive unzipFileAtPath:zipPath
|
if (error) {
|
||||||
toDestination:skinRoot
|
*error = [NSError errorWithDomain:KBSkinBridgeErrorDomain
|
||||||
overwrite:YES
|
code:KBSkinBridgeErrorZipMissing
|
||||||
password:nil
|
userInfo:@{NSLocalizedDescriptionKey: @"Zip resource not found"}];
|
||||||
error:&unzipError];
|
|
||||||
if (!ok || unzipError) {
|
|
||||||
if (error) {
|
|
||||||
*error = unzipError ?: [NSError errorWithDomain:KBSkinBridgeErrorDomain
|
|
||||||
code:KBSkinBridgeErrorUnzipFailed
|
|
||||||
userInfo:nil];
|
|
||||||
}
|
|
||||||
return NO;
|
|
||||||
}
|
}
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
BOOL isDir2 = NO;
|
NSError *unzipError = nil;
|
||||||
NSArray *iconsContent = [fm contentsOfDirectoryAtPath:iconsDir error:NULL];
|
BOOL unzipOK = [SSZipArchive unzipFileAtPath:zipPath
|
||||||
BOOL iconsValid = ([fm fileExistsAtPath:iconsDir isDirectory:&isDir2] && isDir2 && iconsContent.count > 0);
|
toDestination:skinRoot
|
||||||
if (!iconsValid) {
|
overwrite:YES
|
||||||
NSArray<NSString *> *subItems = [fm contentsOfDirectoryAtPath:skinRoot error:NULL];
|
password:nil
|
||||||
for (NSString *subName in subItems) {
|
error:&unzipError];
|
||||||
if ([subName isEqualToString:@"icons"] || [subName isEqualToString:@"__MACOSX"]) continue;
|
if (!unzipOK || unzipError) {
|
||||||
NSString *nestedRoot = [skinRoot stringByAppendingPathComponent:subName];
|
if (error) {
|
||||||
BOOL isDirNested = NO;
|
*error = unzipError ?: [NSError errorWithDomain:KBSkinBridgeErrorDomain
|
||||||
if (![fm fileExistsAtPath:nestedRoot isDirectory:&isDirNested] || !isDirNested) continue;
|
code:KBSkinBridgeErrorUnzipFailed
|
||||||
|
userInfo:nil];
|
||||||
|
}
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
NSString *nestedIcons = [nestedRoot stringByAppendingPathComponent:@"icons"];
|
BOOL isDir2 = NO;
|
||||||
BOOL isDirNestedIcons = NO;
|
NSArray *iconsContent = [fm contentsOfDirectoryAtPath:iconsDir error:NULL];
|
||||||
if ([fm fileExistsAtPath:nestedIcons isDirectory:&isDirNestedIcons] && isDirNestedIcons) {
|
BOOL iconsValid = ([fm fileExistsAtPath:iconsDir isDirectory:&isDir2] && isDir2 && iconsContent.count > 0);
|
||||||
NSArray *nestedFiles = [fm contentsOfDirectoryAtPath:nestedIcons error:NULL];
|
if (!iconsValid) {
|
||||||
if (nestedFiles.count > 0) {
|
NSArray<NSString *> *subItems = [fm contentsOfDirectoryAtPath:skinRoot error:NULL];
|
||||||
[fm createDirectoryAtPath:iconsDir
|
for (NSString *subName in subItems) {
|
||||||
withIntermediateDirectories:YES
|
if ([subName isEqualToString:@"icons"] || [subName isEqualToString:@"__MACOSX"]) continue;
|
||||||
attributes:nil
|
NSString *nestedRoot = [skinRoot stringByAppendingPathComponent:subName];
|
||||||
error:NULL];
|
BOOL isDirNested = NO;
|
||||||
for (NSString *fn in nestedFiles) {
|
if (![fm fileExistsAtPath:nestedRoot isDirectory:&isDirNested] || !isDirNested) continue;
|
||||||
NSString *from = [nestedIcons stringByAppendingPathComponent:fn];
|
|
||||||
NSString *to = [iconsDir stringByAppendingPathComponent:fn];
|
NSString *nestedIcons = [nestedRoot stringByAppendingPathComponent:@"icons"];
|
||||||
[fm removeItemAtPath:to error:nil];
|
BOOL isDirNestedIcons = NO;
|
||||||
[fm moveItemAtPath:from toPath:to error:nil];
|
if ([fm fileExistsAtPath:nestedIcons isDirectory:&isDirNestedIcons] && isDirNestedIcons) {
|
||||||
}
|
NSArray *nestedFiles = [fm contentsOfDirectoryAtPath:nestedIcons error:NULL];
|
||||||
|
if (nestedFiles.count > 0) {
|
||||||
|
[fm createDirectoryAtPath:iconsDir
|
||||||
|
withIntermediateDirectories:YES
|
||||||
|
attributes:nil
|
||||||
|
error:NULL];
|
||||||
|
for (NSString *fn in nestedFiles) {
|
||||||
|
NSString *from = [nestedIcons stringByAppendingPathComponent:fn];
|
||||||
|
NSString *to = [iconsDir stringByAppendingPathComponent:fn];
|
||||||
|
[fm removeItemAtPath:to error:nil];
|
||||||
|
[fm moveItemAtPath:from toPath:to error:nil];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
NSString *nestedBg = [nestedRoot stringByAppendingPathComponent:@"background.png"];
|
NSString *nestedBg = [nestedRoot stringByAppendingPathComponent:@"background.png"];
|
||||||
if ([fm fileExistsAtPath:nestedBg]) {
|
if ([fm fileExistsAtPath:nestedBg]) {
|
||||||
[fm removeItemAtPath:bgPath error:nil];
|
NSString *bgPath = [skinRoot stringByAppendingPathComponent:@"background.png"];
|
||||||
[fm moveItemAtPath:nestedBg toPath:bgPath error:nil];
|
[fm removeItemAtPath:bgPath error:nil];
|
||||||
}
|
[fm moveItemAtPath:nestedBg toPath:bgPath error:nil];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NSString *bgPath = [skinRoot stringByAppendingPathComponent:@"background.png"];
|
||||||
NSDictionary *shortNames = payload[kKBSkinPendingIconShortKey];
|
NSDictionary *shortNames = payload[kKBSkinPendingIconShortKey];
|
||||||
if (![shortNames isKindOfClass:NSDictionary.class] || shortNames.count == 0) {
|
if (![shortNames isKindOfClass:NSDictionary.class] || shortNames.count == 0) {
|
||||||
NSString *currentLanguageCode = [[NSUserDefaults standardUserDefaults]
|
NSString *currentLanguageCode = [[NSUserDefaults standardUserDefaults]
|
||||||
|
|||||||
@@ -74,7 +74,7 @@
|
|||||||
{
|
{
|
||||||
"code": "id",
|
"code": "id",
|
||||||
"name": "Bahasa Indonesia",
|
"name": "Bahasa Indonesia",
|
||||||
"defaultSkinZip": "",
|
"defaultSkinZip": "印度尼西亚初始皮肤.zip",
|
||||||
"layouts": [
|
"layouts": [
|
||||||
{
|
{
|
||||||
"variant": "qwerty",
|
"variant": "qwerty",
|
||||||
|
|||||||
@@ -47,6 +47,7 @@
|
|||||||
043213B62F5582710065C888 /* spanish_words.json in Resources */ = {isa = PBXBuildFile; fileRef = 043213B52F5582710065C888 /* spanish_words.json */; };
|
043213B62F5582710065C888 /* spanish_words.json in Resources */ = {isa = PBXBuildFile; fileRef = 043213B52F5582710065C888 /* spanish_words.json */; };
|
||||||
043213BD2F56A3920065C888 /* 西班牙初始皮肤.zip in Resources */ = {isa = PBXBuildFile; fileRef = 043213BC2F56A3920065C888 /* 西班牙初始皮肤.zip */; };
|
043213BD2F56A3920065C888 /* 西班牙初始皮肤.zip in Resources */ = {isa = PBXBuildFile; fileRef = 043213BC2F56A3920065C888 /* 西班牙初始皮肤.zip */; };
|
||||||
043213BE2F56A3920065C888 /* 葡萄牙初始皮肤.zip in Resources */ = {isa = PBXBuildFile; fileRef = 043213BB2F56A3920065C888 /* 葡萄牙初始皮肤.zip */; };
|
043213BE2F56A3920065C888 /* 葡萄牙初始皮肤.zip in Resources */ = {isa = PBXBuildFile; fileRef = 043213BB2F56A3920065C888 /* 葡萄牙初始皮肤.zip */; };
|
||||||
|
043213C02F56C9330065C888 /* 印度尼西亚初始皮肤.zip in Resources */ = {isa = PBXBuildFile; fileRef = 043213BF2F56C9330065C888 /* 印度尼西亚初始皮肤.zip */; };
|
||||||
043FBCD22EAF97630036AFE1 /* KBPermissionViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 04C6EAE12EAF940F0089C901 /* KBPermissionViewController.m */; };
|
043FBCD22EAF97630036AFE1 /* KBPermissionViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 04C6EAE12EAF940F0089C901 /* KBPermissionViewController.m */; };
|
||||||
0450AA742EF013D000B6AF06 /* KBEmojiCollectionCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 0450AA732EF013D000B6AF06 /* KBEmojiCollectionCell.m */; };
|
0450AA742EF013D000B6AF06 /* KBEmojiCollectionCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 0450AA732EF013D000B6AF06 /* KBEmojiCollectionCell.m */; };
|
||||||
0450AAE22EF03D5100B6AF06 /* KBPerson.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0450AAE12EF03D5100B6AF06 /* KBPerson.swift */; };
|
0450AAE22EF03D5100B6AF06 /* KBPerson.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0450AAE12EF03D5100B6AF06 /* KBPerson.swift */; };
|
||||||
@@ -406,6 +407,7 @@
|
|||||||
043213B52F5582710065C888 /* spanish_words.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = spanish_words.json; sourceTree = "<group>"; };
|
043213B52F5582710065C888 /* spanish_words.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = spanish_words.json; sourceTree = "<group>"; };
|
||||||
043213BB2F56A3920065C888 /* 葡萄牙初始皮肤.zip */ = {isa = PBXFileReference; lastKnownFileType = archive.zip; path = "葡萄牙初始皮肤.zip"; sourceTree = "<group>"; };
|
043213BB2F56A3920065C888 /* 葡萄牙初始皮肤.zip */ = {isa = PBXFileReference; lastKnownFileType = archive.zip; path = "葡萄牙初始皮肤.zip"; sourceTree = "<group>"; };
|
||||||
043213BC2F56A3920065C888 /* 西班牙初始皮肤.zip */ = {isa = PBXFileReference; lastKnownFileType = archive.zip; path = "西班牙初始皮肤.zip"; sourceTree = "<group>"; };
|
043213BC2F56A3920065C888 /* 西班牙初始皮肤.zip */ = {isa = PBXFileReference; lastKnownFileType = archive.zip; path = "西班牙初始皮肤.zip"; sourceTree = "<group>"; };
|
||||||
|
043213BF2F56C9330065C888 /* 印度尼西亚初始皮肤.zip */ = {isa = PBXFileReference; lastKnownFileType = archive.zip; path = "印度尼西亚初始皮肤.zip"; sourceTree = "<group>"; };
|
||||||
0450AA722EF013D000B6AF06 /* KBEmojiCollectionCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBEmojiCollectionCell.h; sourceTree = "<group>"; };
|
0450AA722EF013D000B6AF06 /* KBEmojiCollectionCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBEmojiCollectionCell.h; sourceTree = "<group>"; };
|
||||||
0450AA732EF013D000B6AF06 /* KBEmojiCollectionCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBEmojiCollectionCell.m; sourceTree = "<group>"; };
|
0450AA732EF013D000B6AF06 /* KBEmojiCollectionCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBEmojiCollectionCell.m; sourceTree = "<group>"; };
|
||||||
0450AAE02EF03D5100B6AF06 /* keyBoard-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "keyBoard-Bridging-Header.h"; sourceTree = "<group>"; };
|
0450AAE02EF03D5100B6AF06 /* keyBoard-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "keyBoard-Bridging-Header.h"; sourceTree = "<group>"; };
|
||||||
@@ -1307,6 +1309,7 @@
|
|||||||
045ED52A2F540FBE00131114 /* normal_them.zip */,
|
045ED52A2F540FBE00131114 /* normal_them.zip */,
|
||||||
043213BB2F56A3920065C888 /* 葡萄牙初始皮肤.zip */,
|
043213BB2F56A3920065C888 /* 葡萄牙初始皮肤.zip */,
|
||||||
043213BC2F56A3920065C888 /* 西班牙初始皮肤.zip */,
|
043213BC2F56A3920065C888 /* 西班牙初始皮肤.zip */,
|
||||||
|
043213BF2F56C9330065C888 /* 印度尼西亚初始皮肤.zip */,
|
||||||
);
|
);
|
||||||
path = Resource;
|
path = Resource;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@@ -2345,6 +2348,7 @@
|
|||||||
046086CB2F1A092500757C95 /* comments_mock.json in Resources */,
|
046086CB2F1A092500757C95 /* comments_mock.json in Resources */,
|
||||||
04E038E32F20E500002CA5A0 /* deepgramAPI.md in Resources */,
|
04E038E32F20E500002CA5A0 /* deepgramAPI.md in Resources */,
|
||||||
043213A92F5566EF0065C888 /* kb_input_profiles.json in Resources */,
|
043213A92F5566EF0065C888 /* kb_input_profiles.json in Resources */,
|
||||||
|
043213C02F56C9330065C888 /* 印度尼西亚初始皮肤.zip in Resources */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
|
|||||||
BIN
keyBoard/Class/Resource/印度尼西亚初始皮肤.zip
Normal file
BIN
keyBoard/Class/Resource/印度尼西亚初始皮肤.zip
Normal file
Binary file not shown.
Reference in New Issue
Block a user