Localization in Standard Module - abp

I'm coding a web application in Abp Framework in italian language.
Is it possible to override the localization string in the standard module of ABP Framework like Account and Identity?
Thanks.
Danilo

You should extend existing resources. For example, if you want to extend TenantManagementResource, you can extend it like below in your module.cs file. And in your localization file you should redefine the same localization keys which you want to override.
ConfigureServices(ServiceConfigurationContext context)
{
...
...
Configure<AbpLocalizationOptions>(options =>
{
...
...
options.Resources
.Get<AbpTenantManagementResource>()
.AddVirtualJson("/Localization/YourTenantManagementResource");
});

Related

Class Library(.Net Core) VS Class Library(Portable for iOS,Android and Windows)

I want to develop an API using ASP.NET core web api, the solution contains 3 projects of type class library and 1 projects of type Web api (For Separation of Concern), My API should be consumable from xamarin and angular.
What type of class library should I use :
Class Library(.Net Core) OR Class Library(Portable for iOS,Android and Windows)
I'am using vs 2015 update 3
Class Library Types
Generally speaking as mentioned in the comments NetStandard is the way to go if you're trying to share between an AspNetCore project and a Xamarin Project.
The defacto standard of new projects is NetStandard1.4 which while perfectly consumable by Xamarin.iOS and Xamarin.Android, is not going to be consumable by a PCL in your project. In order to share code between the API and a PCL for Xamarin you will need to change the NetStandard version based on what PCL Profile you're using. You can find more information in the docs from Microsoft, but here is the key:
Profile 78 & Profile 259 - need NetStandard1.0
Profile 111 - can use NetStandard1.0 or NetStandard1.1

Is there a DisplayName attribute in CakePHP as there is in ASP.NET MVC?

I'm aware of the "conventions over configurations" philosophy beyond CakePHP. The "bake all" command generates automatically Models, Controllers and Views by using english language conventions. The problem is that the website I'm making needs to be in spanish. I can code the back-end (database and MVC stuff) in english but the automatic view it's rendered in english too and I need it in spanish.
In MVC I can just add a DisplayName attribute to the model (anyway, I never had problems with writing the names in spanish) so the view will show it, instead of the name of the field in the database/model.
So, Does CakePHP have a easy way to do the same? Do I have to modify each automatic view or create my own?
There is no such property, no, however baked view templates are by default using translation functions for all output, so you could simply create proper spanish translations and you should be good.
See
Cookbook > Internationalization & Localization (CakePHP 3)
Cookbook > Core Libraries > Utilities > Internationalization & Localization (CakePHP 2)

Sharing views and content across Nancy projects

Is there a super duper happy path for sharing views and site content across Nancy projects?
For example, I'd like to run the same site via self hosted / IIS.
The easiest way to do that is to put all of the actual application code into a class library - that is your modules, views, js, css, bootstrapper and whatever supporting code you have. You then setup a view location convention in your Bootstrapper such the view can be found in both a web server and self hosted context. This could be the ResourceViewLocationProvider:
public class Bootstrapper : DefaultNancyBootstrapper
{
protected override NancyInternalConfiguration InternalConfiguration
{
get
{
return NancyInternalConfiguration.WithOverrides(
x => x.ViewLocationProvider = typeof (ResourceViewLocationProvider));
}
}
}
Alongside that you can have a web projects, with e.g. nancy.hosting.owin setup up and a project reference to the class library with the application code. Similarly you can have a console application with just nancy.hosting.self setup and a reference to the class library.
I describe this setup in more detail on my blog and in my Nancy book.

import Only CakePHP Html Helpers in Custom MVC project

I have an unusual task at hand, I just need to import a specific portion of CakePHP framework in my custom MVC project, i.e HTML helpers.
Can anyone tell me what code libraries from CakePHP do I need to transfer into my project , to do this.
Please note I need only HTML helpers from the CakePHP framework.
Thanks.
Just go to the CakePHP Github repository Helper directory and download them: https://github.com/cakephp/cakephp/tree/master/lib/Cake/View/Helper

C# objects use from javascript in a HTML based webpage

I am building an Asp Net website in Visual Studio that uses Razor developed HTML pages. I would like to be able to use some C# from the javascript on one of the web pages (this is not creating a plugin that would be displayed in the browser.) I have tried to create a simple Cs class that has a single method that returns a fixed string to test this. The following code is in the ManagedCsClass.cs file is in the App_Code folder in my project.
[System.Runtime.InteropServices.ComVisibleAttribute(true)]
public class ManagedCsClass
{
public ManagedCsClass()
{
//
// TODO: Add constructor logic here
//
}
public string ReturnText()
{
return "Text from ManagedCsClass";
}
}
What I am not clear on is where to create the object that would be used by the HTML page (in the same .cs file as the class, another .cs file, or from a call from the HTML browser page).
And what code do I need to use in the javascript to reference the object/method?
Thanks for any help or guidance you can provide.
Mark
You are trying to use "ActiveX" com objects, this requires the dll containing that class registered on the client and you will have a lot of security/deploy issues ( the client must trust your object and have the framework installed ). It is not the best way to create a web app today.

Resources