Locale -> Translation

This commit is contained in:
2020-03-06 19:36:36 +00:00
parent 884c834b3d
commit a234b3531d
58 changed files with 540 additions and 569 deletions

View File

@@ -508,10 +508,10 @@ namespace AyaNova.Util
//TEST NOT ACTIVE - this is used for a test to see if inactive user can login
await GenSeedUserAsync(log, 1, AuthorizationRoles.OpsAdminLimited, UserType.NonSchedulable, false, "TEST_INACTIVE", "TEST_INACTIVE");
//Alternate locale users for each stock locale
await GenSeedUserAsync(log, 1, AuthorizationRoles.All, UserType.Administrator, true, "de", "de", await LocaleBiz.LocaleNameToIdStaticAsync("de"));
await GenSeedUserAsync(log, 1, AuthorizationRoles.All, UserType.Administrator, true, "es", "es", await LocaleBiz.LocaleNameToIdStaticAsync("es"));
await GenSeedUserAsync(log, 1, AuthorizationRoles.All, UserType.Administrator, true, "fr", "fr", await LocaleBiz.LocaleNameToIdStaticAsync("fr"));
//Alternate translation users for each stock translation
await GenSeedUserAsync(log, 1, AuthorizationRoles.All, UserType.Administrator, true, "de", "de", await TranslationBiz.TranslationNameToIdStaticAsync("de"));
await GenSeedUserAsync(log, 1, AuthorizationRoles.All, UserType.Administrator, true, "es", "es", await TranslationBiz.TranslationNameToIdStaticAsync("es"));
await GenSeedUserAsync(log, 1, AuthorizationRoles.All, UserType.Administrator, true, "fr", "fr", await TranslationBiz.TranslationNameToIdStaticAsync("fr"));
}
@@ -548,10 +548,10 @@ namespace AyaNova.Util
public static async Task GenSeedUserAsync(ILogger log, int count, AuthorizationRoles roles, UserType userType,
bool active = true, string login = null, string password = null, long localeId = 0)
bool active = true, string login = null, string password = null, long translationId = 0)
{
if (localeId == 0)
localeId = ServerBootConfig.AYANOVA_DEFAULT_LANGUAGE_ID;
if (translationId == 0)
translationId = ServerBootConfig.AYANOVA_DEFAULT_TRANSLATION_ID;
//Don't do the following commented out, it's slower
// using (var ct = ServiceProviderProvider.DBContext)
@@ -582,7 +582,7 @@ namespace AyaNova.Util
else
u.Password = u.Login;
u.Roles = roles;
u.LocaleId = localeId;
u.TranslationId = translationId;
u.UserType = userType;
u.EmployeeNumber = "A-" + (454 + SeededUserCount).ToString() + "-Y";
u.Notes = Fake.Lorem.Sentence();//Fake.Lorem.Paragraph(2);