mirror of https://github.com/abpframework/abp.git
723 changed files with 2587 additions and 2263 deletions
@ -1,11 +1,32 @@ |
|||
## Abp.io platform localization |
|||
## ABP Platform Websites Localization |
|||
|
|||
This project is all localized resources of the abp.io platform. |
|||
This is the localization project of [abp.io platform](https://abp.io). |
|||
All *.abp.io websites are built on top of ABP Framework, and it uses ABP Framework's localization system. |
|||
You can correct a wrong localization text, or you can translate it into your own language. |
|||
By doing so, [abp.io](https://abp.io) websites will be translated into a new language and it will help to expand the ABP Community. |
|||
|
|||
If you like, you can contribute to the localization resources in this project. |
|||
|
|||
For example: `AbpIoLocalization\AbpIoLocalization\Www\Localization\Resources\zh-Hans.json` |
|||
If the file is missing some translations or the translation is wrong, you can add it. |
|||
If the language file is missing (eg `kr.json`), you can also add it. |
|||
|
|||
Please refer to the [Contribution Guide](https://github.com/abpframework/abp/blob/dev/docs/en/Contribution/Index.md) for details. |
|||
## How to Translate abp.io Into Your Language: |
|||
|
|||
1. Install [ABP CLI](https://docs.abp.io/en/abp/latest/CLI) command line tool. |
|||
|
|||
2. Run the following command to generate the localization file. |
|||
For example, for translating from English to French `fr`: |
|||
|
|||
```bash |
|||
abp translate -c fr |
|||
``` |
|||
3. After you fill in the empty localization keys, run the following command to apply it. |
|||
```bash |
|||
abp translate -a |
|||
``` |
|||
4. Send your PR to the team; after the review process, we wil merge it. |
|||
|
|||
--- |
|||
|
|||
|
|||
|
|||
## References: |
|||
* [ABP CLI Translate Command](https://docs.abp.io/en/abp/latest/Contribution/Index#using-the-abp-translate-command) |
|||
* [Contribution Guide](https://github.com/abpframework/abp/blob/dev/docs/en/Contribution/Index.md) |
|||
|
|||
File diff suppressed because it is too large
@ -0,0 +1,31 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using Volo.Abp.DependencyInjection; |
|||
|
|||
namespace Microsoft.Extensions.DependencyInjection; |
|||
|
|||
public static class ServiceCollectionLifetimeEventExtensions |
|||
{ |
|||
// OnActivated
|
|||
public static void OnActivated(this IServiceCollection services, ServiceDescriptor descriptor, Action<IOnServiceActivatedContext> onActivatedAction) |
|||
{ |
|||
GetOrCreateOnActivatedActionList(services).Add(new KeyValuePair<ServiceDescriptor, Action<IOnServiceActivatedContext>>(descriptor, onActivatedAction)); |
|||
} |
|||
|
|||
public static ServiceActivatedActionList GetServiceActivatedActionList(this IServiceCollection services) |
|||
{ |
|||
return GetOrCreateOnActivatedActionList(services); |
|||
} |
|||
|
|||
private static ServiceActivatedActionList GetOrCreateOnActivatedActionList(IServiceCollection services) |
|||
{ |
|||
var actionList = services.GetSingletonInstanceOrNull<IObjectAccessor<ServiceActivatedActionList>>()?.Value; |
|||
if (actionList == null) |
|||
{ |
|||
actionList = new ServiceActivatedActionList(); |
|||
services.AddObjectAccessor(actionList); |
|||
} |
|||
|
|||
return actionList; |
|||
} |
|||
} |
|||
@ -0,0 +1,6 @@ |
|||
namespace Volo.Abp.DependencyInjection; |
|||
|
|||
public interface IOnServiceActivatedContext |
|||
{ |
|||
public object Instance { get; } |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
namespace Volo.Abp.DependencyInjection; |
|||
|
|||
public class OnServiceActivatedContext : IOnServiceActivatedContext |
|||
{ |
|||
public object Instance { get; set; } |
|||
|
|||
public OnServiceActivatedContext(object instance) |
|||
{ |
|||
Instance = instance; |
|||
} |
|||
} |
|||
@ -0,0 +1,14 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
|
|||
namespace Volo.Abp.DependencyInjection; |
|||
|
|||
public class ServiceActivatedActionList : List<KeyValuePair<ServiceDescriptor, Action<IOnServiceActivatedContext>>> |
|||
{ |
|||
public List<Action<IOnServiceActivatedContext>> GetActions(ServiceDescriptor descriptor) |
|||
{ |
|||
return this.Where(x => x.Key == descriptor).Select(x => x.Value).ToList(); |
|||
} |
|||
} |
|||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue