[M] 17 localization
This commit is contained in:
@@ -52,7 +52,7 @@ namespace tysdk.editor
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const string knowRegions = "knownRegions = (\n\t\t\t\ten,\n\t\t\t\tfr,\n\t\t\t\tde,\n\t\t\t\tes,\n\t\t\t\tid,\n\t\t\t\t\"zh-Hans\",\n\t\t\t\t\"zh-Hant\",\n\t\t\t);";
|
// const string knowRegions = "knownRegions = (\n\t\t\t\ten,\n\t\t\t\tfr,\n\t\t\t\tde,\n\t\t\t\tes,\n\t\t\t\tid,\n\t\t\t\t\"zh-Hans\",\n\t\t\t\t\"zh-Hant\", \n\t\t\t\t\"zh-Hant\", \n\t\t\t);";
|
||||||
|
|
||||||
const string developmentRegion = "developmentRegion = en;";
|
const string developmentRegion = "developmentRegion = en;";
|
||||||
|
|
||||||
@@ -62,10 +62,21 @@ namespace tysdk.editor
|
|||||||
Regex developmentRegionRegex = new Regex(@"developmentRegion\s*=\s*(\w+);");
|
Regex developmentRegionRegex = new Regex(@"developmentRegion\s*=\s*(\w+);");
|
||||||
Regex knownRegionsRegex = new Regex(@"knownRegions\s*=\s*\(([^)]+)\);");
|
Regex knownRegionsRegex = new Regex(@"knownRegions\s*=\s*\(([^)]+)\);");
|
||||||
raw = developmentRegionRegex.Replace(raw, developmentRegion);
|
raw = developmentRegionRegex.Replace(raw, developmentRegion);
|
||||||
raw = knownRegionsRegex.Replace(raw, knowRegions);
|
raw = knownRegionsRegex.Replace(raw, MakeRegionsStr("en", "fr", "de", "es", "id", "zh-Hans", "zh-Hant", "nl", "it", "ja", "ko", "ms", "pl", "pt", "th", "tr", "ar"));
|
||||||
File.WriteAllText(pbxProjPath, raw);
|
File.WriteAllText(pbxProjPath, raw);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static string MakeRegionsStr(params string[] regions)
|
||||||
|
{
|
||||||
|
var sb = new System.Text.StringBuilder();
|
||||||
|
foreach (var region in regions)
|
||||||
|
{
|
||||||
|
sb.Append($"\n\t\t\t\t{region},");
|
||||||
|
}
|
||||||
|
var str = sb.ToString();
|
||||||
|
return $"knownRegions = ({str.Substring(0,str.Length-1)}\t\t\t);";
|
||||||
|
}
|
||||||
|
|
||||||
private static void XcodeOverwriteFiles(string projPath, PBXProject proj)
|
private static void XcodeOverwriteFiles(string projPath, PBXProject proj)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -213,6 +224,7 @@ namespace tysdk.editor
|
|||||||
}
|
}
|
||||||
AddSKAdNetworkIdentifier(infoDict);
|
AddSKAdNetworkIdentifier(infoDict);
|
||||||
|
|
||||||
|
// "en", "fr", "de", "es", "id", "zh-Hans", "zh-Hant", "nl", "it", "ja", "ko", "ms", "pl", "pt", "th", "tr", "ar"
|
||||||
var localization = infoDict.CreateArray("CFBundleLocalizations");
|
var localization = infoDict.CreateArray("CFBundleLocalizations");
|
||||||
localization.AddString("en");
|
localization.AddString("en");
|
||||||
localization.AddString("fr");
|
localization.AddString("fr");
|
||||||
@@ -221,6 +233,16 @@ namespace tysdk.editor
|
|||||||
localization.AddString("id");
|
localization.AddString("id");
|
||||||
localization.AddString("zh_CN");
|
localization.AddString("zh_CN");
|
||||||
localization.AddString("zh_TW");
|
localization.AddString("zh_TW");
|
||||||
|
localization.AddString("nl");
|
||||||
|
localization.AddString("it");
|
||||||
|
localization.AddString("ja");
|
||||||
|
localization.AddString("ko");
|
||||||
|
localization.AddString("ms");
|
||||||
|
localization.AddString("pl");
|
||||||
|
localization.AddString("pt");
|
||||||
|
localization.AddString("th");
|
||||||
|
localization.AddString("tr");
|
||||||
|
localization.AddString("ar");
|
||||||
|
|
||||||
//CoMo
|
//CoMo
|
||||||
//<key>GOOGLE_ANALYTICS_DEFAULT_ALLOW_ANALYTICS_STORAGE</key> <true/>
|
//<key>GOOGLE_ANALYTICS_DEFAULT_ALLOW_ANALYTICS_STORAGE</key> <true/>
|
||||||
|
|||||||
Reference in New Issue
Block a user