Skip to content

Commit

Permalink
Bump version to 1.5.0 + Changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelHoste committed Jan 13, 2023
1 parent e22748b commit 39a73fa
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## [v1.5.0](https://github.com/translation/angular/releases/tag/v1.5.0) (2023-01-13)

#### New features:

* Improve substitution for interpolations with complex expressions like `user.birthday | date:\'dd/MM/y\'`.

#### Fixes (bugs & defects):

* Better node parsing if no `<source>` or `<target>` is found.

## [v1.4.0](https://github.com/translation/angular/releases/tag/v1.4.0) (2023-01-12)

#### New features:
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@translation/angular",
"version": "1.4.0",
"version": "1.5.0",
"description": "Translation.io client for Angular applications",
"repository": {
"type": "git",
Expand Down
6 changes: 3 additions & 3 deletions src/utils/interpolation.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ class Interpolation {
substitution = `{x${number}}`
} else if (extraction.includes('id="INTERPOLATION"') && ! extraction.includes('equiv-text=')) { // {x1} - May be converted later to {x} if only 1
substitution = `{x1}`
} else if (this.includesAll(extraction, ['id="INTERPOLATION', 'equiv-text="{{', '}}"'])) { // {name}, {variable}, {count}
} else if (this.includesAll(extraction, ['id="INTERPOLATION', 'equiv-text="{{', '}}"'])) { // {variable} or {complex | expression}
name = extraction.split('equiv-text="{{', 2)[1].split('}}"', 2)[0].trim()

if (/^[a-zA-Z_$][a-zA-Z_$0-9]*$/.test(name)) {
if (/^[a-zA-Z_$][a-zA-Z_$0-9]*$/.test(name)) { // {variable}
substitution = `{${name}}`
} else {
} else { // {complex | expression} transformed as {x}
if (extraction.includes('id="INTERPOLATION_')) {
number = parseInt(extraction.split('id="INTERPOLATION_', 2)[1].split('"', 2)[0]) + 1
substitution = `{x${number}}`
Expand Down

0 comments on commit 39a73fa

Please sign in to comment.