Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Push neo4j-arc i18n resources down into lib #36

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 2 additions & 17 deletions src/browser/i18n.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,8 @@
import i18n from 'i18next'
import { i18nResource } from 'neo4j-arc'
import { initReactI18next } from 'react-i18next'

const resources = {
en: {
translation: {
'graph summary':
'Displaying {{nodeCount}} nodes, {{relationshipCount}} relationships.',
'Relationship types': 'Relationship types',
'Node labels': 'Node labels'
}
},
zh: {
translation: {
'graph summary': '总计 {{nodeCount}} 个节点, {{relationshipCount}} 条边.',
'Relationship types': '关系类型',
'Node labels': '节点类型'
}
}
}
const resources = i18nResource

i18n.use(initReactI18next).init({
resources,
Expand Down
16 changes: 16 additions & 0 deletions src/neo4j-arc/i18n.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"en": {
"translation": {
"graph summary": "Displaying {{nodeCount}} nodes, {{relationshipCount}} relationships.",
"Relationship types": "Relationship types",
"Node labels": "Node labels"
}
},
"zh": {
"translation": {
"graph summary": "总计 {{nodeCount}} 个节点, {{relationshipCount}} 条边。",
"Relationship types": "关系类型",
"Node labels": "节点类型"
}
}
}
1 change: 1 addition & 0 deletions src/neo4j-arc/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from './common'
export * from './graph-visualization'
export * from './cypher-language-support'
export { default as i18nResource } from './i18n.json'
1 change: 1 addition & 0 deletions src/neo4j-arc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
],
"devDependencies": {
"@rollup/plugin-alias": "^3.1.9",
"@rollup/plugin-json": "^6.0.1",
"@types/react": "^17.0.40",
"esbuild": "^0.14.26",
"neo4j-driver-core": "5.9.2",
Expand Down
9 changes: 7 additions & 2 deletions src/neo4j-arc/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import dts from 'rollup-plugin-dts'
import esbuild from 'rollup-plugin-esbuild'
import alias from '@rollup/plugin-alias'
import pkg from './package.json'
import json from '@rollup/plugin-json'

const importsWithPaths = [
'monaco-editor/esm/vs/base/parts/quickinput/browser/quickInputList',
Expand All @@ -24,7 +25,11 @@ export default [
{
input: 'index.ts',
external: id => dependenciesNotToBundle.includes(id),
plugins: [/* handles ts */ esbuild(), alias({ entries: aliasEntries })],
plugins: [
/* handles ts */ esbuild(),
alias({ entries: aliasEntries }),
json()
],
output: [
{
file: pkg.main,
Expand All @@ -36,7 +41,7 @@ export default [
// Build types
{
input: 'index.ts',
plugins: [dts(), alias({ entries: aliasEntries })],
plugins: [dts(), alias({ entries: aliasEntries }), json()],
output: {
file: pkg.typings,
format: 'es'
Expand Down
2 changes: 2 additions & 0 deletions src/neo4j-arc/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"skipLibCheck": true,
"allowSyntheticDefaultImports": true,
"moduleResolution": "node",
"esModuleInterop": true,
"resolveJsonModule": true,
"paths": {
"neo4j-arc/common": ["./common/index.ts"]
}
Expand Down
25 changes: 23 additions & 2 deletions src/neo4j-arc/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,13 @@
dependencies:
slash "^3.0.0"

"@rollup/plugin-json@^6.0.1":
version "6.0.1"
resolved "https://registry.yarnpkg.com/@rollup/plugin-json/-/plugin-json-6.0.1.tgz#7e2efcf5ed549963f1444e010611d22f463931c0"
integrity sha512-RgVfl5hWMkxN1h/uZj8FVESvPuBJ/uf6ly6GTj0GONnkfoBN5KC0MSz+PN2OLDgYXMhtG0mWpTrkiOjoxAIevw==
dependencies:
"@rollup/pluginutils" "^5.0.1"

"@rollup/pluginutils@^4.1.1":
version "4.2.0"
resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-4.2.0.tgz#a14bbd058fdbba0a5647143b16ed0d86fb60bd08"
Expand All @@ -234,6 +241,15 @@
estree-walker "^2.0.1"
picomatch "^2.2.2"

"@rollup/pluginutils@^5.0.1":
version "5.0.5"
resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-5.0.5.tgz#bbb4c175e19ebfeeb8c132c2eea0ecb89941a66c"
integrity sha512-6aEYR910NyP73oHiJglti74iRyOwgFU4x3meH/H8OJx6Ry0j6cOVZ5X/wTvub7G7Ao6qaHBEaNsV3GLJkSsF+Q==
dependencies:
"@types/estree" "^1.0.0"
estree-walker "^2.0.2"
picomatch "^2.3.1"

"@types/chroma-js@2.1.4":
version "2.1.4"
resolved "https://registry.yarnpkg.com/@types/chroma-js/-/chroma-js-2.1.4.tgz#52e3a8453000cdb9ad76357c2c47dbed702d136f"
Expand Down Expand Up @@ -312,6 +328,11 @@
"@types/d3-interpolate" "*"
"@types/d3-selection" "*"

"@types/estree@^1.0.0":
version "1.0.5"
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.5.tgz#a6ce3e556e00fd9895dd872dd172ad0d4bd687f4"
integrity sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==

"@types/hoist-non-react-statics@*":
version "3.3.1"
resolved "https://registry.yarnpkg.com/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz#1124aafe5118cb591977aeb1ceaaed1070eb039f"
Expand Down Expand Up @@ -711,7 +732,7 @@ escape-string-regexp@^1.0.5:
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=

estree-walker@^2.0.1:
estree-walker@^2.0.1, estree-walker@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-2.0.2.tgz#52f010178c2a4c117a7757cfe942adb7d2da4cac"
integrity sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==
Expand Down Expand Up @@ -836,7 +857,7 @@ object-assign@^4.1.1:
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=

picomatch@^2.2.2, picomatch@^2.3.0:
picomatch@^2.2.2, picomatch@^2.3.0, picomatch@^2.3.1:
version "2.3.1"
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42"
integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==
Expand Down
Loading