A section group defines the translation file of a lazy loaded module. The following JSON object is an example section group:
{
group: 'shakespeare',
path: '/assets/i18n/{ language }/{ section }.json',
format: 'JSON',
type: 'json',
items: [ 'tragedies', 'comedies', { name: 'histories', alias: 'king' } ]
}
The section group has these properties:
'json', 'text', 'blob' and
'arraybuffer'. The default value is 'json'. This
parameter also is used for custom format converters.A section group usually looks like that:
{ group: 'shakespeare', items: [ 'tragedies', 'comedies', 'histories' ] }
The translation group can be defined in the route when the route path differs from group name passing the name in the data object:
const routes: Routes = [
...
{
path: 'winter',
loadChildren: () => import('./winter/winter.module').then(m => m.WinterModule),
canLoad: [ LoadTranslationsGuard ],
data: { translationGroup: 'frosty' }
},
...
];
This way, the section group will be similar to:
{ group: 'frosty', items: [ 'december', 'january', 'february' ] }