episerver / episerver-labs-content-manager-docs

Documentation for EPiServer.Labs.ContentManager
1 stars 0 forks source link

How to translate column names in GridView UI for different editors languages #34

Closed bsubasic closed 3 years ago

bsubasic commented 3 years ago

Is there a way for translating column names for different editor's interface languages?

image

GridSettings = new GridSettings
        {
             Columns = new ColumnsListBuilder()
                    .WithContentName() // <--- **Translate "Content" word** 
                    .WithContentStatus() // <--- **Translate "Status" word**
                    .WithPublishDate()
                    .WithCreatedBy()
                    .WithEdit()
                    .WithPreviewUrl()
                    .Build()
        };
barteksekula commented 3 years ago

@bsubasic you can do it right now:

var localizationService = ServiceLocator.Current.GetInstance<LocalizationService>();
...
Columns = new ColumnsListBuilder()
      .WithContentName(localizationService.GetString("/path/to/your/custom/translation"))
...
barteksekula commented 3 years ago

@bsubasic please reopen if it does not work