abpframework / abp

Open Source Web Application Framework for ASP.NET Core. Offers an opinionated architecture to build enterprise software solutions with best practices on top of the .NET and the ASP.NET Core platforms. Provides the fundamental infrastructure, production-ready startup templates, application modules, UI themes, tooling, guides and documentation.
https://abp.io
GNU Lesser General Public License v3.0
12.31k stars 3.32k forks source link

Multi lingual entities #1754

Closed SVronskiy closed 3 years ago

SVronskiy commented 4 years ago

Hello!

Multi lingual entities were realized recently in ASP.NET Boilerplate Entites.

It supports IMultiLingualEntity, IEntityTranslation, Translations, MultiLingualMap, MultiLingual CRUD operation.

Please, realize, multi-lingual entities in Abp.Io Entites.

Regards, Sergey

a-patel commented 3 years ago

Any update on this?

maliming commented 3 years ago

There are currently no plans to implement it, it is still backlog.

yozzozo commented 3 years ago

+1 for this feature!

tntwist commented 3 years ago

Hi there,

I would like to contribute to this feature, since I need this feature for my projects and I already have some of the Components(Generic MultiLinuaglEntity/AggregateRootTypes, a MultiLingualManager Service and the MultiLingualMap).

@maliming Would it be ok for you, if I work on it?

maliming commented 3 years ago

Hi @tntwist We always welcome contributions.

tntwist commented 3 years ago

Great. I forked the repo and started the implementation. Just got the base types and interfaces today.

Everyone interested can track the progess here: tntwist/feat/multilingual-entities. Open for any kind of feedback and help.

realLiangshiwei commented 3 years ago

@tntwist Hi, Are you still working on this? I will implement this feature, if you don't have time.

tntwist commented 3 years ago

@tntwist Hi, Are you still working on this? I will implement this feature, if you don't have time.

@realLiangshiwei I was pretty busy the last two weeks and wont have time to work on it till mid of september. So you can implement it.

kion-admin commented 3 years ago

abp boilerplate was filter current language row in memory after get all rows from db, we'd better offer this as an option

MooazHammam commented 3 years ago

any updates regard this issue, is it planned to be released soon

muratyuceer commented 3 years ago

we are waiting

yozzozo commented 3 years ago

Hi @maliming, @realLiangshiwei and @hikalkan, just wondering what the current status of this feature is. This issue and #5265 are closed, but according to the latest Roadmap, it’s still on the backlog (as of 4.3 final). Can you please clarify?

Thanks!

maliming commented 3 years ago

@yozzozo This feature has been canceled.

yozzozo commented 3 years ago

@maliming May I ask why? I think this feature is very important for a lot of people (including myself). I see some commits were made for this, I’d like to understand what happened and offer assistance if I can.

Thanks!

maliming commented 3 years ago

hi @yozzozo

Object mapping methods are sync now, but the feature needs to use Repository, we don't want async over sync.

yozzozo commented 3 years ago

@hikalkan Any context you can provide here? Is there a way the feature can be redesigned so it can work in the current state of the system? I think many of us would appreciate being able to have multi-lingual entities on ABP, the feature was really useful on aspboilerplate.

mtozlu commented 3 years ago

I actually implemented this system in a private project. I would like to share it however i am not sure it will be 100% compliant with abp's design guidelines. That's why i didn't create a PR until now. How can i help about this @maliming / @hikalkan ? Maybe you can check my codes and make some reviews to make it ready for abp codebase?

maliming commented 3 years ago

@mtozlu

Did you encounter async over sync problems when you tried to use Repository?

mtozlu commented 3 years ago

No i didn't. Where exactly current implementation causes async over sync problems? Is it here: https://github.com/abpframework/abp/pull/5265/files?file-filters%5B%5D=.cs&file-filters%5B%5D=.xml&file-filters%5B%5D=.xsd#diff-12d9de60ded6db704708126614e4f4610e3eb0a6636c7208296742ba9ecb5699R31

maliming commented 3 years ago

We don't want to use AsyncHelper.

mtozlu commented 3 years ago

Oh i remember now... I walked the same path. That's why I don't use any async call in GetTranslations method. Actually the only async call needed is SettingProvider.GetOrNullAsync call, which is needed in case no translations can be found from CurrentCulture and CurrentCulture's parent cultures. That's why I always use sync version GetTranslations method of MultiLingualObjectManager I found two solutions (which you may not like as I mentioned in my comment about guidelines): 1- GetTranslations method should include a default culture property which you can get from SettingProvider before calling the method and pass. 2- Create a default language as a constant property and use it in GetTranslations method. (I use this. In case of changing the default language, a new deployment is needed which I never came across however in some scenarios, this may be unacceptable): Here is that portion of my implementation:

// Can't make async calls, disable this:
//var defaultLanguage = await SettingProvider.GetOrNullAsync(LocalizationSettingNames.DefaultLanguage);
// Use this:
var defaultLanguage = PortalConsts.DefaultLanguage;
muratyuceer commented 3 years ago

soo because of async willl you cancel it ?

jfmeyers commented 2 years ago

+1 for this feature!

okains commented 2 years ago

+1 for this feature also. I have been waiting on this implementation for a while now. Is there no workaround for the mapping issue? How about @mtozlu implementation?

hi @yozzozo

Object mapping methods are sync now, but the feature needs to use Repository, we don't want async over sync.

ghost commented 2 years ago

+1 for this feature

hitaspdotnet commented 2 years ago

My suggestion is using string DefaultLanguage property in MultiLingual class, or a solution around my issue with using a key value dictionary. For who looking for a workaround for integrate multi lingual entities, I was shared a module https://github.com/hitaspdotnet/Volo.Abp.MultiLingualObjects

sel-carlitos commented 2 years ago

+1 for this feature!

abdullahsalem commented 2 years ago

@yozzozo This feature has been canceled.

Do those PRs (https://github.com/abpframework/abp/pull/5265 & https://github.com/abpframework/abp/pull/8156) mean Multi-lingual entity feature will be shipped soon?