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

add support from localization based on browser and languages #805

Merged
merged 11 commits into from
Apr 12, 2024

Conversation

fnxpt
Copy link
Contributor

@fnxpt fnxpt commented Apr 5, 2024

Description

  • Add support for i18n based on browser
  • Sorted EN file
  • Added missing strings to EN file
  • Removed unused strings from EN file
  • Removed md5/sha strings from messages and moved them to hashes
  • Added auto translation for de
  • Added auto translation for es
  • Added auto translation for fr
  • Added auto translation for hi
  • Added auto translation for it
  • Added auto translation for ja
  • Added auto translation for pl
  • Added auto translation for pt
  • Added auto translation for pt-BR
  • Added auto translation for ru
  • Added auto translation for zh

strings added missing:

│          'admin.team_created'           │ './src/views/administration/accessmanagement/CreateTeamModal.vue' │  57  │
│       'admin.oidc_group_deleted'        │   './src/views/administration/accessmanagement/OidcGroups.vue'    │ 152  │
│         'condition.successful'          │    './src/views/administration/mixins/configPropertyMixin.js'     │  49  │
│             'message.purl'              │   './src/views/portfolio/projects/ProjectPolicyViolations.vue'    │ 214  │
│             'message.swid'              │   './src/views/portfolio/projects/ProjectPolicyViolations.vue'    │ 220  │

strings removed unused:

admin.enable_bom_spdx
admin.template_cloned
admin.threadfix
condition.http_status_code
condition.warning
message.add_service
message.affects
message.alias
message.audit
message.component_added
message.component_group
message.component_removed
message.component_version
message.cwe_desc
message.dependencies
message.download
message.remove_service
message.subject
message.used_by
message.vex_long_desc
message.vulnerability_source
message.vulnerability_source_desc
message.vulnerability_subtitle
message.vulnerability_subtitle_desc
message.vulnerable_dependencies

Addressed Issue

Additional Details

Checklist

@fnxpt fnxpt force-pushed the i18n branch 3 times, most recently from 0b5fd2a to 4055cdd Compare April 5, 2024 15:15
Marlon Pina Tojal added 2 commits April 6, 2024 12:50
Signed-off-by: Marlon Pina Tojal <marlont@backbase.com>
Signed-off-by: Marlon Pina Tojal <marlont@backbase.com>
@fnxpt
Copy link
Contributor Author

fnxpt commented Apr 6, 2024

Im not sure if these strings are being used

"add_service": "Add Service",
"affects": "Affects",
"alias": "Alias",
"audit": "Audit",
"component_added": "Component added",
"component_group": "Component group",
"component_removed": "Component removed",
"component_version": "Component version",
"cwe_desc": "Common Weakness Enumeration (CWE) is a taxonomy of software and hardware weakness types",
"dependencies": "Dependencies",
"download": "Download",
"remove_service": "Remove Service",
"subject": "Subject",
"used_by": "Used By",
"vex_long_desc": "Vulnerability Exploitability Exchange (VEX)",
"vulnerability_source_desc": "The originator, aggregator, or publisher of vulnerability intelligence",
"vulnerability_source": "Source",
"vulnerability_subtitle": "Subtitle",
"vulnerability_subtitle_desc": "The optional sub-title of the vulnerability",
"vulnerable_dependencies": "Vulnerable Dependencies",

Marlon Pina Tojal added 3 commits April 6, 2024 13:20
Signed-off-by: Marlon Pina Tojal <marlont@backbase.com>
Signed-off-by: Marlon Pina Tojal <marlont@backbase.com>
Signed-off-by: Marlon Pina Tojal <marlont@backbase.com>
Marlon Pina Tojal added 5 commits April 6, 2024 13:22
Signed-off-by: Marlon Pina Tojal <marlont@backbase.com>
Signed-off-by: Marlon Pina Tojal <marlont@backbase.com>
Signed-off-by: Marlon Pina Tojal <marlont@backbase.com>
Signed-off-by: Marlon Pina Tojal <marlont@backbase.com>
Signed-off-by: Marlon Pina Tojal <marlont@backbase.com>
@nscuro nscuro added this to the 4.11 milestone Apr 9, 2024
@nscuro nscuro added the enhancement New feature or request label Apr 9, 2024
@nscuro
Copy link
Member

nscuro commented Apr 10, 2024

Im not sure if these strings are being used

It does indeed look like those are unused and safe to remove 👍

@fnxpt Is it possible to add instructions on what you did for the auto-translation part? Thinking in terms of contributors here. If they add new fields and CI starts failing due to incomplete translations, we'll need instructions on what to do to resolve.

Separately, I know you said the language can be switched in the browser. Would there be any point in adding an application-level toggle as well? Say my browser is set to German, but I actually prefer to use my applications in english.

@fnxpt
Copy link
Contributor Author

fnxpt commented Apr 10, 2024

The language is set by the browser configuration, we are setting the first language defined on the browser, in order to change the language we just need to change the order and put the language we want as the primary language.
Screenshot 2024-04-10 at 16 58 38

Regading the auto-translation was a mixed of manual/automatic work... initially I did all automatically using cloud translation api (which is paid but I had a few credits) but I realised that some of the translations were not correct, so I swich to googles translation page (a little bit more manual but I kind of found a way to make it simple, and didn't really want to waste time looking for a solution that would only be used once or twice)

@fnxpt
Copy link
Contributor Author

fnxpt commented Apr 10, 2024

ok, I had a better look on how we can improve the automation part, the plugin I suggested for vscode supports this
https://github.com/lokalise/i18n-ally/wiki/Machine-Translation

Signed-off-by: Marlon Pina Tojal <marlont@backbase.com>
@fnxpt
Copy link
Contributor Author

fnxpt commented Apr 10, 2024

On vscode when edditing a translation there ia a translate all button or a translate button per language

Screenshot 2024-04-10 at 19 19 06 Screenshot 2024-04-10 at 19 21 34

Copy link
Member

@nscuro nscuro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @fnxpt, great enhancement!

@nscuro nscuro merged commit e426fb1 into DependencyTrack:master Apr 12, 2024
18 checks passed
@setchy
Copy link
Contributor

setchy commented Apr 23, 2024

@fnxpt - nice addition.

We might need to update this section in the projects README.md 😄

@nscuro nscuro added the i18n Issues and PRs related to localization label Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request i18n Issues and PRs related to localization
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants