コード例 #1
0
        public ActionResult GetLanguageTextsForTable(RequestModel <LanguageTextsForEditRequest> input, string source, string targetLang, string sourceLang)
        {
            input.TypeOfRequest = new LanguageTextsForEditRequest
            {
                Source     = source,
                SourceLang = sourceLang,
                TargetLang = targetLang
            };
            var table = _languageAppService.GetLocalizationTexts(input);

            return(Json(table, JsonRequestBehavior.AllowGet));
        }
コード例 #2
0
        public async Task UpdateLanguageFromXml_Test()
        {
            LoginAsHostAdmin();
            await CreateFakeLang();
            await UsingDbContextAsync(async dbContext =>
            {
                var lang = await GetFakeLang(dbContext);

                lang.ShouldNotBeNull();

                lang.Name.ShouldBe("es");

                await _languageAppService.UpdateLanguageFromXml(lang.Name, "AbpModuleZero");

                var fakeRequest = FakeRequestHelper <LanguageTextsForEditRequest> .CreateDataTablesFakeRequestModel("");

                var languageTexts = _languageAppService.GetLocalizationTexts(fakeRequest);

                languageTexts.ShouldNotBeNull();
                languageTexts.data.ShouldNotBeNull();
                languageTexts.data.Length.ShouldBeGreaterThan(0);
            });
        }