407 Common Strings Resource - chempkovsky/CS82ANGULAR GitHub Wiki
- Open the
rupbes.firstapp\angular\src\app\shared\components\message-dialog\message-dialog.component.html
-file. Your will find the code like bellow:
<div class="modal-footer">
<button type="button" class="btn btn-outline-secondary" (click)="onCancel()" cdkFocusInitial>{{ { key: 'CmSt::Cancel', defaultValue: 'Cancel' } | abpLocalization }}</button>
<button type="button" class="btn btn-outline-secondary" (click)="onOk()">{{ { key: 'CmSt::Ok', defaultValue: 'Ok' } | abpLocalization }}</button>
</div>
- Or open the
rupbes.firstapp\angular\src\app\shared\components\uniq-service-filter\uniq-service-filter.component.ts
-file. Your will find the code like bellow:
ngOnInit(): void {
this.onFilterDefsChanged();
this.isOnInitCalled = true;
this.cd.detectChanges();
this.RmCurrFltItm =this.L.get({
key: 'CmSt::RmCurrFltItm',
defaultValue: "Remove current filter item",
});
this.ShowDtDlg =this.L.get({
key: 'CmSt::ShowDtDlg',
defaultValue: "Show date dialog",
});
this.FltVal =this.L.get({
key: 'CmSt::FltVal',
defaultValue: "Filter value",
});
The code like 'CmSt::Ok' or code like 'CmSt::FltVal' require to introduce the second Resource
instance.
- In the
Localization
-folder of therupbes.firstapp.Domain.Shared.csproj
-project add theCmStResource
-class as follows:
using Volo.Abp.Localization;
namespace rupbes.firstapp.Localization
{
[LocalizationResourceName("CmSt")]
public class CmStResource
{
}
}
-
In the
Localization
-folder of therupbes.firstapp.Domain.Shared.csproj
-project add theCmSt
-subfolder -
In the
Localization\CmSt
-folder of therupbes.firstapp.Domain.Shared.csproj
-project add the files:en.json
ru.json
- ...
- ...
-
modify the
firstappDomainSharedModule.cs
-file of therupbes.firstapp.Domain.Shared.csproj
-project as follows:
using rupbes.firstapp.Localization;
using Volo.Abp.AuditLogging;
using Volo.Abp.BackgroundJobs;
using Volo.Abp.FeatureManagement;
using Volo.Abp.Identity;
using Volo.Abp.Localization;
using Volo.Abp.Localization.ExceptionHandling;
using Volo.Abp.Validation.Localization;
using Volo.Abp.Modularity;
using Volo.Abp.PermissionManagement;
using Volo.Abp.SettingManagement;
using Volo.Abp.VirtualFileSystem;
using Volo.Abp.OpenIddict;
using Volo.Abp.BlobStoring.Database;
using Volo.Abp.TenantManagement;
namespace rupbes.firstapp;
[DependsOn(
typeof(AbpAuditLoggingDomainSharedModule),
typeof(AbpBackgroundJobsDomainSharedModule),
typeof(AbpFeatureManagementDomainSharedModule),
typeof(AbpPermissionManagementDomainSharedModule),
typeof(AbpSettingManagementDomainSharedModule),
typeof(AbpIdentityDomainSharedModule),
typeof(AbpOpenIddictDomainSharedModule),
typeof(AbpTenantManagementDomainSharedModule),
typeof(BlobStoringDatabaseDomainSharedModule)
)]
public class firstappDomainSharedModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
firstappGlobalFeatureConfigurator.Configure();
firstappModuleExtensionConfigurator.Configure();
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<firstappDomainSharedModule>();
});
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Add<firstappResource>("en")
.AddBaseTypes(typeof(AbpValidationResource))
.AddVirtualJson("/Localization/firstapp");
options.DefaultResourceType = typeof(firstappResource);
// start adding custom code
options.Resources
.Add<CmStResource>("en")
.AddBaseTypes(typeof(AbpValidationResource))
.AddVirtualJson("/Localization/CmSt");
// end adding custom code
});
Configure<AbpExceptionLocalizationOptions>(options =>
{
options.MapCodeNamespace("firstapp", typeof(firstappResource));
// start adding custom code
options.MapCodeNamespace("CmSt", typeof(CmStResource));
// end adding custom code
});
}
}
in the rupbes.firstapp.Domain.Shared\Localization\CmSt\en.json
-file copy the content
{
"Culture": "en",
"Texts": {
"FullScan": "full scan",
"FltNtAppl": "Could not apply filter as not all attributes are set",
"NAllPrpsAreSet": "Not all properties are set",
"SItm": "Select Item",
"NtAllMstSet": "Not all masters have been set",
"RmCurrFltItm": "Remove current filter item",
"ShowDtDlg": "Show date dialog",
"FltVal": "Filter value",
"Oprtr": "Operator",
"ClNm": "Column name",
"ApplFlt": "Apply filter",
"RmvAllFltItms": "Remove all filter items",
"AddFltItm": "Add filter item",
"NavBckToMstr": "Navigate back to master",
"VlMstLssTn": "The value must be less than",
"VlMstGtTn": "The value must be greater than",
"IncrctFt": "Icorrect format",
"IncrctDtFt": "Icorrect date format",
"ClNmb": "Number of columns",
"Cancel": "Cancel",
"Ok": "Ok",
"NoClSel": "No columns selected",
"ErrorTxt": "Error :",
"ErrorTp": "Error of type",
"SttsTxt": "status:",
"SttsText": "Status Text:",
"ErrorCd": "error code:",
"ErrorDscr": "error descr:",
"ValidError": "Validation Error.",
"ReqMxLn": "Required max length",
"ReqMinLn": "Required min length",
"ReqFld": "Required field",
"RfrshTbl": "Refresh table",
"TblClmns": "Table columns",
"EItm": "Modify Item",
"DItm": "Delete Item",
"VItm": "View Item",
"AItm": "Add Item",
"DSel": "Delete Selected",
"Prmssn": "Permission",
"AccDen": "Access denied",
"NabBckMstr": "Navigate back to master",
"HideDtls": "Hide details",
"Nvm2mntallwd": "Navigating to detail form is not allowed in One-to-Many mode",
"ShwTree": "Show Tree",
"ShwTbl": "Show Table",
"RdSbtms": "Read Subitems",
"SlctFls": "Select files",
"DwnLd": "Download file"
}
}
in the rupbes.firstapp.Domain.Shared\Localization\CmSt\ru.json
-file copy the content
{
"culture": "ru",
"texts": {
"FullScan": "Полное сканирование",
"FltNtAppl": "Не удалось применить фильтр, так как не все атрибуты установлены",
"NAllPrpsAreSet": "Не все свойства установлены",
"SItm": "Выбрать элемент",
"NtAllMstSet": "Не все мастера были установлены",
"RmCurrFltItm": "Удалить текущий элемент фильтра",
"ShowDtDlg": "Показать диалог даты",
"FltVal": "Значение фильтра",
"Oprtr": "Оператор",
"ClNm": "Имя столбца",
"ApplFlt": "Применить фильтр",
"RmvAllFltItms": "Удалить все элементы фильтра",
"AddFltItm": "Добавить элемент фильтра",
"NavBckToMstr": "Вернуться к мастеру",
"VlMstLssTn": "Значение должно быть меньше чем",
"VlMstGtTn": "Значение должно быть больше чем",
"IncrctFt": "Неверный формат",
"IncrctDtFt": "Неверный формат даты",
"ClNmb": "Число столбцов",
"Cancel": "Отмена",
"Ok": "Ok",
"NoClSel": "Столбцы не выбраны",
"ErrorTxt": "Ошибка:",
"ErrorTp": "Ошибка типа",
"SttsTxt": "статус:",
"SttsText": "Текст состояния:",
"ErrorCd": "Код ошибки:",
"ErrorDscr": "описание ошибки:",
"ValidError": "Ошибка проверки.",
"ReqMxLn": "Требуемая максимальная длина",
"ReqMinLn": "Требуемая минимальная длина",
"ReqFld": "Обязательное поле",
"RfrshTbl": "Обновить таблицу",
"TblClmns": "Столбцы таблицы",
"EItm": "Изменить",
"DItm": "Удалить",
"VItm": "Просмотреть",
"AItm": "Добавить",
"DSel": "Удалить выбранные",
"Prmssn": "Разрешение",
"AccDen": "Доступ запрещен",
"NabBckMstr": "Вернуться к мастеру",
"HideDtls": "Скрыть детали",
"Nvm2mntallwd": "Переход к подробной форме не разрешен в режиме Один ко многим.",
"ShwTree": "Показать дерево",
"ShwTbl": "Показать таблицу",
"RdSbtms": "Перечитать вложенные",
"SlctFls": "Выбрать файлы",
"DwnLd": "Скачать файл"
}
}
- For each new DTO-class which will be generated according to the instruction of the
404 First View (PhoneType)
-article there exist special content-generators for both localization resources:firstapp::XXXX
andCmSt::XXXX
. We'll talk about them when we start generating Angular classes.