feat(compiler): digest methods return i18nMessage id if sets

This commit is contained in:
maxime-allex 2016-12-06 15:01:43 +01:00 committed by Victor Berchet
parent 6dd5201765
commit 562f7a2f8b
1 changed files with 2 additions and 2 deletions

View File

@ -9,13 +9,13 @@
import * as i18n from './i18n_ast';
export function digest(message: i18n.Message): string {
return sha1(serializeNodes(message.nodes).join('') + `[${message.meaning}]`);
return message.id || sha1(serializeNodes(message.nodes).join('') + `[${message.meaning}]`);
}
export function decimalDigest(message: i18n.Message): string {
const visitor = new _SerializerIgnoreIcuExpVisitor();
const parts = message.nodes.map(a => a.visit(visitor, null));
return computeMsgId(parts.join(''), message.meaning);
return message.id || computeMsgId(parts.join(''), message.meaning);
}
/**