Base solution for your next web application
Open Closed

Localization not working #11747


User avatar
0
niengineering created

Dear Support,

I've a class using an external component. This component needs a format function "grid_format" I've defined as in the example below. The problem I have is that the line with ls.localize is returning always the same value of s (it's not translating. How can I achieve the goal to have a translation in this situation?

export class GridComponent extends AppComponentBase {
... skip ...
}
let ls: LocalizationService = new LocalizationService();
(window as grid_expression).grid_format = (column: any, value?: any) => {
    if (value == null)
        return '';
    let s: string = (column.customAttributes.prefix + +value);
    return ls.localize(s, AppConsts.localization.defaultLocalizationSourceName);
};
interface grid_expression extends Window {
    grid_enum_format?: Function;
}

3 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Does this work if you use abp.localization.localize function ?

  • User Avatar
    0
    niengineering created

    Hi,

    it doesn't work with abp.localization.localize

  • User Avatar
    0
    niengineering created

    Solved, my fault... there was an extra space in the string to be translated