-
-
Save johnkors/528d2d2a8a5d46d4857d to your computer and use it in GitHub Desktop.
Local service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class LocalizationService : DefaultLocalizationService | |
{ | |
public override string GetString(string category, string id) | |
{ | |
switch (category) | |
{ | |
case Constants.LocalizationCategories.Messages: | |
var norwegianMessage = NorwegianMessages.GetString(id); | |
if (!string.IsNullOrEmpty(norwegianMessage)) | |
{ | |
return norwegianMessage; | |
} | |
return base.GetString(category, id); | |
case Constants.LocalizationCategories.Events: | |
return base.GetString(category, id); | |
case Constants.LocalizationCategories.Scopes: | |
return base.GetString(category, id); | |
} | |
return null; | |
} | |
public class NorwegianMessages | |
{ | |
public static string GetString(string id) | |
{ | |
if (id == MessageIds.InvalidUsernameOrPassword) | |
{ | |
return "Ugyldig e-post eller passord "; | |
} | |
if (id == MessageIds.UsernameRequired) | |
{ | |
return "E-post må fylles ut."; | |
} | |
if (id == MessageIds.PasswordRequired) | |
{ | |
return "Passord må fylles ut."; | |
} | |
if (id == MessageIds.Unauthorized_client) | |
{ | |
return "Klienten er ikke autorisert til dette."; | |
} | |
return null; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment