@ui5/task-adaptation
Version:
Custom task for ui5-builder which allows building UI5 Flexibility Adaptation Projects for SAP BTP, Cloud Foundry environment
32 lines (31 loc) • 1.5 kB
TypeScript
import * as Resource from "@ui5/fs/Resource";
import { IAppVariantInfo } from "../model/types.js";
type Resource = typeof Resource;
export default class I18NMerger {
static analyzeAppVariantManifestChanges(rootFolder: string, tranlsationRegexPattern: string, { changes }: IAppVariantInfo): {
mergePathsRegex: RegExp[];
copyPathsRegex: RegExp[];
};
static mergeI18NFiles(baseAppResources: any[], appVariantResources: any[], projectNamespace: string, baseAppManifestI18NPath: string, appVariantInfo: IAppVariantInfo, taskUtil: any): Promise<(typeof Resource)[]>;
/**
* Merge/Append base property file with property file from app variant
* FIXME Currently merge could duplicate keys which causes undefined
* behavior => Existing keys which are in merge content must be removed =>
* Actually only descriptor texts are relevant for merge which always have
* app variant Id as prefix => If we filter on them we do not need to remove
* existing overwritten keys (as there should be none)
*/
private static mergePropertiesFiles;
/**
* update the path of app variant property file so it will be copied into
<app_variant_id> folder
*/
private static moveToAppVarSubfolder;
/**
* create new i18n file in case e.g. translation file does not exist in base
* app but in variant and copy of translation file is needed
*/
private static createFile;
private static mergeFiles;
}
export {};