@eliumhq/elium-i18n
Advanced tools
Comparing version 2.1.0 to 2.1.1
@@ -7,3 +7,3 @@ { | ||
"license": "UNLICENSED", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"engines": { | ||
@@ -35,3 +35,4 @@ "node": ">=9", | ||
"htmlclean": "^3.0.8", | ||
"i18next-conv": "^8.0.1" | ||
"i18next-conv": "^8.0.1", | ||
"lodash": "^4.17.11" | ||
}, | ||
@@ -38,0 +39,0 @@ "devDependencies": { |
@@ -100,10 +100,14 @@ const fs = require('fs') | ||
// TODO: We have to sort the keys first. | ||
const now = new Date() | ||
const data = po.compile({ | ||
charset: 'utf-8', | ||
headers: { | ||
charset: 'utf-8', | ||
'Charset': 'utf-8', | ||
'Project-Id-Version': 'Elium', | ||
'Report-Msgid-Bugs-To': 'dev@elium.com', | ||
'Content-Type': 'text/plain; charset=utf-8', | ||
'Content-Transfer-Encoding': '8bit' | ||
'Content-Type': 'text/plain; charset=UTF-8', | ||
'Content-Transfer-Encoding': '8bit', | ||
'Language': 'en', | ||
'POT-Creation-Date': `${now.getUTCFullYear()}-${now.getUTCMonth()}-${now.getUTCDate()} ${now.getUTCHours()}:${now.getUTCMinutes()} Z`, | ||
'MIME-Version': '1.0' | ||
}, | ||
@@ -110,0 +114,0 @@ translations |
@@ -28,1 +28,2 @@ const htmlclean = require('htmlclean') | ||
module.exports = node => walk([node]) | ||
module.exports.walk = walk |
const fs = require('fs') | ||
const jsxToText = require('./jsxToText') | ||
const nodeToString = require('./nodes-to-string') | ||
const { parse } = require('@babel/parser') | ||
@@ -43,2 +44,17 @@ const traverse = require('@babel/traverse').default | ||
const getTransMessage = (node, file) => { | ||
const { attributes } = node.openingElement | ||
const contextAttr = attributes.find(a => a.name.name === 'context') | ||
const domainAttr = attributes.find(a => a.name.name === 'domain') | ||
const message = { | ||
value: nodeToString(node.children), | ||
context: contextAttr ? contextAttr.value.value : null, | ||
location: { file, ...node.openingElement.loc.start }, | ||
domain: domainAttr ? domainAttr.value.value : null | ||
} | ||
return message | ||
} | ||
function* processCall(node, file) { | ||
@@ -76,2 +92,5 @@ const funcName = getCalleeName(node) | ||
yield singular | ||
} else if (identifierName === 'Trans') { | ||
const message = getTransMessage(node, file) | ||
yield message | ||
} | ||
@@ -78,0 +97,0 @@ } |
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
19219
12
431
8
+ Addedlodash@^4.17.11
+ Addedlodash@4.17.21(transitive)