From 3add6dc16fe2cc0ca6b0d5dfc1a56efabf61122b Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Thu, 17 Jan 2019 18:28:52 +0000 Subject: [PATCH] --- devdocs/todo.txt | 3 +++ server/AyaNova/biz/LocaleBiz.cs | 22 +++++++++++++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/devdocs/todo.txt b/devdocs/todo.txt index 1dc9d83a..c4476db6 100644 --- a/devdocs/todo.txt +++ b/devdocs/todo.txt @@ -20,6 +20,9 @@ SERVER - Resource localization edit all Custom field locale keys for all langauges and change to be 1 to 16 (remove 0 and add 6 more) - So, for example ClientCustom0 becomes ClientCustom1 and make sure the display values are identical as right now there are "My Custom0" and "Custom Field 8" in the same bunch - Copy from WidgetCustom1 to 16 if necessary or for reference + - Fixup the imported local customs too + + - Importv7Locale: add code to fixup the imported locale with any keys it's missing from the stock english resource key set on import - Resource localization edit wherever possible to change "Common*" such as "CommonActive" to remove the "common" part wherever possible. - Also check if used anywhere in client or at server and rename there too diff --git a/server/AyaNova/biz/LocaleBiz.cs b/server/AyaNova/biz/LocaleBiz.cs index 4aca5b09..7f98ebc9 100644 --- a/server/AyaNova/biz/LocaleBiz.cs +++ b/server/AyaNova/biz/LocaleBiz.cs @@ -165,7 +165,7 @@ namespace AyaNova.Biz } //Get the keys for a list of keys provided, static format for calling from other internal classes - internal static async Task> GetSubsetStatic(List param, long localeId) + internal static async Task> GetSubsetStatic(List param, long localeId) { #if (DEBUG) TrackRequestedKey(param); @@ -420,10 +420,26 @@ namespace AyaNova.Biz s = s.Replace("PurchaseOrderPurchaseOrder", "PurchaseOrder", StringComparison.InvariantCultureIgnoreCase); s = s.Replace("WorkorderItemMiscExpenseExpense", "WorkorderItemMiscExpense", StringComparison.InvariantCultureIgnoreCase); s = s.Replace("WorkorderItemTravelTravel", "WorkorderItemTravel", StringComparison.InvariantCultureIgnoreCase); + + + //Custom fields were 0 to 9, now 1 to 16 + s = s.Replace("Custom9", "Custom10", StringComparison.InvariantCultureIgnoreCase); + s = s.Replace("Custom8", "Custom9", StringComparison.InvariantCultureIgnoreCase); + s = s.Replace("Custom7", "Custom8", StringComparison.InvariantCultureIgnoreCase); + s = s.Replace("Custom6", "Custom7", StringComparison.InvariantCultureIgnoreCase); + s = s.Replace("Custom5", "Custom6", StringComparison.InvariantCultureIgnoreCase); + s = s.Replace("Custom4", "Custom5", StringComparison.InvariantCultureIgnoreCase); + s = s.Replace("Custom3", "Custom4", StringComparison.InvariantCultureIgnoreCase); + s = s.Replace("Custom2", "Custom3", StringComparison.InvariantCultureIgnoreCase); + if (!s.EndsWith("Custom10")) + s = s.Replace("Custom1", "Custom2", StringComparison.InvariantCultureIgnoreCase); + s = s.Replace("Custom0", "Custom1", StringComparison.InvariantCultureIgnoreCase); + //separate code will handle adding the new keys that didn't exist in v7 (custom 11 - 16) + return s; } - //ocaleBiz::ImportV7 - old Key "Locale.Label.UI.DestLocale" translates to new Key "LocaleDestLocale" which is not valid! + //LocaleBiz::ImportV7 - old Key "Locale.Label.UI.DestLocale" translates to new Key "LocaleDestLocale" which is not valid! //LocaleUIDestLocale @@ -490,7 +506,7 @@ namespace AyaNova.Biz var v = RxExtractLocaleName.Match(SourceLocaleFileName); var SourceLocaleName = v.Groups[1].ToString(); - //ENsure doesn't already exist + //Ensure doesn't already exist if (LocaleExists(SourceLocaleName)) { //If there are any validation errors, log in joblog and move on