Skip to content

Commit

Permalink
Organizing i18n values in frontend (#30)
Browse files Browse the repository at this point in the history
* Rewrite i18n values for external pages and dashsboard screen

* Adjusting i18 values in repositories screen

* 🛠️  Adjusting redirect routes when the call is external of manager (#19)

* Hotfix/fixing redirect and output bigger (#21)

* Fixing redirect in email template reset-password

* Fixing code output when exists many content and bad read

* Fixing fmt and set total output to down

* Hotfix/unique names (#28)

* Adding unique names migration

* Adding validations to unique names and unity tests

* Fixing swagger in horusec-analytics (#27)

* Add i18n values to enUS

Co-authored-by: Wilian Gabriel <63816070+wiliansilvazup@users.noreply.github.com>
Co-authored-by: nathanmartinszup <63246935+nathanmartinszup@users.noreply.github.com>
  • Loading branch information
3 people authored Oct 1, 2020
1 parent fa917ce commit 2fcba06
Show file tree
Hide file tree
Showing 32 changed files with 566 additions and 399 deletions.
2 changes: 1 addition & 1 deletion horusec-manager/src/components/Dialog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const Dialog: React.FC<DialogProps> = ({
<Styled.ButtonsWrapper>
{hasCancel ? (
<Button
text={t('CANCEL')}
text={t('GENERAL.CANCEL')}
width={105}
height={35}
rounded={!defaultButton}
Expand Down
2 changes: 1 addition & 1 deletion horusec-manager/src/components/Select/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const Select: React.FC<Props> = ({
width={width}
>
<Styled.CurrentValue>
{currentValue ? currentValue[keyLabel] : t('SELECT')}
{currentValue ? currentValue[keyLabel] : t('GENERAL.SELECT')}
</Styled.CurrentValue>

<Styled.OptionsList
Expand Down
10 changes: 5 additions & 5 deletions horusec-manager/src/components/SideMenu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,34 +33,34 @@ const SideMenu: React.FC = () => {

const routes: InternalRoute[] = [
{
name: t('DASHBOARD'),
name: t('SIDE_MENU.DASHBOARD'),
icon: 'list',
type: 'route',
path: '/home/dashboard',
subRoutes: [
{
name: t('ORGANIZATION'),
name: t('SIDE_MENU.ORGANIZATION'),
icon: 'grid',
path: '/home/dashboard/organization',
type: 'subRoute',
adminOnly: true,
},
{
name: t('REPOSITORIES'),
name: t('SIDE_MENU.REPOSITORIES'),
icon: 'columns',
path: '/home/dashboard/repositories',
type: 'subRoute',
},
],
},
{
name: t('REPOSITORIES'),
name: t('SIDE_MENU.REPOSITORIES'),
icon: 'columns',
path: '/home/repositories',
type: 'route',
},
{
name: t('ORGANIZATION_USERS'),
name: t('SIDE_MENU.ORGANIZATION_USERS'),
icon: 'grid',
path: '/home/organization-users',
type: 'route',
Expand Down
280 changes: 167 additions & 113 deletions horusec-manager/src/config/i18n/enUS.json
Original file line number Diff line number Diff line change
@@ -1,114 +1,158 @@
{
"EMAIL": "E-mail",
"PASSWORD": "Password",
"FORGOT_PASS": "Forgot password?",
"LOGIN": "Log in",
"NO_ACCOUNT": "Don't have an account? Register",
"INVALID_EMAIL": "Invalid email",
"CONFIRM_PASS": "Confirm password",
"NAME": "Name",
"REGISTER": "Register",
"BACK_LOGIN": "Back to login",
"CREATE_ACCOUNT": "Create your Horusec account",
"RECOVERY_PASS": "For your security, enter the email registered to reset your password",
"SEND_CODE_EMAIL": "Send code to email",
"TYPE_THE_CODE": "Enter the code entered in your registered email. The code is valid for 10 minutes and must be used 1x.",
"CHECK_CODE": "Check code",
"CODE": "Code",
"CREATE_NEW_PASS": "Create your new password:",
"UPDATE_PASS": "Update password",
"NEXT": "Next",
"PASSWORD_REQUIREMENTS": "For your security, the password must contain at least:",
"MIN_CHARACTERS": "From 8 characters",
"ALPHA_REQUIREMENTS": "1 capital letter and 1 lowercase letter",
"NO_EQUALS": "It cannot be the same:",
"USER_NAME": "User name",
"NUMBER_REQUIREMENT": "1 number",
"INVALID_CODE": "Invalid Code",
"INVALID_PASS": "Invalid Password",
"INVALID_NAME": "invalid Name",
"INVALID_CONFIRM_PASS": "Passwords are not the same.",
"SPECIAL_CHARACTER": "1 character special ( !@#$*_.-)",
"ERROR_LOGIN": "Check your email and password and try again.",
"UNCONFIRMED_EMAIL": "The email has not yet been confirmed.",
"GENERIC_ERROR": "Something unexpected happened, try again.",
"INVALID_RECOVERY_CODE": "Invalid recovery code.",
"CANCEL": "Cancel",
"YES": "Sim",
"SAVE": "Save",
"CONFIRM": "Okay, all right.",
"SUCCESS_SEND_EMAIL": "A password recovery code has been sent to your email.",
"SUCCESS_CREATE_ACCOUNT": "An email has been sent to verify your account.",
"EMAIL_IN_USE": "The informed email is already in use.",
"SUCCESS_ALTER_PASS": "Your password has been changed successfully.",
"SELECT_ORGANIZATION": "Select a organization",
"ADD_ORGANIZATION": "Add a organization",
"NO_ORGANIZATIONS": "No organizations found",
"EDIT": "Edit",
"REMOVE": "Delete",
"TYPE_ORGANIZATION_NAME": "Enter the organization name below:",
"ORGANIZATION_NAME": "Organization name",
"INVALID_ORGANIZATION_NAME": "Invalid organization name",
"EDIT_ORGANIZATION_NAME": "Edit your organization name",
"CONFIRM_DELETE_ORGANIZATION": "Do you really want to delete the organization ",
"DASHBOARD": "Dashboard",
"REPOSITORIES": "Repositories",
"REPOSITORY": "Repository",
"ORGANIZATION_USERS": "Organization users",
"ORGANIZATION": "Organization",
"START_DATE": "Start date",
"FINAL_DATE": "Final date",
"APPLY": "Apply",
"TOTAL_DEVELOPERS": "Total developers",
"TOTAL_REPOSITORIES": "Total repositories",
"SELECT": "Select",
"ALL_VULNERABILITIES": "All vulnerabilities",
"CHART_NO_DATA": "No data for the selected period",
"VULNERABILITIES_BY_DEV": "Vulnerabilities by developer",
"VULNERABILITIES_BY_LANG": "Vulnerabilities by language",
"VULNERABILITIES_BY_REPO": "Vulnerabilities by repository",
"VULNERABILITY_TIMELINE": "Vulnerability timeline",
"VULNERABILITY_DETAILS": "Vulnerability details",
"LANGUAGE": "Language",
"SEVERITY": "Severiry",
"AUTHOR": "Author",
"DESCRIPTION": "Description",
"FILE": "File",
"LINE": "Line",
"NEXT_PAGE": "Next",
"PREVIOUS_PAGE": "Previous",
"SEARCH_REPO": "Search repositories by name",
"CREATE_REPO": "Create repository",
"ACTION": "Action",
"DELETE": "Delete",
"INVITE": "Invite",
"TOKENS": "Tokens",
"NO_REPOSITORIES": "There are no corresponding repositories for this company.",
"CREATE_NEW_REPO": "Create a new repository below:",
"NAME_REPO": "Repository name",
"DESCRIPTION_REPO": "Repository description",
"CONFIRM_DELETE_REPO": "Do you really want to delete the repository? This action cannot be undone.",
"EDIT_REPO": "Edit repository",
"EDIT_REPO_BELOW": "Edit the repository below:",
"ADD_TOKEN": "Add token",
"EXPIRES": "Expires in:",
"TOKEN": "Token",
"NO_TOKENS": "There are no registered tokens for this repository.",
"CONFIRM_DELETE_TOKEN": "Do you really want to delete the token? This action cannot be undone.",
"CREATE_NEW_TOKEN": "Add new token",
"CREATE_TOKEN_BELOW": "Enter the description for the new token:",
"INVALID_DESCRIPTION": "Invalid description",
"TOKEN_SUCCESS": "Token created successfully!",
"TOKEN_INFO": "This token grants you access to perform analyzes for the selected repository! Save him somewhere safe and don't share!",
"INVITE_TO_REPOSITORY": "Invite to repository",
"INVITE_USER_BELOW": "Invite a user to the repository below:",
"SEARCH_USER_EMAIL_BELOW": "Search for user by email",
"PERMISSION": "Permission",
"USER": "User",
"NO_USERS_TO_INVITE": "There are no matching users to be invited.",
"MEMBER": "Member",
"ADMIN": "Administrator",
"LOGIN_SCREEN": {
"EMAIL": "Email",
"PASSWORD": "Password",
"FORGOT_PASS": "Forgot password?",
"SUBMIT": "Log in",
"NO_ACCOUNT": "Don't have an account? Register",
"INVALID_EMAIL": "Invalid email",
"INVALID_PASS": "Enter password"
},

"RECOVERY_PASS_SCREEN": {
"INPUT_EMAIL": "For your security, enter the registered email to reset your password",
"EMAIL": "Email",
"CODE": "Code",
"INVALID_EMAIL": "Invalid email",
"INVALID_CODE": "Enter a code",
"CHECK_CODE": "Check code",
"SUBMIT": "Send code to email",
"BACK": "Back to login",
"SUCCESS": "A password recovery code has been sent to your email.",
"CONFIRM": "Ok, I got it.",
"TYPE_THE_CODE": "Enter the code entered in your registered email. The code is valid for 10 minutes and must be used 1x.",
"CREATE_NEW_PASS": "Create your new password:",
"PASSWORD_REQUIREMENTS": "For your security, the password must contain at least:",
"MIN_CHARACTERS": "From 8 characters",
"ALPHA_REQUIREMENTS": "1 uppercase and 1 lowercase letter",
"NUMBER_REQUIREMENT": "1 number",
"SPECIAL_CHARACTER": "1 special character (!@#$*_.-)",
"NO_EQUALS": "It can't be the same:",
"USER_NAME": "User",
"PASSWORD": "Password",
"INVALID_PASS": "Enter password",
"CONFIRM_PASS": "Confirm password",
"INVALID_CONFIRM_PASS": "Passwords are not the same.",
"SUCCESS_ALTER_PASS": "Your password has been changed successfully",
"UPDATE_PASS": "Update password",
"INVALID_RECOVERY_CODE": "Invalid recovery code."
},

"CREATE_ACCOUNT_SCREEN": {
"CREATE_ACCOUNT": "Create your Horusec account",
"EMAIL": "Email",
"NAME": "Name",
"NEXT": "Next",
"BACK": "Back to login",
"INVALID_NAME": "Enter the name",
"INVALID_EMAIL": "Invalid email",
"CREATE_NEW_PASS": "Create your new password:",
"PASSWORD_REQUIREMENTS": "For your security, the password must contain at least:",
"MIN_CHARACTERS": "From 8 characters",
"ALPHA_REQUIREMENTS": "1 uppercase and 1 lowercase letter",
"NUMBER_REQUIREMENT": "1 number",
"SPECIAL_CHARACTER": "1 special character (!@#$*_.-)",
"NO_EQUALS": "It cannot be the same:",
"USER_NAME": "User",
"PASSWORD": "Password",
"INVALID_PASS": "Enter password",
"CONFIRM_PASS": "Confirm password",
"INVALID_CONFIRM_PASS": "Passwords are not the same.",
"SUBMIT": "Register",
"CONFIRM": "Ok, I got it.",
"SUCCESS_CREATE_ACCOUNT": "An email has been sent to verify your account."
},

"COMPANY_SCREEN": {
"SELECT_ORGANIZATION": "Select an organization",
"ADD_ORGANIZATION": "Add an organization",
"NO_ORGANIZATIONS": "No organization found",
"YES": "Sim",
"CONFIRM_DELETE_ORGANIZATION": "Do you really want to delete the organization ",
"EDIT": "Edit",
"REMOVE": "Delete",
"TYPE_ORGANIZATION_NAME": "Enter the name of the organization below:",
"ORGANIZATION_NAME": "Organization name",
"INVALID_ORGANIZATION_NAME": "Invalid organization name.",
"CANCEL": "Cancel",
"SAVE": "Save",
"EDIT_ORGANIZATION_NAME": "Edit the organization name"
},

"DASHBOARD_SCREEN": {
"START_DATE": "Start date",
"FINAL_DATE": "Final date",
"APPLY": "Apply",
"TOTAL_DEVELOPERS": "Total developers",
"TOTAL_REPOSITORIES": "Total repositories",
"ALL_VULNERABILITIES": "All vulnerabilities",
"REPOSITORY": "Repository",
"CHART_NO_DATA": "No data for the selected period",
"VULNERABILITIES_BY_LANG": "Language vulnerabilities",
"VULNERABILITIES_BY_DEV": "Vulnerabilities by developer",
"VULNERABILITIES_BY_REPO": "Vulnerabilities by repository",
"VULNERABILITY_TIMELINE": "Vulnerability timeline",
"VULNERABILITY_DETAILS": "Vulnerability details",
"LANGUAGE": "Language",
"SEVERITY": "Severity",
"AUTHOR": "Author",
"DESCRIPTION": "Description",
"FILE": "Archive",
"LINE": "Line",
"NEXT_PAGE": "Next",
"PREVIOUS_PAGE": "Previous",
"CODE": "Code"
},

"REPOSITORIES_SCREEN": {
"SEARCH_REPO": "Search repositories by name",
"CREATE_REPO": "Create repository",
"TITLE": "Repositories",
"NAME": "Name",
"DESCRIPTION": "Description",
"ACTION": "Action",
"NO_REPOSITORIES": "There are no corresponding repositories for this organization.",
"DELETE": "Delete",
"EDIT": "Edit",
"INVITE": "Invite",
"TOKENS": "Tokens",
"CONFIRM_DELETE_REPO": "Do you really want to delete the repository? This action cannot be undone.",
"YES": "Yes",
"CREATE_NEW_REPO": "Create a new repository below:",
"NAME_REPO": "Repository name",
"INVALID_NAME": "Enter the name",
"DESCRIPTION_REPO": "Repository description",
"SAVE": "Save",
"EDIT_REPO": "Edit repository",
"EDIT_REPO_BELOW": "Edit the repository below:",
"INVITE_TO_REPOSITORY": "Invite to the repository",
"INVITE_USER_BELOW": "Invite a user to the repository below:",
"SEARCH_USER_EMAIL_BELOW": "Search for user by email",
"USER": "User",
"EMAIL": "Email",
"PERMISSION": "Permission",
"NO_USERS_TO_INVITE": "There are no matching users to be invited.",
"ADD_TOKEN": "Add Token",
"TOKEN": "Token",
"NO_TOKENS": "There are no registered tokens for this repository.",
"EXPIRES": "Expires in:",
"CONFIRM_DELETE_TOKEN": "Do you really want to delete this token? This action cannot be undone.",
"CREATE_NEW_TOKEN": "Add new token",
"INVALID_DESCRIPTION": "Invalid description",
"CREATE_TOKEN_BELOW": "Enter the description for the new token:",
"TOKEN_INFO": "This token grants you access to perform analyzes for the selected repository! Save it in a safe place and don't share it!",
"TOKEN_SUCCESS": "Token created successfully!",
"CONFIRM": "Ok, I got it."
},

"GENERAL": {
"SELECT": "Select",
"CANCEL": "Cancel"
},

"PERMISSIONS": {
"ADMIN": "Administrator",
"MEMBER": "Member",
"TITLE": "Permissions",
"REPOSITORY": {
"ADMIN": "Administrator permissions allow you to perform on the repository:",
Expand All @@ -131,22 +175,23 @@
}
}
},

"USERS_SCREEN": {
"TITLE": "Users",
"SEARCH": "Search by email",
"INVITE": "Invite User",
"EDIT_USER": "Edit User",
"EDIT_SUBTITLE": "Edit the user below:",
"INVITE_SUBTITLE": "Invite a new user below:",
"EMAIL": "E-mail",
"EMAIL": "Email",
"INVALID_EMAIL": "Invalid email",
"CONFIRM_DELETE": "Do you really want to delete this user? This action cannot be undone.",
"YES": "Yes",
"SAVE": "Save",
"TABLE": {
"EMPTY": "There are no matching users for this organization",
"USER": "User",
"EMAIL": "E-mail",
"EMAIL": "Email",
"PERMISSION": "Permission",
"ACTION": "Action",
"DELETE": "Delete",
Expand All @@ -157,12 +202,21 @@
}
}
},

"SIDE_MENU": {
"DASHBOARD": "Dashboard",
"REPOSITORIES": "Repositories",
"ORGANIZATION": "Organization",
"REPOSITORY": "Repository",
"ORGANIZATION_USERS": "Organization users"
},

"API_ERRORS": {
"GENERIC_ERROR": "Something unexpected happened, try again.",
"ERROR_LOGIN": "Check your email and password and try again.",
"UNCONFIRMED_EMAIL":"The email has not yet been confirmed.",
"UNCONFIRMED_EMAIL": "The email has not yet been confirmed.",
"INVALID_RECOVERY_CODE": "Invalid recovery code.",
"EMAIL_IN_USE":"The informed email is already in use.",
"EMAIL_IN_USE": "The informed email is already in use.",
"NO_RECORDS": "There are no corresponding records for the reported data.",
"ALREADY_IN_COMPANY": "This user is already part of this organization."
}
Expand Down
Loading

0 comments on commit 2fcba06

Please sign in to comment.