feat(i18n): add support for custom placeholder names#8010
feat(i18n): add support for custom placeholder names#8010kara wants to merge 1 commit intoangular:masterfrom
Conversation
There was a problem hiding this comment.
Not sure if we care. Do we want to allow // i18n ( ph = "second" )?
There was a problem hiding this comment.
I suppose we do. Probably would be less confusing for people. I'll update and add a test.
f74c3a2 to
47b508e
Compare
modules/angular2/src/i18n/shared.ts
Outdated
There was a problem hiding this comment.
This is a nitpick, so feel free to ignore it. It's better avoid reassigning parameters. It adds unnecessary mutability. It's harder to follow the flow of the computation. In this case it doesn't matter that much, but it may matter in other cases.
export function dedupePhName(usedNames: Map<string, number>, name: string): string {
let duplicateNameCount = usedNames.get(name);
if (isPresent(duplicateNameCount)) {
usedNames.set(name, duplicateNameCount + 1);
return `${name}_${duplicateNameCount}`;
} else {
usedNames.set(name, 1);
return name;
}
}
There was a problem hiding this comment.
Ha! That's how I had it originally. I'll change it.
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
No description provided.