@ngx-i18nsupport/ngx-i18nsupport-lib
Version:
A Typescript library to work with Angular generated i18n files (xliff, xmb)
164 lines • 14.7 kB
JavaScript
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* Interface of a translation unit in a translation messages file.
* @record
*/
export function ITransUnit() { }
if (false) {
/** @type {?} */
ITransUnit.prototype.id;
/**
* The file the unit belongs to.,
* @return {?}
*/
ITransUnit.prototype.translationMessagesFile = function () { };
/**
* The original text value, that is to be translated.
* Contains all markup, depends on the concrete format used.
* @return {?}
*/
ITransUnit.prototype.sourceContent = function () { };
/**
* Test, wether setting of source content is supported.
* If not, setSourceContent in trans-unit will do nothing.
* xtb does not support this, all other formats do.
* @return {?}
*/
ITransUnit.prototype.supportsSetSourceContent = function () { };
/**
* Set new source content in the transunit.
* Normally, this is done by ng-extract.
* Method only exists to allow xliffmerge to merge missing changed source content.
* @param {?} newContent the new content.
* @return {?}
*/
ITransUnit.prototype.setSourceContent = function (newContent) { };
/**
* The original text value, that is to be translated, as normalized message.
* Throws an error if normalized xml is not well formed.
* (which should not happen in generated files)
* @return {?}
*/
ITransUnit.prototype.sourceContentNormalized = function () { };
/**
* The translated value.
* Contains all markup, depends on the concrete format used.
* @return {?}
*/
ITransUnit.prototype.targetContent = function () { };
/**
* The translated value as normalized message.
* All placeholders are replaced with {{n}} (starting at 0)
* and all embedded html is replaced by direct html markup.
* Throws an error if normalized xml is not well formed.
* (which should not happen in generated files)
* @return {?}
*/
ITransUnit.prototype.targetContentNormalized = function () { };
/**
* State of the translation.
* (on of new, translated, final)
* Return values are defined as Constants STATE_...
* @return {?}
*/
ITransUnit.prototype.targetState = function () { };
/**
* Modify the target state.
* @param {?} newState one of the 3 allowed target states new, translated, final.
* Constants STATE_...
* Invalid states throw an error.
* @return {?}
*/
ITransUnit.prototype.setTargetState = function (newState) { };
/**
* All the source elements in the trans unit.
* The source element is a reference to the original template.
* It contains the name of the template file and a line number with the position inside the template.
* It is just a help for translators to find the context for the translation.
* This is set when using Angular 4.0 or greater.
* Otherwise it just returns an empty array.
* @return {?}
*/
ITransUnit.prototype.sourceReferences = function () { };
/**
* Test, wether setting of source refs is supported.
* If not, setSourceReferences will do nothing.
* xtb does not support this, all other formats do.
* @return {?}
*/
ITransUnit.prototype.supportsSetSourceReferences = function () { };
/**
* Set source ref elements in the transunit.
* Normally, this is done by ng-extract.
* Method only exists to allow xliffmerge to merge missing source refs.
* @param {?} sourceRefs the sourcerefs to set. Old ones are removed.
* @return {?}
*/
ITransUnit.prototype.setSourceReferences = function (sourceRefs) { };
/**
* The description set in the template as value of the i18n-attribute.
* e.g. i18n="mydescription".
* @return {?}
*/
ITransUnit.prototype.description = function () { };
/**
* The meaning (intent) set in the template as value of the i18n-attribute.
* This is the part in front of the | symbol.
* e.g. i18n="meaning|mydescription".
* @return {?}
*/
ITransUnit.prototype.meaning = function () { };
/**
* Test, wether setting of description and meaning is supported.
* If not, setDescription and setMeaning will do nothing.
* xtb does not support this, all other formats do.
* @return {?}
*/
ITransUnit.prototype.supportsSetDescriptionAndMeaning = function () { };
/**
* Change description property of trans-unit.
* @param {?} description description
* @return {?}
*/
ITransUnit.prototype.setDescription = function (description) { };
/**
* Change meaning property of trans-unit.
* @param {?} meaning meaning
* @return {?}
*/
ITransUnit.prototype.setMeaning = function (meaning) { };
/**
* Get all notes of the trans-unit.
* Notes are remarks made by a translator.
* (description and meaning are not included here!)
* @return {?}
*/
ITransUnit.prototype.notes = function () { };
/**
* Test, wether setting of notes is supported.
* If not, setNotes will do nothing.
* xtb does not support this, all other formats do.
* @return {?}
*/
ITransUnit.prototype.supportsSetNotes = function () { };
/**
* Add notes to trans unit.
* @throws an Error if any note contains description or meaning as from attribute.
* @param {?} newNotes the notes to add.
* @return {?}
*/
ITransUnit.prototype.setNotes = function (newNotes) { };
/**
* Translate the trans unit.
* @param {?} translation the translated string or (preferred) a normalized message.
* The pure string can contain any markup and will not be checked.
* So it can damage the document.
* A normalized message prevents this.
* @return {?}
*/
ITransUnit.prototype.translate = function (translation) { };
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaS10cmFucy11bml0LmpzIiwic291cmNlUm9vdCI6Im5nOi8vQG5neC1pMThuc3VwcG9ydC9uZ3gtaTE4bnN1cHBvcnQtbGliLyIsInNvdXJjZXMiOlsiYXBpL2ktdHJhbnMtdW5pdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7OztBQVdBLGdDQTBKQzs7O0lBeEpHLHdCQUFvQjs7Ozs7SUFLcEIsK0RBQW9EOzs7Ozs7SUFNcEQscURBQXdCOzs7Ozs7O0lBT3hCLGdFQUFvQzs7Ozs7Ozs7SUFRcEMsa0VBQXFDOzs7Ozs7O0lBT3JDLCtEQUE4Qzs7Ozs7O0lBTTlDLHFEQUF3Qjs7Ozs7Ozs7O0lBU3hCLCtEQUE4Qzs7Ozs7OztJQU85QyxtREFBc0I7Ozs7Ozs7O0lBUXRCLDhEQUFpQzs7Ozs7Ozs7OztJQVVqQyx3REFBK0Q7Ozs7Ozs7SUFPL0QsbUVBQXVDOzs7Ozs7OztJQVF2QyxxRUFBNEU7Ozs7OztJQU01RSxtREFBc0I7Ozs7Ozs7SUFPdEIsK0NBQWtCOzs7Ozs7O0lBT2xCLHdFQUE0Qzs7Ozs7O0lBTTVDLGlFQUFvQzs7Ozs7O0lBTXBDLHlEQUE0Qjs7Ozs7OztJQU81Qiw2Q0FBaUI7Ozs7Ozs7SUFPakIsd0RBQTRCOzs7Ozs7O0lBTzVCLHdEQUE0Qjs7Ozs7Ozs7O0lBUzVCLDREQUFvRCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7SU5vcm1hbGl6ZWRNZXNzYWdlfSBmcm9tICcuL2ktbm9ybWFsaXplZC1tZXNzYWdlJztcclxuaW1wb3J0IHtJVHJhbnNsYXRpb25NZXNzYWdlc0ZpbGV9IGZyb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