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

i18n feedback refactorings #2597

Merged
merged 66 commits into from
Jan 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
8ac30b1
:zap: Create endpoint for node credential translation
ivov Dec 22, 2021
4d631a4
:zap: Add API helper method in FE
ivov Dec 22, 2021
f629e63
:hammer: Add creds JSON files to tsconfig
ivov Dec 22, 2021
74aacd4
:zap: Refactor credentials loading
ivov Dec 22, 2021
b0da477
:zap: Refactor calls in CredentialConfig
ivov Dec 22, 2021
0b2afd8
:pencil2: Add dummy translations
ivov Dec 22, 2021
70c0aa4
:zap: Split translations per node
ivov Dec 22, 2021
788bf91
:fire: Remove deprecated method
ivov Dec 22, 2021
86149db
:zap: Refactor nesting in collections
ivov Dec 23, 2021
8072ea7
:truck: Rename topParameter methods for accuracy
ivov Dec 23, 2021
6a694ad
:pencil2: Fill out GitHub dummy cred
ivov Dec 23, 2021
2bbad0d
:truck: Clarify naming for collection utils
ivov Dec 23, 2021
441fff3
:pencil2: Fill out dummy translation
ivov Dec 23, 2021
74aee7c
:fire: Remove surplus colons
ivov Dec 23, 2021
5045990
:fire: Remove logging
ivov Dec 23, 2021
e24ff36
:zap: Restore missing space
ivov Dec 23, 2021
aadd90a
:fire: Remove lingering colon
ivov Dec 23, 2021
e45aef7
:zap: Add path to InputLabel calls
ivov Dec 23, 2021
fab59af
:pencil2: Fill out dummy translations
ivov Dec 28, 2021
b9ebc70
:bug: Fix multipleValuesButtonText logic
ivov Dec 28, 2021
e45c004
:zap: Add sample properties to be deleted
ivov Dec 28, 2021
a4979e7
:zap: Render deeply nested params
ivov Dec 28, 2021
4d92d8b
:package: Update package-lock.json
ivov Dec 28, 2021
5096fc7
:twisted_rightwards_arrows: Merge master
ivov Dec 28, 2021
66e0bdb
:fire: remove logging
ivov Dec 28, 2021
9738e79
:pencil2: Add dummy value to Slack translation
ivov Dec 28, 2021
b2d9210
:pencil2: Add placeholder to dummy translation
ivov Dec 28, 2021
2c6f9cd
:zap: Fix placeholder rendering for button text
ivov Dec 28, 2021
16d8fd1
:shirt: Fix lint
ivov Dec 28, 2021
23b0695
:fire: Remove outdated comment
ivov Dec 28, 2021
3f9ee3c
:bug: Pass in missing arg for placeholder
ivov Dec 28, 2021
df85f8e
:pencil2: Fill out Slack translation
ivov Dec 28, 2021
fcabed6
:zap: Add explanatory comment
ivov Dec 28, 2021
d6bcb90
:pencil2: Fill out dummy translation
ivov Dec 28, 2021
293f6ab
:pencil2: Update documentation
ivov Dec 28, 2021
a54aa5b
:fire: Remove broken link
ivov Dec 28, 2021
db08cca
:pencil2: Add pending functionality
ivov Dec 28, 2021
49db3f7
:pencil2: Fix indentation
ivov Dec 28, 2021
3d0619a
:bug: Fix method call in CredentialEdit
ivov Dec 28, 2021
e34e1b8
:zap: Implement eventTriggerDescription
ivov Dec 28, 2021
a986b38
:bug: Fix table-json-binary radio buttons
ivov Dec 29, 2021
c7d46d3
:pencil2: Clarify usage of eventTriggerDescription
ivov Dec 29, 2021
2756f79
:fire: Remove unneeded arg
ivov Dec 29, 2021
4f66f42
:bug: Fix display in CodeEdit and TextEdit
ivov Dec 29, 2021
c52f770
:fire: Remove logging
ivov Dec 29, 2021
65fbf03
:pencil2: Add translation for test cred options
ivov Dec 29, 2021
f4600b0
:pencil2: Add test for separate file in same dir
ivov Dec 29, 2021
7809f63
:pencil2: Add test for versioned node
ivov Dec 29, 2021
1c1f5d2
:pencil2: Add test for node in grouped dir
ivov Dec 29, 2021
7ce9ce5
:pencil2: Add minor clarifications
ivov Dec 29, 2021
c208004
:pencil2: Add nested collection test
ivov Dec 29, 2021
ed2028e
:pencil2: Add pending functionality
ivov Dec 29, 2021
c994d4a
:zap: Generalize collections handling
ivov Dec 29, 2021
73c16ff
:truck: Rename helper to remove redundancy
ivov Dec 29, 2021
5cfbff6
:truck: Improve naming in helpers
ivov Dec 29, 2021
6d5d185
:pencil2: Improve helpers documentation
ivov Dec 29, 2021
a19c517
:pencil2: Improve i18n methods documentation
ivov Dec 29, 2021
e507b32
:truck: Make endpoint naming consistent
ivov Dec 29, 2021
fe2e609
:pencil2: Add final newlines
ivov Dec 29, 2021
a0bdc4d
:pencil2: Clean up JSON examples
ivov Dec 29, 2021
83173b9
:zap: Reuse i18n method
ivov Dec 29, 2021
487294c
:zap: Improve utils readability
ivov Dec 29, 2021
7c5275c
:twisted_rightwards_arrows: Merge master
ivov Jan 3, 2022
7422e75
:twisted_rightwards_arrows: Merge master
ivov Jan 7, 2022
9b513a0
:zap: Return early if cred translation exists
ivov Jan 7, 2022
a023f25
:fire: Remove dummy translations
ivov Jan 7, 2022
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
236 changes: 118 additions & 118 deletions package-lock.json

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

31 changes: 28 additions & 3 deletions packages/cli/src/Server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ import { InternalHooksManager } from './InternalHooksManager';
import { TagEntity } from './databases/entities/TagEntity';
import { WorkflowEntity } from './databases/entities/WorkflowEntity';
import { NameRequest } from './WorkflowHelpers';
import { getNodeTranslationPath } from './TranslationHelpers';
import { getCredentialTranslationPath, getNodeTranslationPath } from './TranslationHelpers';

require('body-parser-xml')(bodyParser);

Expand Down Expand Up @@ -1178,6 +1178,27 @@ class App {
),
);

this.app.get(
`/${this.restEndpoint}/credential-translation`,
ResponseHelper.send(
async (
req: express.Request & { query: { credentialType: string } },
res: express.Response,
): Promise<object | null> => {
const translationPath = getCredentialTranslationPath({
locale: this.frontendSettings.defaultLocale,
credentialType: req.query.credentialType,
});

try {
return require(translationPath);
} catch (error) {
return null;
}
},
),
);

// Returns node information based on node names and versions
this.app.post(
`/${this.restEndpoint}/node-types`,
Expand All @@ -1201,13 +1222,17 @@ class App {
nodeTypes: INodeTypeDescription[],
) {
const { description, sourcePath } = NodeTypes().getWithSourcePath(name, version);
const translationPath = await getNodeTranslationPath(sourcePath, defaultLocale);
const translationPath = await getNodeTranslationPath({
nodeSourcePath: sourcePath,
longNodeType: description.name,
locale: defaultLocale,
});

try {
const translation = await readFile(translationPath, 'utf8');
description.translation = JSON.parse(translation);
} catch (error) {
// ignore - no translation at expected translation path
// ignore - no translation exists at path
}

nodeTypes.push(description);
Expand Down
Loading