@angular/localize
Advanced tools
Comparing version 9.1.3 to 9.1.4
/** | ||
* @license Angular v9.1.3 | ||
* @license Angular v9.1.4 | ||
* (c) 2010-2020 Google LLC. https://angular.io/ | ||
@@ -4,0 +4,0 @@ * License: MIT |
/** | ||
* @license Angular v9.1.3 | ||
* @license Angular v9.1.4 | ||
* (c) 2010-2020 Google LLC. https://angular.io/ | ||
@@ -4,0 +4,0 @@ * License: MIT |
/** | ||
* @license Angular v9.1.3 | ||
* @license Angular v9.1.4 | ||
* (c) 2010-2020 Google LLC. https://angular.io/ | ||
@@ -290,3 +290,3 @@ * License: MIT | ||
*/ | ||
function parseMessage(messageParts, expressions) { | ||
function parseMessage(messageParts, expressions, location) { | ||
var substitutions = {}; | ||
@@ -307,8 +307,8 @@ var metadata = parseMetadata(messageParts[0], messageParts.raw[0]); | ||
var messageId = metadata.id || compiler.computeMsgId(messageString, metadata.meaning || ''); | ||
var legacyIds = metadata.legacyIds.filter(function (id) { return id !== messageId; }); | ||
var legacyIds = metadata.legacyIds && metadata.legacyIds.filter(function (id) { return id !== messageId; }); | ||
return { | ||
messageId: messageId, | ||
id: messageId, | ||
legacyIds: legacyIds, | ||
substitutions: substitutions, | ||
messageString: messageString, | ||
text: messageString, | ||
meaning: metadata.meaning || '', | ||
@@ -318,2 +318,3 @@ description: metadata.description || '', | ||
placeholderNames: placeholderNames, | ||
location: location, | ||
}; | ||
@@ -348,5 +349,5 @@ } | ||
function parseMetadata(cooked, raw) { | ||
var _a = splitBlock(cooked, raw), text = _a.text, block = _a.block; | ||
var _a = splitBlock(cooked, raw), messageString = _a.text, block = _a.block; | ||
if (block === undefined) { | ||
return { text: text, meaning: undefined, description: undefined, id: undefined, legacyIds: [] }; | ||
return { text: messageString }; | ||
} | ||
@@ -364,3 +365,3 @@ else { | ||
} | ||
return { text: text, meaning: meaning, description: description, id: id, legacyIds: legacyIds }; | ||
return { text: messageString, meaning: meaning, description: description, id: id, legacyIds: legacyIds }; | ||
} | ||
@@ -460,6 +461,8 @@ } | ||
// Look up the translation using the messageId, and then the legacyId if available. | ||
var translation = translations[message.messageId]; | ||
var translation = translations[message.id]; | ||
// If the messageId did not match a translation, try matching the legacy ids instead | ||
for (var i = 0; i < message.legacyIds.length && translation === undefined; i++) { | ||
translation = translations[message.legacyIds[i]]; | ||
if (message.legacyIds !== undefined) { | ||
for (var i = 0; i < message.legacyIds.length && translation === undefined; i++) { | ||
translation = translations[message.legacyIds[i]]; | ||
} | ||
} | ||
@@ -489,4 +492,4 @@ if (translation === undefined) { | ||
*/ | ||
function parseTranslation(message) { | ||
var parts = message.split(/{\$([^}]*)}/); | ||
function parseTranslation(messageString) { | ||
var parts = messageString.split(/{\$([^}]*)}/); | ||
var messageParts = [parts[0]]; | ||
@@ -499,3 +502,7 @@ var placeholderNames = []; | ||
var rawMessageParts = messageParts.map(function (part) { return part.charAt(0) === BLOCK_MARKER ? '\\' + part : part; }); | ||
return { messageParts: makeTemplateObject(messageParts, rawMessageParts), placeholderNames: placeholderNames }; | ||
return { | ||
text: messageString, | ||
messageParts: makeTemplateObject(messageParts, rawMessageParts), | ||
placeholderNames: placeholderNames, | ||
}; | ||
} | ||
@@ -510,3 +517,11 @@ /** | ||
if (placeholderNames === void 0) { placeholderNames = []; } | ||
return { messageParts: makeTemplateObject(messageParts, messageParts), placeholderNames: placeholderNames }; | ||
var messageString = messageParts[0]; | ||
for (var i = 0; i < placeholderNames.length - 1; i++) { | ||
messageString += "{$" + placeholderNames[i] + "}" + messageParts[i + 1]; | ||
} | ||
return { | ||
text: messageString, | ||
messageParts: makeTemplateObject(messageParts, messageParts), | ||
placeholderNames: placeholderNames | ||
}; | ||
} | ||
@@ -525,3 +540,6 @@ /** | ||
var meaningString = message.meaning && " - \"" + message.meaning + "\""; | ||
return "\"" + message.messageId + "\" (\"" + message.messageString + "\"" + meaningString + ")"; | ||
var legacy = message.legacyIds && message.legacyIds.length > 0 ? | ||
" [" + message.legacyIds.map(function (l) { return "\"" + l + "\""; }).join(', ') + "]" : | ||
''; | ||
return "\"" + message.id + "\"" + legacy + " (\"" + message.text + "\"" + meaningString + ")"; | ||
} | ||
@@ -528,0 +546,0 @@ |
/** | ||
* @license Angular v9.1.3 | ||
* @license Angular v9.1.4 | ||
* (c) 2010-2020 Google LLC. https://angular.io/ | ||
@@ -13,3 +13,3 @@ * License: MIT | ||
* found in the LICENSE file at https://angular.io/license | ||
*/var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function n(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,a=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)i.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(o)throw o.error}}return i}function o(e,r){for(var n,o={},s=a(e[0],e.raw[0]),l=[s.text],c=[],u=s.text,f=1;f<e.length;f++){var d=i(e[f],e.raw[f]),p=d.text,g=d.block,m=void 0===g?1===(n=f)?"PH":"PH_"+(n-1):g;u+="{$"+m+"}"+p,void 0!==r&&(o[m]=r[f-1]),c.push(m),l.push(p)}var h=s.id||t.computeMsgId(u,s.meaning||""),v=s.legacyIds.filter((function(e){return e!==h}));return{messageId:h,legacyIds:v,substitutions:o,messageString:u,meaning:s.meaning||"",description:s.description||"",messageParts:l,placeholderNames:c}}function a(e,t){var r=i(e,t),o=r.text,a=r.block;if(void 0===a)return{text:o,meaning:void 0,description:void 0,id:void 0,legacyIds:[]};var s=n(a.split("␟")),l=s[0],c=s.slice(1),u=n(l.split("@@",2),2),f=u[1],d=n(u[0].split("|",2),2),p=d[0],g=d[1];return void 0===g&&(g=p,p=void 0),""===g&&(g=void 0),{text:o,meaning:p,description:g,id:f,legacyIds:c}}function i(e,t){if(":"!==t.charAt(0))return{text:e};var r=s(e,t);return{block:e.substring(1,r),text:e.substring(r+1)}}function s(e,t){for(var r=1,n=1;r<e.length;r++,n++)if("\\"===t[n])n++;else if(":"===e[r])return r;throw new Error('Unterminated $localize metadata block in "'+t+'".')}var l=function(e){function t(t){var r=e.call(this,"No translation found for "+d(t)+".")||this;return r.parsedMessage=t,r.type="MissingTranslationError",r}return function n(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t}(Error);function c(e,t,r){for(var n=o(t,r),a=e[n.messageId],i=0;i<n.legacyIds.length&&void 0===a;i++)a=e[n.legacyIds[i]];if(void 0===a)throw new l(n);return[a.messageParts,a.placeholderNames.map((function(e){if(n.substitutions.hasOwnProperty(e))return n.substitutions[e];throw new Error("There is a placeholder name mismatch with the translation provided for the message "+d(n)+".\nThe translation contains a placeholder with name "+e+", which does not exist in the message.")}))]}function u(e){for(var t=e.split(/{\$([^}]*)}/),r=[t[0]],n=[],o=1;o<t.length-1;o+=2)n.push(t[o]),r.push(""+t[o+1]);var a=r.map((function(e){return":"===e.charAt(0)?"\\"+e:e}));return{messageParts:f(r,a),placeholderNames:n}}function f(e,t){return Object.defineProperty(e,"raw",{value:t}),e}function d(e){return'"'+e.messageId+'" ("'+e.messageString+'"'+(e.meaning&&' - "'+e.meaning+'"')+")"} | ||
*/var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function n(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,a=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)i.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(o)throw o.error}}return i}function o(e,r,n){for(var o,s={},l=a(e[0],e.raw[0]),c=[l.text],u=[],f=l.text,d=1;d<e.length;d++){var p=i(e[d],e.raw[d]),g=p.text,h=p.block,m=void 0===h?1===(o=d)?"PH":"PH_"+(o-1):h;f+="{$"+m+"}"+g,void 0!==r&&(s[m]=r[d-1]),u.push(m),c.push(g)}var v=l.id||t.computeMsgId(f,l.meaning||""),y=l.legacyIds&&l.legacyIds.filter((function(e){return e!==v}));return{id:v,legacyIds:y,substitutions:s,text:f,meaning:l.meaning||"",description:l.description||"",messageParts:c,placeholderNames:u,location:n}}function a(e,t){var r=i(e,t),o=r.text,a=r.block;if(void 0===a)return{text:o};var s=n(a.split("␟")),l=s[0],c=s.slice(1),u=n(l.split("@@",2),2),f=u[1],d=n(u[0].split("|",2),2),p=d[0],g=d[1];return void 0===g&&(g=p,p=void 0),""===g&&(g=void 0),{text:o,meaning:p,description:g,id:f,legacyIds:c}}function i(e,t){if(":"!==t.charAt(0))return{text:e};var r=s(e,t);return{block:e.substring(1,r),text:e.substring(r+1)}}function s(e,t){for(var r=1,n=1;r<e.length;r++,n++)if("\\"===t[n])n++;else if(":"===e[r])return r;throw new Error('Unterminated $localize metadata block in "'+t+'".')}var l=function(e){function t(t){var r=e.call(this,"No translation found for "+d(t)+".")||this;return r.parsedMessage=t,r.type="MissingTranslationError",r}return function n(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t}(Error);function c(e,t,r){var n=o(t,r),a=e[n.id];if(void 0!==n.legacyIds)for(var i=0;i<n.legacyIds.length&&void 0===a;i++)a=e[n.legacyIds[i]];if(void 0===a)throw new l(n);return[a.messageParts,a.placeholderNames.map((function(e){if(n.substitutions.hasOwnProperty(e))return n.substitutions[e];throw new Error("There is a placeholder name mismatch with the translation provided for the message "+d(n)+".\nThe translation contains a placeholder with name "+e+", which does not exist in the message.")}))]}function u(e){for(var t=e.split(/{\$([^}]*)}/),r=[t[0]],n=[],o=1;o<t.length-1;o+=2)n.push(t[o]),r.push(""+t[o+1]);var a=r.map((function(e){return":"===e.charAt(0)?"\\"+e:e}));return{text:e,messageParts:f(r,a),placeholderNames:n}}function f(e,t){return Object.defineProperty(e,"raw",{value:t}),e}function d(e){var t=e.meaning&&' - "'+e.meaning+'"',r=e.legacyIds&&e.legacyIds.length>0?" ["+e.legacyIds.map((function(e){return'"'+e+'"'})).join(", ")+"]":"";return'"'+e.id+'"'+r+' ("'+e.text+'"'+t+")"} | ||
/** | ||
@@ -42,2 +42,2 @@ * @license | ||
* found in the LICENSE file at https://angular.io/license | ||
*/Object.defineProperty(e,"ɵcomputeMsgId",{enumerable:!0,get:function(){return t.computeMsgId}}),e.clearTranslations=function g(){$localize.translate=void 0,$localize.TRANSLATIONS={}},e.loadTranslations=function m(e){$localize.translate||($localize.translate=p),$localize.TRANSLATIONS||($localize.TRANSLATIONS={}),Object.keys(e).forEach((function(t){$localize.TRANSLATIONS[t]=u(e[t])}))},e.ɵMissingTranslationError=l,e.ɵfindEndOfBlock=s,e.ɵisMissingTranslationError=function h(e){return"MissingTranslationError"===e.type},e.ɵmakeParsedTranslation=function v(e,t){return void 0===t&&(t=[]),{messageParts:f(e,e),placeholderNames:t}},e.ɵmakeTemplateObject=f,e.ɵparseMessage=o,e.ɵparseMetadata=a,e.ɵparseTranslation=u,e.ɵsplitBlock=i,e.ɵtranslate=c,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
*/Object.defineProperty(e,"ɵcomputeMsgId",{enumerable:!0,get:function(){return t.computeMsgId}}),e.clearTranslations=function g(){$localize.translate=void 0,$localize.TRANSLATIONS={}},e.loadTranslations=function h(e){$localize.translate||($localize.translate=p),$localize.TRANSLATIONS||($localize.TRANSLATIONS={}),Object.keys(e).forEach((function(t){$localize.TRANSLATIONS[t]=u(e[t])}))},e.ɵMissingTranslationError=l,e.ɵfindEndOfBlock=s,e.ɵisMissingTranslationError=function m(e){return"MissingTranslationError"===e.type},e.ɵmakeParsedTranslation=function v(e,t){void 0===t&&(t=[]);for(var r=e[0],n=0;n<t.length-1;n++)r+="{$"+t[n]+"}"+e[n+1];return{text:r,messageParts:f(e,e),placeholderNames:t}},e.ɵmakeTemplateObject=f,e.ɵparseMessage=o,e.ɵparseMetadata=a,e.ɵparseTranslation=u,e.ɵsplitBlock=i,e.ɵtranslate=c,Object.defineProperty(e,"__esModule",{value:!0})})); |
@@ -11,2 +11,2 @@ /** | ||
export { computeMsgId as ɵcomputeMsgId, findEndOfBlock as ɵfindEndOfBlock, isMissingTranslationError as ɵisMissingTranslationError, makeParsedTranslation as ɵmakeParsedTranslation, makeTemplateObject as ɵmakeTemplateObject, MissingTranslationError as ɵMissingTranslationError, parseMessage as ɵparseMessage, parseMetadata as ɵparseMetadata, parseTranslation as ɵparseTranslation, splitBlock as ɵsplitBlock, translate as ɵtranslate } from './src/utils'; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJpdmF0ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL2xvY2FsaXplL3ByaXZhdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztHQU1HO0FBRUgsa0dBQWtHO0FBQ2xHLHdCQUF3QjtBQUN4QixPQUFPLEVBQUMsWUFBWSxJQUFJLGFBQWEsRUFBRSxjQUFjLElBQUksZUFBZSxFQUFFLHlCQUF5QixJQUFJLDBCQUEwQixFQUFFLHFCQUFxQixJQUFJLHNCQUFzQixFQUFFLGtCQUFrQixJQUFJLG1CQUFtQixFQUEyQix1QkFBdUIsSUFBSSx3QkFBd0IsRUFBdUgsWUFBWSxJQUFJLGFBQWEsRUFBRSxhQUFhLElBQUksY0FBYyxFQUFFLGdCQUFnQixJQUFJLGlCQUFpQixFQUFtQyxVQUFVLElBQUksV0FBVyxFQUFtQyxTQUFTLElBQUksVUFBVSxFQUFDLE1BQU0sYUFBYSxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBAbGljZW5zZVxuICogQ29weXJpZ2h0IEdvb2dsZSBJbmMuIEFsbCBSaWdodHMg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0aW9uLCBTb3VyY2VNZXNzYWdlIGFzIMm1U291cmNlTWVzc2FnZSwgc3BsaXRCbG9jayBhcyDJtXNwbGl0QmxvY2ssIFRhcmdldE1lc3NhZ2UgYXMgybVUYXJnZXRNZXNzYWdlLCB0cmFuc2xhdGUgYXMgybV0cmFuc2xhdGV9IGZyb20gJy4vc3JjL3V0aWxzJztcbiJdfQ== |
@@ -20,3 +20,3 @@ /** | ||
*/ | ||
export function parseMessage(messageParts, expressions) { | ||
export function parseMessage(messageParts, expressions, location) { | ||
const substitutions = {}; | ||
@@ -37,8 +37,8 @@ const metadata = parseMetadata(messageParts[0], messageParts.raw[0]); | ||
const messageId = metadata.id || computeMsgId(messageString, metadata.meaning || ''); | ||
const legacyIds = metadata.legacyIds.filter(id => id !== messageId); | ||
const legacyIds = metadata.legacyIds && metadata.legacyIds.filter(id => id !== messageId); | ||
return { | ||
messageId, | ||
id: messageId, | ||
legacyIds, | ||
substitutions, | ||
messageString, | ||
text: messageString, | ||
meaning: metadata.meaning || '', | ||
@@ -48,2 +48,3 @@ description: metadata.description || '', | ||
placeholderNames, | ||
location, | ||
}; | ||
@@ -78,5 +79,5 @@ } | ||
export function parseMetadata(cooked, raw) { | ||
const { text, block } = splitBlock(cooked, raw); | ||
const { text: messageString, block } = splitBlock(cooked, raw); | ||
if (block === undefined) { | ||
return { text, meaning: undefined, description: undefined, id: undefined, legacyIds: [] }; | ||
return { text: messageString }; | ||
} | ||
@@ -94,3 +95,3 @@ else { | ||
} | ||
return { text, meaning, description, id, legacyIds }; | ||
return { text: messageString, meaning, description, id, legacyIds }; | ||
} | ||
@@ -157,2 +158,2 @@ } | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWVzc2FnZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9sb2NhbGl6ZS9zcmMvdXRpbHMvc3J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KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqXG4gICAqIFRoaXMgZnVuY3Rpb24gaXMgcmVwZWF0ZWQgaW4gYHNyYy9sb2NhbGl6ZS9zcmMvbG9jYWxpemUudHNgIGFuZCB0aGUgdHdvIHNob3VsZCBiZSBrZXB0IGluIHN5bmMuXG4gICAqIChTZWUgdGhhdCBmaWxlIGZvciBtb3JlIGV4cGxhbmF0aW9uIG9mIHdoeS4pXG4gICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovXG4gIGZvciAobGV0IGNvb2tlZEluZGV4ID0gMSwgcmF3SW5kZXggPSAxOyBjb29rZWRJbmRleCA8IGNvb2tlZC5sZW5ndGg7IGNvb2tlZEluZGV4KyssIHJhd0luZGV4KyspIHtcbiAgICBpZiAocmF3W3Jhd0luZGV4XSA9PT0gJ1xcXFwnKSB7XG4gICAgICByYXdJbmRleCsrO1xuICAgIH0gZWxzZSBpZiAoY29va2VkW2Nvb2tlZEluZGV4XSA9PT0gQkxPQ0tfTUFSS0VSKSB7XG4gICAgICByZXR1cm4gY29va2VkSW5kZXg7XG4gICAgfVxuICB9XG4gIHRocm93IG5ldyBFcnJvcihgVW50ZXJtaW5hdGVkICRsb2NhbGl6ZSBtZXRhZGF0YSBibG9jayBpbiBcIiR7cmF3fVwiLmApO1xufSJdfQ== | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWVzc2FnZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9sb2NhbGl6ZS9zcmMvdXRpbHMvc3JjL21lc3NhZ2VzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO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uXG4vKipcbiAqIEZpbmQgdGhlIGVuZCBvZiBhIFwibWFya2VkIGJsb2NrXCIgaW5kaWNhdGVkIGJ5IHRoZSBmaXJzdCBub24tZXNjYXBlZCBjb2xvbi5cbiAqXG4gKiBAcGFyYW0gY29va2VkIFRoZSBjb29rZWQgc3RyaW5nICh3aGVyZSBlc2NhcGVkIGNoYXJzIGhhdmUgYmVlbiBwcm9jZXNzZWQpXG4gKiBAcGFyYW0gcmF3IFRoZSByYXcgc3RyaW5nICh3aGVyZSBlc2NhcGUgc2VxdWVuY2VzIGFyZSBzdGlsbCBpbiBwbGFjZSlcbiAqXG4gKiBAcmV0dXJucyB0aGUgaW5kZXggb2YgdGhlIGVuZCBvZiBibG9jayBtYXJrZXJcbiAqIEB0aHJvd3MgYW4gZXJyb3IgaWYgdGhlIGJsb2NrIGlzIHVudGVybWluYXRlZFxuICovXG5leHBvcnQgZnVuY3Rpb24gZmluZEVuZE9mQmxvY2soY29va2VkOiBzdHJpbmcsIHJhdzogc3RyaW5nKTogbnVtYmVyIHtcbiAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKlxuICAgKiBUaGlzIGZ1bmN0aW9uIGlzIHJlcGVhdGVkIGluIGBzcmMvbG9jYWxpemUvc3JjL2xvY2FsaXplLnRzYCBhbmQgdGhlIHR3byBzaG91bGQgYmUga2VwdCBpbiBzeW5jLlxuICAgKiAoU2VlIHRoYXQgZmlsZSBmb3IgbW9yZSBleHBsYW5hdGlvbiBvZiB3aHkuKVxuICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqL1xuICBmb3IgKGxldCBjb29rZWRJbmRleCA9IDEsIHJhd0luZGV4ID0gMTsgY29va2VkSW5kZXggPCBjb29rZWQubGVuZ3RoOyBjb29rZWRJbmRleCsrLCByYXdJbmRleCsrKSB7XG4gICAgaWYgKHJhd1tyYXdJbmRleF0gPT09ICdcXFxcJykge1xuICAgICAgcmF3SW5kZXgrKztcbiAgICB9IGVsc2UgaWYgKGNvb2tlZFtjb29rZWRJbmRleF0gPT09IEJMT0NLX01BUktFUikge1xuICAgICAgcmV0dXJuIGNvb2tlZEluZGV4O1xuICAgIH1cbiAgfVxuICB0aHJvdyBuZXcgRXJyb3IoYFVudGVybWluYXRlZCAkbG9jYWxpemUgbWV0YWRhdGEgYmxvY2sgaW4gXCIke3Jhd31cIi5gKTtcbn0iXX0= |
@@ -39,6 +39,8 @@ /** | ||
// Look up the translation using the messageId, and then the legacyId if available. | ||
let translation = translations[message.messageId]; | ||
let translation = translations[message.id]; | ||
// If the messageId did not match a translation, try matching the legacy ids instead | ||
for (let i = 0; i < message.legacyIds.length && translation === undefined; i++) { | ||
translation = translations[message.legacyIds[i]]; | ||
if (message.legacyIds !== undefined) { | ||
for (let i = 0; i < message.legacyIds.length && translation === undefined; i++) { | ||
translation = translations[message.legacyIds[i]]; | ||
} | ||
} | ||
@@ -68,4 +70,4 @@ if (translation === undefined) { | ||
*/ | ||
export function parseTranslation(message) { | ||
const parts = message.split(/{\$([^}]*)}/); | ||
export function parseTranslation(messageString) { | ||
const parts = messageString.split(/{\$([^}]*)}/); | ||
const messageParts = [parts[0]]; | ||
@@ -78,3 +80,7 @@ const placeholderNames = []; | ||
const rawMessageParts = messageParts.map(part => part.charAt(0) === BLOCK_MARKER ? '\\' + part : part); | ||
return { messageParts: makeTemplateObject(messageParts, rawMessageParts), placeholderNames }; | ||
return { | ||
text: messageString, | ||
messageParts: makeTemplateObject(messageParts, rawMessageParts), | ||
placeholderNames, | ||
}; | ||
} | ||
@@ -88,3 +94,11 @@ /** | ||
export function makeParsedTranslation(messageParts, placeholderNames = []) { | ||
return { messageParts: makeTemplateObject(messageParts, messageParts), placeholderNames }; | ||
let messageString = messageParts[0]; | ||
for (let i = 0; i < placeholderNames.length - 1; i++) { | ||
messageString += `{$${placeholderNames[i]}}${messageParts[i + 1]}`; | ||
} | ||
return { | ||
text: messageString, | ||
messageParts: makeTemplateObject(messageParts, messageParts), | ||
placeholderNames | ||
}; | ||
} | ||
@@ -103,4 +117,7 @@ /** | ||
const meaningString = message.meaning && ` - "${message.meaning}"`; | ||
return `"${message.messageId}" ("${message.messageString}"${meaningString})`; | ||
const legacy = message.legacyIds && message.legacyIds.length > 0 ? | ||
` [${message.legacyIds.map(l => `"${l}"`).join(', ')}]` : | ||
''; | ||
return `"${message.id}"${legacy} ("${message.text}"${meaningString})`; | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhbnNsYXRpb25zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvbG9jYWxpemUvc3JjL3V0aWxzL3NyYy90cmFuc2xhdGlvbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztHQU1HO0FBQ0gsT0FBTyxFQUFDLFlBQVksRUFBQyxNQUFNLGFBQWEsQ0FBQztBQUN6QyxPQUFPLEVBQTJCLFlBQVksRUFBZ0IsTUFBTSxZQUFZLENBQUM7QUFnQmpGLE1BQU0sT0FBTyx1QkFBd0IsU0FBUSxLQUFLO0lBRWhELFlBQXFCLGFBQTRCO1FBQy9DLEtBQUssQ0FBQyw0QkFBNEIsZUFBZSxDQUFDLGFBQWEsQ0FBQyxHQUFHLENBQUMsQ0FBQztRQURsRCxrQkFBYSxHQUFiLGFBQWEsQ0FBZTtRQURoQyxTQUFJLEdBQUcseUJBQXlCLENBQUM7SUFHbEQsQ0FBQztDQUNGO0FBRUQsTUFBTSxVQUFVLHlCQUF5QixDQUFDLENBQU07SUFDOUMsT0FBTyxDQUFDLENBQUMsSUFBSSxLQUFLLHlCQUF5QixDQUFDO0FB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A9PiBgXCIke2x9XCJgKS5qb2luKCcsICcpfV1gIDpcbiAgICAgICcnO1xuICByZXR1cm4gYFwiJHttZXNzYWdlLmlkfVwiJHtsZWdhY3l9IChcIiR7bWVzc2FnZS50ZXh0fVwiJHttZWFuaW5nU3RyaW5nfSlgO1xufSJdfQ== |
@@ -11,2 +11,2 @@ /** | ||
export { computeMsgId as ɵcomputeMsgId, findEndOfBlock as ɵfindEndOfBlock, isMissingTranslationError as ɵisMissingTranslationError, makeParsedTranslation as ɵmakeParsedTranslation, makeTemplateObject as ɵmakeTemplateObject, MissingTranslationError as ɵMissingTranslationError, parseMessage as ɵparseMessage, parseMetadata as ɵparseMetadata, parseTranslation as ɵparseTranslation, splitBlock as ɵsplitBlock, translate as ɵtranslate } from './src/utils'; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJpdmF0ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL2xvY2FsaXplL3ByaXZhdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztHQU1HO0FBRUgsa0dBQWtHO0FBQ2xHLHdCQUF3QjtBQUN4QixPQUFPLEVBQUMsWUFBWSxJQUFJLGFBQWEsRUFBRSxjQUFjLElBQUksZUFBZSxFQUFFLHlCQUF5QixJQUFJLDBCQUEwQixFQUFFLHFCQUFxQixJQUFJLHNCQUFzQixFQUFFLGtCQUFrQixJQUFJLG1CQUFtQixFQUEyQix1QkFBdUIsSUFBSSx3QkFBd0IsRUFBdUgsWUFBWSxJQUFJLGFBQWEsRUFBRSxhQUFhLElBQUksY0FBYyxFQUFFLGdCQUFnQixJQUFJLGlCQUFpQixFQUFtQyxVQUFVLElBQUksV0FBVyxFQUFtQyxTQUFTLElBQUksVUFBVSxFQUFDLE1BQU0sYUFBYSxDQUFDIiwic291cmNlc0NvbnRl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nNlVHJhbnNsYXRpb24gYXMgybVwYXJzZVRyYW5zbGF0aW9uLCBTb3VyY2VMb2NhdGlvbiBhcyDJtVNvdXJjZUxvY2F0aW9uLCBTb3VyY2VNZXNzYWdlIGFzIMm1U291cmNlTWVzc2FnZSwgc3BsaXRCbG9jayBhcyDJtXNwbGl0QmxvY2ssIFRhcmdldE1lc3NhZ2UgYXMgybVUYXJnZXRNZXNzYWdlLCB0cmFuc2xhdGUgYXMgybV0cmFuc2xhdGV9IGZyb20gJy4vc3JjL3V0aWxzJztcbiJdfQ== |
@@ -21,3 +21,3 @@ import { __read } from "tslib"; | ||
*/ | ||
export function parseMessage(messageParts, expressions) { | ||
export function parseMessage(messageParts, expressions, location) { | ||
var substitutions = {}; | ||
@@ -38,8 +38,8 @@ var metadata = parseMetadata(messageParts[0], messageParts.raw[0]); | ||
var messageId = metadata.id || computeMsgId(messageString, metadata.meaning || ''); | ||
var legacyIds = metadata.legacyIds.filter(function (id) { return id !== messageId; }); | ||
var legacyIds = metadata.legacyIds && metadata.legacyIds.filter(function (id) { return id !== messageId; }); | ||
return { | ||
messageId: messageId, | ||
id: messageId, | ||
legacyIds: legacyIds, | ||
substitutions: substitutions, | ||
messageString: messageString, | ||
text: messageString, | ||
meaning: metadata.meaning || '', | ||
@@ -49,2 +49,3 @@ description: metadata.description || '', | ||
placeholderNames: placeholderNames, | ||
location: location, | ||
}; | ||
@@ -79,5 +80,5 @@ } | ||
export function parseMetadata(cooked, raw) { | ||
var _a = splitBlock(cooked, raw), text = _a.text, block = _a.block; | ||
var _a = splitBlock(cooked, raw), messageString = _a.text, block = _a.block; | ||
if (block === undefined) { | ||
return { text: text, meaning: undefined, description: undefined, id: undefined, legacyIds: [] }; | ||
return { text: messageString }; | ||
} | ||
@@ -95,3 +96,3 @@ else { | ||
} | ||
return { text: text, meaning: meaning, description: description, id: id, legacyIds: legacyIds }; | ||
return { text: messageString, meaning: meaning, description: description, id: id, legacyIds: legacyIds }; | ||
} | ||
@@ -158,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KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqXG4gICAqIFRoaXMgZnVuY3Rpb24gaXMgcmVwZWF0ZWQgaW4gYHNyYy9sb2NhbGl6ZS9zcmMvbG9jYWxpemUudHNgIGFuZCB0aGUgdHdvIHNob3VsZCBiZSBrZXB0IGluIHN5bmMuXG4gICAqIChTZWUgdGhhdCBmaWxlIGZvciBtb3JlIGV4cGxhbmF0aW9uIG9mIHdoeS4pXG4gICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovXG4gIGZvciAobGV0IGNvb2tlZEluZGV4ID0gMSwgcmF3SW5kZXggPSAxOyBjb29rZWRJbmRleCA8IGNvb2tlZC5sZW5ndGg7IGNvb2tlZEluZGV4KyssIHJhd0luZGV4KyspIHtcbiAgICBpZiAocmF3W3Jhd0luZGV4XSA9PT0gJ1xcXFwnKSB7XG4gICAgICByYXdJbmRleCsrO1xuICAgIH0gZWxzZSBpZiAoY29va2VkW2Nvb2tlZEluZGV4XSA9PT0gQkxPQ0tfTUFSS0VSKSB7XG4gICAgICByZXR1cm4gY29va2VkSW5kZXg7XG4gICAgfVxuICB9XG4gIHRocm93IG5ldyBFcnJvcihgVW50ZXJtaW5hdGVkICRsb2NhbGl6ZSBtZXRhZGF0YSBibG9jayBpbiBcIiR7cmF3fVwiLmApO1xufSJdfQ== | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWVzc2FnZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9sb2NhbGl6ZS9zcmMvdXRpbHMvc3JjL21lc3NhZ2VzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQTs7Ozs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bGwgaW4gcGxhY2UpXG4gKlxuICogQHJldHVybnMgdGhlIGluZGV4IG9mIHRoZSBlbmQgb2YgYmxvY2sgbWFya2VyXG4gKiBAdGhyb3dzIGFuIGVycm9yIGlmIHRoZSBibG9jayBpcyB1bnRlcm1pbmF0ZWRcbiAqL1xuZXhwb3J0IGZ1bmN0aW9uIGZpbmRFbmRPZkJsb2NrKGNvb2tlZDogc3RyaW5nLCByYXc6IHN0cmluZyk6IG51bWJlciB7XG4gIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKipcbiAgICogVGhpcyBmdW5jdGlvbiBpcyByZXBlYXRlZCBpbiBgc3JjL2xvY2FsaXplL3NyYy9sb2NhbGl6ZS50c2AgYW5kIHRoZSB0d28gc2hvdWxkIGJlIGtlcHQgaW4gc3luYy5cbiAgICogKFNlZSB0aGF0IGZpbGUgZm9yIG1vcmUgZXhwbGFuYXRpb24gb2Ygd2h5LilcbiAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi9cbiAgZm9yIChsZXQgY29va2VkSW5kZXggPSAxLCByYXdJbmRleCA9IDE7IGNvb2tlZEluZGV4IDwgY29va2VkLmxlbmd0aDsgY29va2VkSW5kZXgrKywgcmF3SW5kZXgrKykge1xuICAgIGlmIChyYXdbcmF3SW5kZXhdID09PSAnXFxcXCcpIHtcbiAgICAgIHJhd0luZGV4Kys7XG4gICAgfSBlbHNlIGlmIChjb29rZWRbY29va2VkSW5kZXhdID09PSBCTE9DS19NQVJLRVIpIHtcbiAgICAgIHJldHVybiBjb29rZWRJbmRleDtcbiAgICB9XG4gIH1cbiAgdGhyb3cgbmV3IEVycm9yKGBVbnRlcm1pbmF0ZWQgJGxvY2FsaXplIG1ldGFkYXRhIGJsb2NrIGluIFwiJHtyYXd9XCIuYCk7XG59Il19 |
@@ -44,6 +44,8 @@ import { __extends } from "tslib"; | ||
// Look up the translation using the messageId, and then the legacyId if available. | ||
var translation = translations[message.messageId]; | ||
var translation = translations[message.id]; | ||
// If the messageId did not match a translation, try matching the legacy ids instead | ||
for (var i = 0; i < message.legacyIds.length && translation === undefined; i++) { | ||
translation = translations[message.legacyIds[i]]; | ||
if (message.legacyIds !== undefined) { | ||
for (var i = 0; i < message.legacyIds.length && translation === undefined; i++) { | ||
translation = translations[message.legacyIds[i]]; | ||
} | ||
} | ||
@@ -73,4 +75,4 @@ if (translation === undefined) { | ||
*/ | ||
export function parseTranslation(message) { | ||
var parts = message.split(/{\$([^}]*)}/); | ||
export function parseTranslation(messageString) { | ||
var parts = messageString.split(/{\$([^}]*)}/); | ||
var messageParts = [parts[0]]; | ||
@@ -83,3 +85,7 @@ var placeholderNames = []; | ||
var rawMessageParts = messageParts.map(function (part) { return part.charAt(0) === BLOCK_MARKER ? '\\' + part : part; }); | ||
return { messageParts: makeTemplateObject(messageParts, rawMessageParts), placeholderNames: placeholderNames }; | ||
return { | ||
text: messageString, | ||
messageParts: makeTemplateObject(messageParts, rawMessageParts), | ||
placeholderNames: placeholderNames, | ||
}; | ||
} | ||
@@ -94,3 +100,11 @@ /** | ||
if (placeholderNames === void 0) { placeholderNames = []; } | ||
return { messageParts: makeTemplateObject(messageParts, messageParts), placeholderNames: placeholderNames }; | ||
var messageString = messageParts[0]; | ||
for (var i = 0; i < placeholderNames.length - 1; i++) { | ||
messageString += "{$" + placeholderNames[i] + "}" + messageParts[i + 1]; | ||
} | ||
return { | ||
text: messageString, | ||
messageParts: makeTemplateObject(messageParts, messageParts), | ||
placeholderNames: placeholderNames | ||
}; | ||
} | ||
@@ -109,4 +123,7 @@ /** | ||
var meaningString = message.meaning && " - \"" + message.meaning + "\""; | ||
return "\"" + message.messageId + "\" (\"" + message.messageString + "\"" + meaningString + ")"; | ||
var legacy = message.legacyIds && message.legacyIds.length > 0 ? | ||
" [" + message.legacyIds.map(function (l) { return "\"" + l + "\""; }).join(', ') + "]" : | ||
''; | ||
return "\"" + message.id + "\"" + legacy + " (\"" + message.text + "\"" + meaningString + ")"; | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhbnNsYXRpb25zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvbG9jYWxpemUvc3JjL3V0aWxzL3NyYy90cmFuc2xhdGlvbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBOzs7Ozs7R0FNRztBQUNILE9BQU8sRUFBQyxZQUFZLEVBQUMsTUFBTSxhQUFhLENBQUM7QUFDekMsT0FBTyxFQUEyQixZQUFZLEVBQWdCLE1BQU0sWUFBWSxDQUFDO0FBZ0JqRjtJQUE2QywyQ0FBSztJQUVoRCxpQ0FBcUIsYUFBNEI7UUFBakQsWUFDRSxrQkFBTSw4QkFBNEIsZUFBZSxDQUFDLGFBQWEsQ0FBQyxNQUFHLENBQUMsU0FDckU7UUFGb0IsbUJBQWEsR0FBYixhQUFhLENBQWU7UUFEaEMsVUFBSSxHQUFHLHlCQUF5QixDQUFDOztJQUdsRCxDQUFDO0lBQ0gsOEJBQUM7QUFBRCxDQUFDLEFBTEQsQ0FBNkMsS0FBSyxHQUtqRDs7QUFFRCxNQUFNLFVBQVUseUJBQXlCLENBQUMsQ0FBTTtJQUM5QyxPQUFPLENBQUMsQ0FBQyxJQUFJLEtBQUsseUJBQXlCLENBQUM7QUFDOUMsQ0FBQztBQUVEOzs7Ozs7Ozs7Ozs7Ozs7R0FlRztBQUNILE1BQU0sVUFBVSxTQUFTLENBQ3JCLFlBQStDLEVBQUUsWUFBa0MsRUFDbkYsYUFBNkI7SUFDL0IsSUFBTSxPQUFPLEdBQUcsWUFBWSxDQ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ZXNzYWdlLmxlZ2FjeUlkcy5tYXAobCA9PiBgXCIke2x9XCJgKS5qb2luKCcsICcpfV1gIDpcbiAgICAgICcnO1xuICByZXR1cm4gYFwiJHttZXNzYWdlLmlkfVwiJHtsZWdhY3l9IChcIiR7bWVzc2FnZS50ZXh0fVwiJHttZWFuaW5nU3RyaW5nfSlgO1xufSJdfQ== |
/** | ||
* @license Angular v9.1.3 | ||
* @license Angular v9.1.4 | ||
* (c) 2010-2020 Google LLC. https://angular.io/ | ||
@@ -4,0 +4,0 @@ * License: MIT |
/** | ||
* @license Angular v9.1.3 | ||
* @license Angular v9.1.4 | ||
* (c) 2010-2020 Google LLC. https://angular.io/ | ||
@@ -80,3 +80,3 @@ * License: MIT | ||
*/ | ||
function parseMessage(messageParts, expressions) { | ||
function parseMessage(messageParts, expressions, location) { | ||
const substitutions = {}; | ||
@@ -97,8 +97,8 @@ const metadata = parseMetadata(messageParts[0], messageParts.raw[0]); | ||
const messageId = metadata.id || computeMsgId(messageString, metadata.meaning || ''); | ||
const legacyIds = metadata.legacyIds.filter(id => id !== messageId); | ||
const legacyIds = metadata.legacyIds && metadata.legacyIds.filter(id => id !== messageId); | ||
return { | ||
messageId, | ||
id: messageId, | ||
legacyIds, | ||
substitutions, | ||
messageString, | ||
text: messageString, | ||
meaning: metadata.meaning || '', | ||
@@ -108,2 +108,3 @@ description: metadata.description || '', | ||
placeholderNames, | ||
location, | ||
}; | ||
@@ -138,5 +139,5 @@ } | ||
function parseMetadata(cooked, raw) { | ||
const { text, block } = splitBlock(cooked, raw); | ||
const { text: messageString, block } = splitBlock(cooked, raw); | ||
if (block === undefined) { | ||
return { text, meaning: undefined, description: undefined, id: undefined, legacyIds: [] }; | ||
return { text: messageString }; | ||
} | ||
@@ -154,3 +155,3 @@ else { | ||
} | ||
return { text, meaning, description, id, legacyIds }; | ||
return { text: messageString, meaning, description, id, legacyIds }; | ||
} | ||
@@ -254,6 +255,8 @@ } | ||
// Look up the translation using the messageId, and then the legacyId if available. | ||
let translation = translations[message.messageId]; | ||
let translation = translations[message.id]; | ||
// If the messageId did not match a translation, try matching the legacy ids instead | ||
for (let i = 0; i < message.legacyIds.length && translation === undefined; i++) { | ||
translation = translations[message.legacyIds[i]]; | ||
if (message.legacyIds !== undefined) { | ||
for (let i = 0; i < message.legacyIds.length && translation === undefined; i++) { | ||
translation = translations[message.legacyIds[i]]; | ||
} | ||
} | ||
@@ -283,4 +286,4 @@ if (translation === undefined) { | ||
*/ | ||
function parseTranslation(message) { | ||
const parts = message.split(/{\$([^}]*)}/); | ||
function parseTranslation(messageString) { | ||
const parts = messageString.split(/{\$([^}]*)}/); | ||
const messageParts = [parts[0]]; | ||
@@ -293,3 +296,7 @@ const placeholderNames = []; | ||
const rawMessageParts = messageParts.map(part => part.charAt(0) === BLOCK_MARKER ? '\\' + part : part); | ||
return { messageParts: makeTemplateObject(messageParts, rawMessageParts), placeholderNames }; | ||
return { | ||
text: messageString, | ||
messageParts: makeTemplateObject(messageParts, rawMessageParts), | ||
placeholderNames, | ||
}; | ||
} | ||
@@ -303,3 +310,11 @@ /** | ||
function makeParsedTranslation(messageParts, placeholderNames = []) { | ||
return { messageParts: makeTemplateObject(messageParts, messageParts), placeholderNames }; | ||
let messageString = messageParts[0]; | ||
for (let i = 0; i < placeholderNames.length - 1; i++) { | ||
messageString += `{$${placeholderNames[i]}}${messageParts[i + 1]}`; | ||
} | ||
return { | ||
text: messageString, | ||
messageParts: makeTemplateObject(messageParts, messageParts), | ||
placeholderNames | ||
}; | ||
} | ||
@@ -318,3 +333,6 @@ /** | ||
const meaningString = message.meaning && ` - "${message.meaning}"`; | ||
return `"${message.messageId}" ("${message.messageString}"${meaningString})`; | ||
const legacy = message.legacyIds && message.legacyIds.length > 0 ? | ||
` [${message.legacyIds.map(l => `"${l}"`).join(', ')}]` : | ||
''; | ||
return `"${message.id}"${legacy} ("${message.text}"${meaningString})`; | ||
} | ||
@@ -321,0 +339,0 @@ |
/** | ||
* @license Angular v9.1.3 | ||
* @license Angular v9.1.4 | ||
* (c) 2010-2020 Google LLC. https://angular.io/ | ||
@@ -4,0 +4,0 @@ * License: MIT |
/** | ||
* @license Angular v9.1.3 | ||
* @license Angular v9.1.4 | ||
* (c) 2010-2020 Google LLC. https://angular.io/ | ||
@@ -74,3 +74,3 @@ * License: MIT | ||
*/ | ||
function parseMessage(messageParts, expressions) { | ||
function parseMessage(messageParts, expressions, location) { | ||
var substitutions = {}; | ||
@@ -91,8 +91,8 @@ var metadata = parseMetadata(messageParts[0], messageParts.raw[0]); | ||
var messageId = metadata.id || computeMsgId(messageString, metadata.meaning || ''); | ||
var legacyIds = metadata.legacyIds.filter(function (id) { return id !== messageId; }); | ||
var legacyIds = metadata.legacyIds && metadata.legacyIds.filter(function (id) { return id !== messageId; }); | ||
return { | ||
messageId: messageId, | ||
id: messageId, | ||
legacyIds: legacyIds, | ||
substitutions: substitutions, | ||
messageString: messageString, | ||
text: messageString, | ||
meaning: metadata.meaning || '', | ||
@@ -102,2 +102,3 @@ description: metadata.description || '', | ||
placeholderNames: placeholderNames, | ||
location: location, | ||
}; | ||
@@ -132,5 +133,5 @@ } | ||
function parseMetadata(cooked, raw) { | ||
var _a = splitBlock(cooked, raw), text = _a.text, block = _a.block; | ||
var _a = splitBlock(cooked, raw), messageString = _a.text, block = _a.block; | ||
if (block === undefined) { | ||
return { text: text, meaning: undefined, description: undefined, id: undefined, legacyIds: [] }; | ||
return { text: messageString }; | ||
} | ||
@@ -148,3 +149,3 @@ else { | ||
} | ||
return { text: text, meaning: meaning, description: description, id: id, legacyIds: legacyIds }; | ||
return { text: messageString, meaning: meaning, description: description, id: id, legacyIds: legacyIds }; | ||
} | ||
@@ -244,6 +245,8 @@ } | ||
// Look up the translation using the messageId, and then the legacyId if available. | ||
var translation = translations[message.messageId]; | ||
var translation = translations[message.id]; | ||
// If the messageId did not match a translation, try matching the legacy ids instead | ||
for (var i = 0; i < message.legacyIds.length && translation === undefined; i++) { | ||
translation = translations[message.legacyIds[i]]; | ||
if (message.legacyIds !== undefined) { | ||
for (var i = 0; i < message.legacyIds.length && translation === undefined; i++) { | ||
translation = translations[message.legacyIds[i]]; | ||
} | ||
} | ||
@@ -273,4 +276,4 @@ if (translation === undefined) { | ||
*/ | ||
function parseTranslation(message) { | ||
var parts = message.split(/{\$([^}]*)}/); | ||
function parseTranslation(messageString) { | ||
var parts = messageString.split(/{\$([^}]*)}/); | ||
var messageParts = [parts[0]]; | ||
@@ -283,3 +286,7 @@ var placeholderNames = []; | ||
var rawMessageParts = messageParts.map(function (part) { return part.charAt(0) === BLOCK_MARKER ? '\\' + part : part; }); | ||
return { messageParts: makeTemplateObject(messageParts, rawMessageParts), placeholderNames: placeholderNames }; | ||
return { | ||
text: messageString, | ||
messageParts: makeTemplateObject(messageParts, rawMessageParts), | ||
placeholderNames: placeholderNames, | ||
}; | ||
} | ||
@@ -294,3 +301,11 @@ /** | ||
if (placeholderNames === void 0) { placeholderNames = []; } | ||
return { messageParts: makeTemplateObject(messageParts, messageParts), placeholderNames: placeholderNames }; | ||
var messageString = messageParts[0]; | ||
for (var i = 0; i < placeholderNames.length - 1; i++) { | ||
messageString += "{$" + placeholderNames[i] + "}" + messageParts[i + 1]; | ||
} | ||
return { | ||
text: messageString, | ||
messageParts: makeTemplateObject(messageParts, messageParts), | ||
placeholderNames: placeholderNames | ||
}; | ||
} | ||
@@ -309,3 +324,6 @@ /** | ||
var meaningString = message.meaning && " - \"" + message.meaning + "\""; | ||
return "\"" + message.messageId + "\" (\"" + message.messageString + "\"" + meaningString + ")"; | ||
var legacy = message.legacyIds && message.legacyIds.length > 0 ? | ||
" [" + message.legacyIds.map(function (l) { return "\"" + l + "\""; }).join(', ') + "]" : | ||
''; | ||
return "\"" + message.id + "\"" + legacy + " (\"" + message.text + "\"" + meaningString + ")"; | ||
} | ||
@@ -312,0 +330,0 @@ |
/** | ||
* @license Angular v9.1.3 | ||
* @license Angular v9.1.4 | ||
* (c) 2010-2020 Google LLC. https://angular.io/ | ||
@@ -4,0 +4,0 @@ * License: MIT |
{ | ||
"name": "@angular/localize", | ||
"version": "9.1.3", | ||
"version": "9.1.4", | ||
"description": "Angular - library for localizing messages", | ||
@@ -5,0 +5,0 @@ "main": "./bundles/localize.umd.js", |
@@ -8,2 +8,2 @@ /** | ||
*/ | ||
export { computeMsgId as ɵcomputeMsgId, findEndOfBlock as ɵfindEndOfBlock, isMissingTranslationError as ɵisMissingTranslationError, makeParsedTranslation as ɵmakeParsedTranslation, makeTemplateObject as ɵmakeTemplateObject, MessageId as ɵMessageId, MissingTranslationError as ɵMissingTranslationError, ParsedMessage as ɵParsedMessage, ParsedTranslation as ɵParsedTranslation, ParsedTranslations as ɵParsedTranslations, parseMessage as ɵparseMessage, parseMetadata as ɵparseMetadata, parseTranslation as ɵparseTranslation, SourceMessage as ɵSourceMessage, splitBlock as ɵsplitBlock, TargetMessage as ɵTargetMessage, translate as ɵtranslate } from './src/utils'; | ||
export { computeMsgId as ɵcomputeMsgId, findEndOfBlock as ɵfindEndOfBlock, isMissingTranslationError as ɵisMissingTranslationError, makeParsedTranslation as ɵmakeParsedTranslation, makeTemplateObject as ɵmakeTemplateObject, MessageId as ɵMessageId, MissingTranslationError as ɵMissingTranslationError, ParsedMessage as ɵParsedMessage, ParsedTranslation as ɵParsedTranslation, ParsedTranslations as ɵParsedTranslations, parseMessage as ɵparseMessage, parseMetadata as ɵparseMetadata, parseTranslation as ɵparseTranslation, SourceLocation as ɵSourceLocation, SourceMessage as ɵSourceMessage, splitBlock as ɵsplitBlock, TargetMessage as ɵTargetMessage, translate as ɵtranslate } from './src/utils'; |
@@ -9,3 +9,3 @@ /// <amd-module name="@angular/localize/src/tools/src/translate/source_files/source_file_utils" /> | ||
*/ | ||
import { ɵParsedTranslation } from '@angular/localize'; | ||
import { ɵParsedTranslation, ɵSourceLocation } from '@angular/localize'; | ||
import { NodePath } from '@babel/traverse'; | ||
@@ -115,1 +115,2 @@ import * as t from '@babel/types'; | ||
export declare function buildCodeFrameError(path: NodePath, e: BabelParseError): string; | ||
export declare function getLocation(path: NodePath): ɵSourceLocation | undefined; |
@@ -336,3 +336,14 @@ (function (factory) { | ||
exports.buildCodeFrameError = buildCodeFrameError; | ||
function getLocation(path) { | ||
var location = path.node.loc; | ||
var file = path.hub.file.ops.fileName; | ||
if (!location || !file) { | ||
return undefined; | ||
} | ||
// Note we clone the `start` and `end` objects so that their prototype chains, | ||
// from Babel, do not leak into our code. | ||
return { start: tslib_1.__assign({}, location.start), end: tslib_1.__assign({}, location.end), file: file }; | ||
} | ||
exports.getLocation = getLocation; | ||
}); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic291cmNlX2ZpbGVfdXRpbHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9sb2NhbGl6ZS9zcmMvdG9vbHMvc3JjL3RyYW5zbGF0ZS9zb3VyY2VfZmlsZXMvc291cmNlX2ZpbGVfdXRpbHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7O0lBQUE7Ozs7OztPQU1HO0lBQ0gsOENBQWtIO0lBRWxILGdDQUFrQztJQUlsQzs7Ozs7T0FLRztJQUNILFNBQWdCLFVBQVUsQ0FDdEIsVUFBb0IsRUFBRSxZQUFvQjtRQUM1QyxPQUFPLGlCQUFpQixDQUFDLFVBQVUsRUFBRSxZQUFZLENBQUMsSUFBSSxrQkFBa0IsQ0FBQyxVQUFVLENBQUMsQ0FBQztJQUN2RixDQUFDO0lBSEQsZ0NBR0M7SUFFRDs7Ozs7T0FLRztJQUNILFNBQWdCLGlCQUFpQixDQUM3QixVQUFvQixFQUFFLElBQVk7UUFDcEMsT0FBTyxVQUFVLENBQUMsWUFBWSxFQUFFLElBQUksVUFBVSxDQUFDLElBQUksQ0FBQyxJQUFJLEtBQUssSUFBSSxDQUFDO0lBQ3BF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Zyb20gQmFiZWwsIGRvIG5vdCBsZWFrIGludG8gb3VyIGNvZGUuXG4gIHJldHVybiB7c3RhcnQ6IHsuLi5sb2NhdGlvbi5zdGFydH0sIGVuZDogey4uLmxvY2F0aW9uLmVuZH0sIGZpbGV9O1xufVxuIl19 |
@@ -22,2 +22,1 @@ /** | ||
} | ||
export declare function stripInterpolationMarkers(interpolation: string): string; |
@@ -19,7 +19,3 @@ /** | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
function stripInterpolationMarkers(interpolation) { | ||
return interpolation.replace(/^\{\{/, '').replace(/}}$/, ''); | ||
} | ||
exports.stripInterpolationMarkers = stripInterpolationMarkers; | ||
}); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWVzc2FnZV9yZW5kZXJlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL2xvY2FsaXplL3NyYy90b29scy9zcmMvdHJhbnNsYXRlL3RyYW5zbGF0aW9uX2ZpbGVzL21lc3NhZ2Vfc2VyaWFsaXphdGlvbi9tZXNzYWdlX3JlbmRlcmVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7R0FNRzs7Ozs7Ozs7Ozs7O0lBZ0JILFNBQWdCLHlCQUF5QixDQUFDLGFBQXFCO1FBQzdELE9BQU8sYUFBYSxDQUFDLE9BQU8sQ0FBQyxPQUFPLEVBQUUsRUFBRSxDQUFDLENBQUMsT0FBTyxDQUFDLEtBQUssRUFBRSxFQUFFLENBQUMsQ0FBQztJQUMvRCxDQUFDO0lBRkQsOERBRUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEBsaWNlbnNlXG4gKiBDb3B5cmlnaHQgR29vZ2xlIEluYy4gQWxsIFJpZ2h0cyBSZXNlcnZlZC5cbiAqXG4gKiBVc2Ugb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XplL3NyYy90b29scy9zcmMvdHJhbnNsYXRlL3RyYW5zbGF0aW9uX2ZpbGVzL21lc3NhZ2Vfc2VyaWFsaXphdGlvbi9tZXNzYWdlX3JlbmRlcmVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7R0FNRyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogQGxpY2Vuc2VcbiAqIENvcHlyaWdodCBHb29nbGUgSW5jLiBBbGwgUmlnaHRzIFJlc2VydmVkLlxuICpcbiAqIFVzZSBvZiB0aGlzIHNvdXJjZSBjb2RlIGlzIGdvdmVybmVkIGJ5IGFuIE1JVC1zdHlsZSBsaWNlbnNlIHRoYXQgY2FuIGJlXG4gKiBmb3VuZCBpbiB0aGUgTElDRU5TRSBmaWxlIGF0IGh0dHBzOi8vYW5ndWxhci5pby9saWNlbnNlXG4gKi9cblxuZXhwb3J0IGludGVyZmFjZSBNZXNzYWdlUmVuZGVyZXI8VD4ge1xuICBtZXNzYWdlOiBUO1xuICBzdGFydFJlbmRlcigpOiB2b2lkO1xuICBlbmRSZW5kZXIoKTogdm9pZDtcbiAgdGV4dCh0ZXh0OiBzdHJpbmcpOiB2b2lkO1xuICBwbGFjZWhvbGRlcihuYW1lOiBzdHJpbmcsIGJvZHk6IHN0cmluZ3x1bmRlZmluZWQpOiB2b2lkO1xuICBzdGFydFBsYWNlaG9sZGVyKG5hbWU6IHN0cmluZyk6IHZvaWQ7XG4gIGNsb3NlUGxhY2Vob2xkZXIobmFtZTogc3RyaW5nKTogdm9pZDtcbiAgc3RhcnRDb250YWluZXIoKTogdm9pZDtcbiAgY2xvc2VDb250YWluZXIoKTogdm9pZDtcbiAgc3RhcnRJY3UoKTogdm9pZDtcbiAgZW5kSWN1KCk6IHZvaWQ7XG59XG4iXX0= |
@@ -16,5 +16,5 @@ /// <amd-module name="@angular/localize/src/tools/src/translate/translation_files/translation_parsers/simple_json_translation_parser" /> | ||
*/ | ||
export declare class SimpleJsonTranslationParser implements TranslationParser { | ||
canParse(filePath: string, _contents: string): boolean; | ||
parse(_filePath: string, contents: string): ParsedTranslationBundle; | ||
export declare class SimpleJsonTranslationParser implements TranslationParser<Object> { | ||
canParse(filePath: string, contents: string): Object | false; | ||
parse(_filePath: string, contents: string, json?: Object): ParsedTranslationBundle; | ||
} |
@@ -38,7 +38,16 @@ (function (factory) { | ||
} | ||
SimpleJsonTranslationParser.prototype.canParse = function (filePath, _contents) { | ||
return (path_1.extname(filePath) === '.json'); | ||
SimpleJsonTranslationParser.prototype.canParse = function (filePath, contents) { | ||
if (path_1.extname(filePath) !== '.json') { | ||
return false; | ||
} | ||
try { | ||
var json = JSON.parse(contents); | ||
return (typeof json.locale === 'string' && typeof json.translations === 'object') && json; | ||
} | ||
catch (_a) { | ||
return false; | ||
} | ||
}; | ||
SimpleJsonTranslationParser.prototype.parse = function (_filePath, contents) { | ||
var _a = JSON.parse(contents), parsedLocale = _a.locale, translations = _a.translations; | ||
SimpleJsonTranslationParser.prototype.parse = function (_filePath, contents, json) { | ||
var _a = json || JSON.parse(contents), parsedLocale = _a.locale, translations = _a.translations; | ||
var parsedTranslations = {}; | ||
@@ -55,2 +64,2 @@ for (var messageId in translations) { | ||
}); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2ltcGxlX2pzb25fdHJhbnNsYXRpb25fcGFyc2VyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvbG9jYWxpemUvc3JjL3Rvb2xzL3NyYy90cmFuc2xhdGUvdHJhbnNsYXRpb25fZmlsZXMvdHJhbnNsYXRpb25fcGFyc2Vycy9zaW1wbGVfanNvbl90cmFuc2xhdGlvbl9wYXJzZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7SUFBQTs7Ozs7O09BTUc7SU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uICB9XG59XG4iXX0= |
@@ -27,2 +27,52 @@ /** | ||
/** | ||
* The location of the message | ||
*/ | ||
export interface SourceLocation { | ||
start: { | ||
line: number; | ||
column: number; | ||
}; | ||
end: { | ||
line: number; | ||
column: number; | ||
}; | ||
file: string; | ||
} | ||
/** | ||
* Additional information that can be associated with a message. | ||
*/ | ||
export interface MessageMetadata { | ||
/** | ||
* A human readable rendering of the message | ||
*/ | ||
text: string; | ||
/** | ||
* A unique identifier for this message. | ||
*/ | ||
id?: MessageId; | ||
/** | ||
* Legacy message ids, if provided. | ||
* | ||
* In legacy message formats the message id can only be computed directly from the original | ||
* template source. | ||
* | ||
* Since this information is not available in `$localize` calls, the legacy message ids may be | ||
* attached by the compiler to the `$localize` metablock so it can be used if needed at the point | ||
* of translation if the translations are encoded using the legacy message id. | ||
*/ | ||
legacyIds?: string[]; | ||
/** | ||
* The meaning of the `message`, used to distinguish identical `messageString`s. | ||
*/ | ||
meaning?: string; | ||
/** | ||
* The description of the `message`, used to aid translation. | ||
*/ | ||
description?: string; | ||
/** | ||
* The location of the message in the source. | ||
*/ | ||
location?: SourceLocation; | ||
} | ||
/** | ||
* Information parsed from a `$localize` tagged string that is used to translate it. | ||
@@ -41,3 +91,3 @@ * | ||
* { | ||
* messageId: '6998194507597730591', | ||
* id: '6998194507597730591', | ||
* substitutions: { title: 'Jo Bloggs' }, | ||
@@ -48,18 +98,9 @@ * messageString: 'Hello {$title}!', | ||
*/ | ||
export interface ParsedMessage { | ||
export interface ParsedMessage extends MessageMetadata { | ||
/** | ||
* The key used to look up the appropriate translation target. | ||
*/ | ||
messageId: MessageId; | ||
/** | ||
* Legacy message ids, if provided. | ||
* | ||
* In legacy message formats the message id can only be computed directly from the original | ||
* template source. | ||
* | ||
* Since this information is not available in `$localize` calls, the legacy message ids may be | ||
* attached by the compiler to the `$localize` metablock so it can be used if needed at the point | ||
* of translation if the translations are encoded using the legacy message id. | ||
* In `ParsedMessage` this is a required field, whereas it is optional in `MessageMetadata`. | ||
*/ | ||
legacyIds: MessageId[]; | ||
id: MessageId; | ||
/** | ||
@@ -70,14 +111,2 @@ * A mapping of placeholder names to substitution values. | ||
/** | ||
* A human readable rendering of the message | ||
*/ | ||
messageString: string; | ||
/** | ||
* The meaning of the `message`, used to distinguish identical `messageString`s. | ||
*/ | ||
meaning: string; | ||
/** | ||
* The description of the `message`, used to aid translation. | ||
*/ | ||
description: string; | ||
/** | ||
* The static parts of the message. | ||
@@ -96,10 +125,3 @@ */ | ||
*/ | ||
export declare function parseMessage(messageParts: TemplateStringsArray, expressions?: readonly any[]): ParsedMessage; | ||
export interface MessageMetadata { | ||
text: string; | ||
meaning: string | undefined; | ||
description: string | undefined; | ||
id: string | undefined; | ||
legacyIds: string[]; | ||
} | ||
export declare function parseMessage(messageParts: TemplateStringsArray, expressions?: readonly any[], location?: SourceLocation): ParsedMessage; | ||
/** | ||
@@ -106,0 +128,0 @@ * Parse the given message part (`cooked` + `raw`) to extract the message metadata from the text. |
@@ -1,6 +0,6 @@ | ||
import { MessageId, ParsedMessage, TargetMessage } from './messages'; | ||
import { MessageId, MessageMetadata, ParsedMessage, TargetMessage } from './messages'; | ||
/** | ||
* A translation message that has been processed to extract the message parts and placeholders. | ||
*/ | ||
export interface ParsedTranslation { | ||
export interface ParsedTranslation extends MessageMetadata { | ||
messageParts: TemplateStringsArray; | ||
@@ -44,3 +44,3 @@ placeholderNames: string[]; | ||
*/ | ||
export declare function parseTranslation(message: TargetMessage): ParsedTranslation; | ||
export declare function parseTranslation(messageString: TargetMessage): ParsedTranslation; | ||
/** | ||
@@ -47,0 +47,0 @@ * Create a `ParsedTranslation` from a set of `messageParts` and `placeholderNames`. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
822072
6859