Hi, I have implemented a custom db localizationsource which was described here a few month ago. I'm using your Language Menu on top of the page! The currentlanguagemenu object is changing but abp.localization.values is not changing values to my selected language anymore. I think everything is correctly filled. Here is my code of my own dictionary provider:
public IDictionary<string, ILocalizationDictionary> Dictionaries { get; set; }
public void Initialize(string sourceName)
{
var cultures = _cultureService.GetOnlyLanguages().GlobalLanguages.ToList();
var entries = _labelTextService.GetTranslationTexts().TranslationTexts.ToList();
foreach (var culture in cultures)
{
var tempInfo = new CultureInfo(culture.IsoCode);
if(Dictionaries == null)
Dictionaries = new Dictionary<string, ILocalizationDictionary>();
Dictionaries.Add(tempInfo.ToString(),DbLocalizationDictionary.Build(tempInfo, entries));
}
}
Hi, I have updated abp to newest version and now my dictionary provider is not working anymore... The function GetDictionaries is not there anymore and LocalizationDictionaryInfo has less params...Could you please show me the correct code?
public IEnumerable<LocalizationDictionaryInfo> GetDictionaries(string sourceName)
{
var cultures = _cultureService.GetOnlyLanguages().GlobalLanguages.ToList();
var entries = _labelTextService.GetTranslationTexts().TranslationTexts.ToList();
var dictionaries = new List<LocalizationDictionaryInfo>();
foreach (var culture in cultures)
{
var tempInfo = new CultureInfo(culture.IsoCode);
dictionaries.Add(new LocalizationDictionaryInfo(DbLocalizationDictionary.Build(tempInfo, entries),
isDefault: Convert.ToBoolean(culture.DefaultLang)));
}
return dictionaries;
}
I have tried following code and the dictionaries are loaded. But if I change language in my menu, the localization do not swtich to the selected lang? [code][/public void Initialize(string sourceName) { var cultures = _cultureService.GetOnlyLanguages().GlobalLanguages.ToList(); var entries = _labelTextService.GetTranslationTexts().TranslationTexts.ToList();
foreach (var culture in cultures)
{
var tempInfo = new CultureInfo(culture.IsoCode);
if(Dictionaries == null)
Dictionaries = new Dictionary<string, ILocalizationDictionary>();
Dictionaries.Add(tempInfo.ToString(),DbLocalizationDictionary.Build(tempInfo, entries));
}
}code]
Hi, I'm trying to delete a table entry in db with foreign key properties to another table. Correctly, the enty is not deleted. My question, after going back to my javascript code: .error(function (response) { abp.message.error('Error Message', 'Is not deleted'); })
following popup appears in my browser. That is perfect. But before this popup appears, another popup is shown, which is not very userfriendly...Something like: An error occured while updating the entries. See the inner exception for details.... STACK TRACE: System.Data.Entity... and so on..
How can I turn off this message and only show up the abp.message.error?
Hi, could you please explain the abp setting table. I have filled the db table with content. Is it necessary to add these content in application settingprovider what I have done. If I started my app a few times and then try to add another setting in the db, the ID increments but not to the next number instead of for example from 3 to 10. I don't know why or haven't understood the settingmanager :-( Here in my application layer:
public override IEnumerable<SettingDefinition> GetSettingDefinitions(SettingDefinitionProviderContext context)
{
return new[]
{
new SettingDefinition(
"FunctionShowShortField",
"true",
scopes: SettingScopes.Application,
isVisibleToClients: true),
new SettingDefinition(
"ProcEditOnlyDraft",
"true",
scopes: SettingScopes.Application,
isVisibleToClients: true)
};
}
I wolud like to handle the values of the db table in my angular controller. (abp.setting.get("FunctionShowShortField"))
Hi, I have implemented Module Zero and everything works fine. Now I try to implement the Login later. What is the best way to do this? A normal user(Not logged in) can view the page and some buttons on top of the page! If the user clicks Button login, the Login Form should appear and after login the edit Buttons should also be visible! Thanks in advance Hans
Sorry, I think I misspelled my question. I only want to Show the username of the logged in user at the top of my application. And my question is is there an abp.user or something else so that I get the Name of the logged in user. In abp.session there is the id of the user and I can get the username from db, but I thought the username is saved somewhere after logging in
Hi! I logged in and returned to destination page. Is there a way to get the logged in user in my javascript code and hide some buttons if user is not in role to see this buttons?
Hi! You are right, the last error occurs, because I have used the entity. But on the server, the login is not shown instead of, this error occurs:
Sorry for my short question. I'm trying to unterstand the error. The error occurs in my debug mode too, but somewhere else.
In my console the following error appears (I have intgegrated module Zero. Something with getting users seems to be the error):
exceptionMessage: "The 'ObjectContent1' type failed to serialize the response body for content type 'application/json; charset=utf-8'." exceptionType: "System.InvalidOperationException" innerException: Object exceptionMessage: "Error getting value from 'CreatorUser' on 'System.Data.Entity.DynamicProxies.User_4730030EBB16241189B87A85A8706EE27908E7C722E1DAFA1C3B46C6AEC5217E'." exceptionType: "Newtonsoft.Json.JsonSerializationException" innerException: Object exceptionMessage: "The ObjectContext instance has been disposed and can no longer be used for operations that require a connection." exceptionType: "System.ObjectDisposedException" message: "An error has occurred." stackTrace: " bei System.Data.Entity.Core.Objects.ObjectContext.get_Connection() ↵ bei System.Data.Entity.Core.Objects.ObjectQuery
1.GetResults(Nullable1 forMergeOption) ↵ bei System.Data.Entity.Core.Objects.ObjectQuery
1.Execute(MergeOption mergeOption)
↵ bei System.Data.Entity.Core.Objects.DataClasses.EntityReference1.Load(MergeOption mergeOption) ↵ bei System.Data.Entity.Core.Objects.DataClasses.RelatedEnd.Load() ↵ bei System.Data.Entity.Core.Objects.DataClasses.RelatedEnd.DeferredLoad() ↵ bei System.Data.Entity.Core.Objects.Internal.LazyLoadBehavior.LoadProperty[TItem](TItem propertyValue, String relationshipName, String targetRoleName, Boolean mustBeNull, Object wrapperObject) ↵ bei System.Data.Entity.Core.Objects.Internal.LazyLoadBehavior.<>c__DisplayClass7
2.<GetInterceptorDelegate>b__2(TProxy proxy, TItem item)
↵ bei System.Data.Entity.DynamicProxies.User_4730030EBB16241189B87A85A8706EE27908E7C722E1DAFA1C3B46C6AEC5217E.get_CreatorUser()
↵ bei GetCreatorUser(Object )
↵ bei Newtonsoft.Json.Serialization.DynamicValueProvider.GetValue(Object target)"
proto: Object
message: "An error has occurred."
Hi, I published my project to my server, but if I try to start it, the following error occured, but I don't know a solution: The ObjectContext instance has been disposed and can no longer be used for operations that require a connection