How to order the available languages in ABP environment?

42 Views Asked by At

I'm using boilerplate (ASP.NET Core MVC & Angular) Languages are already in the database like this: AbpLanguages database table

And the result on screen in runtime application is:

language-switch-dropdown.component.html displaying the data

I'm trying to figure out how to order the results that are being get from database but I don't see where these data (which backend/API method) is being taken because the only line referring to languages in component (frontend) is: languages: abp.localization.ILanguageInfo[];. The file where this languages attribute is, is the abp.d.ts:

namespace localization {

        interface ILanguageInfo {

            name: string;

            displayName: string;

            icon: string;

            isDefault: boolean;

            isDisabled: boolean;
            
            isRightToLeft: boolean;

        }

        interface ILocalizationSource {

            name: string;

            type: string;

        }

        let languages: ILanguageInfo[];

        let currentLanguage: ILanguageInfo;

        let sources: ILocalizationSource[];

        let defaultSourceName: string;

        let values: { [key: string]: string };

        let abpWeb: (key: string) => string;

        function localize(key: string, sourceName: string): string;

        function getSource(sourceName: string): (...key: string[]) => string;

        function isCurrentCulture(name: string): boolean;
    }

I guess the data is being ordered by DisplayName but what I need to be shown in dropdown is:

  • Castellano
  • English
  • Català

I tried to set some breakpoints in backend methods but I think all this logic is in the native abp methods that I cannot access (they are embedded). Any idea of how get the languages in the order I need? Because I don't want to fix it swapping the values of the languages array in the front if it's possible. Thanks in advance.

0

There are 0 best solutions below