Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@translation/angular

Package Overview
Dependencies
Maintainers
3
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@translation/angular - npm Package Compare versions

Comparing version 1.4.0 to 1.5.0

10

CHANGELOG.md
# 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)

@@ -4,0 +14,0 @@

2

package.json
{
"name": "@translation/angular",
"version": "1.4.0",
"version": "1.5.0",
"description": "Translation.io client for Angular applications",

@@ -5,0 +5,0 @@ "repository": {

@@ -173,3 +173,3 @@ const Interpolation = require('../utils/interpolation')

} else if (xmlNode) {
return xmlNode['#text']
return xmlNode['#text'] || ''
} else {

@@ -176,0 +176,0 @@ return ''

@@ -59,5 +59,15 @@ const HtmlTagExtraction = require('./html-tag-extraction')

substitution = `{x1}`
} else if (this.includesAll(extraction, ['id="INTERPOLATION', 'equiv-text="{{', '}}"'])) { // {name}, {variable}, {count}
name = extraction.split('equiv-text="{{', 2)[1].split('}}"', 2)[0].trim()
substitution = `{${name}}`
} 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)) { // {variable}
substitution = `{${name}}`
} 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}}`
} else {
substitution = `{x1}`
}
}
} else if (this.includesAll(extraction, ['id="PH_', 'equiv-text='])) { // {x2}, {x3}, ... // Interpolations (placeholders) in components, using $localize

@@ -64,0 +74,0 @@ number = parseInt(extraction.split('id="PH_', 2)[1].split('"', 2)[0]) + 1

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc