Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Extract all translations

Klaus Zandersbb283567dce3
diff --git a/app/components/my/access_token/api_tokens_section_component.html.erb b/app/components/my/access_token/api_tokens_section_component.html.erb
index c916b443181..3ca6d8559e2 100644
--- a/app/components/my/access_token/api_tokens_section_component.html.erb
+++ b/app/components/my/access_token/api_tokens_section_component.html.erb
@@ -46,7 +46,7 @@ See COPYRIGHT and LICENSE files for more details.
Primer::Beta::Button.new(
tag: :a,
mt: 3,
- scheme: :primary,
+ scheme: :secondary,
test_selector: "api-token-add",
href: dialog_my_access_tokens_path(token_type: "api"),
data: { turbo_stream: true },
diff --git a/app/components/my/access_token/new_access_token_dialog_component.html.erb b/app/components/my/access_token/new_access_token_dialog_component.html.erb
index 757f641cae9..796d2d8157f 100644
--- a/app/components/my/access_token/new_access_token_dialog_component.html.erb
+++ b/app/components/my/access_token/new_access_token_dialog_component.html.erb
@@ -31,7 +31,7 @@ See COPYRIGHT and LICENSE files for more details.
render(
Primer::Alpha::Dialog.new(
id: DIALOG_ID,
- title: I18n.t("my.access_token.new_access_token_dialog_title"),
+ title: I18n.t(:dialog_title, scope: i18n_scope),
test_selector: DIALOG_ID,
size: :large
)
diff --git a/app/components/my/access_token/new_access_token_dialog_component.rb b/app/components/my/access_token/new_access_token_dialog_component.rb
index 37be01b1f53..59516e148c7 100644
--- a/app/components/my/access_token/new_access_token_dialog_component.rb
+++ b/app/components/my/access_token/new_access_token_dialog_component.rb
@@ -50,6 +50,14 @@ module My
when "ical-meeting" then Token::ICalMeeting.new
end
end
+
+ def i18n_scope
+ case token_type
+ when "api" then "my.access_token.api"
+ when "ical-meeting" then "my.access_token.ical_meeting"
+ else raise ArgumentError, "Unknown token type: #{token_type}"
+ end
+ end
end
end
end
diff --git a/app/components/my/access_token/new_access_token_form.rb b/app/components/my/access_token/new_access_token_form.rb
index 398e481a363..5f11eae44b7 100644
--- a/app/components/my/access_token/new_access_token_form.rb
+++ b/app/components/my/access_token/new_access_token_form.rb
@@ -34,12 +34,22 @@ module My
form do |new_access_token_form|
new_access_token_form.text_field(
name: :token_name,
- label: I18n.t("my.access_token.new_access_token_dialog_text_field_label"),
- placeholder: I18n.t("my.access_token.new_access_token_dialog_text_field_placeholder_text"),
+ label: I18n.t(:name_label, scope: i18n_scope),
+ placeholder: I18n.t(:name_placeholder, scope: i18n_scope),
visually_hide_label: false,
required: true
)
end
+
+ private
+
+ def i18n_scope
+ case model
+ when Token::API then "my.access_token.api"
+ when Token::ICalMeeting then "my.access_token.ical_meeting"
+ else raise ArgumentError, "Unknown token type: #{token_type}"
+ end
+ end
end
end
end
diff --git a/app/components/my/access_token/new_access_token_form_component.html.erb b/app/components/my/access_token/new_access_token_form_component.html.erb
index 412731d4286..17ab8dd9f45 100644
--- a/app/components/my/access_token/new_access_token_form_component.html.erb
+++ b/app/components/my/access_token/new_access_token_form_component.html.erb
@@ -38,19 +38,19 @@ See COPYRIGHT and LICENSE files for more details.
component_collection do |collection|
collection.with_component(
Primer::Alpha::Dialog::Body.new(
- aria: { label: I18n.t("my.access_token.new_access_token_dialog_title") }
+ aria: { label: I18n.t(:dialog_title, scope: i18n_scope) }
)
) do
flex_layout(mb: 3) do |body|
body.with_row do
render(Primer::Alpha::Banner.new(scheme: :warning)) do
- I18n.t("my.access_token.new_access_token_dialog_attention_text")
+ I18n.t(:attention_text, scope: i18n_scope)
end
end
body.with_row(mt: 3) do
render(Primer::Beta::Text.new(tag: :p)) do
- I18n.t("my.access_token.new_access_token_dialog_text")
+ I18n.t(:dialog_body, scope: i18n_scope)
end
end
@@ -62,12 +62,12 @@ See COPYRIGHT and LICENSE files for more details.
collection.with_component(Primer::Alpha::Dialog::Footer.new) do
component_collection do |footer|
- footer.with_component(Primer::Beta::Button.new(data: { "close-dialog-id": "new-access-token-dialog" })) do
+ footer.with_component(Primer::Beta::Button.new(data: { "close-dialog-id": My::AccessToken::NewAccessTokenDialogComponent::DIALOG_ID })) do
I18n.t("button_cancel")
end
footer.with_component(Primer::Beta::Button.new(scheme: :primary, type: :submit, test_selector: "create-api-token-button")) do
- I18n.t("my.access_token.new_access_token_dialog_submit_button_text")
+ I18n.t(:create_button, scope: i18n_scope)
end
end
end
diff --git a/app/components/my/access_token/new_access_token_form_component.rb b/app/components/my/access_token/new_access_token_form_component.rb
index 8a38ec8aac5..71763b6a226 100644
--- a/app/components/my/access_token/new_access_token_form_component.rb
+++ b/app/components/my/access_token/new_access_token_form_component.rb
@@ -34,11 +34,23 @@ module My
include OpTurbo::Streamable
include OpPrimer::ComponentHelpers
+ attr_reader :token
+
def initialize(token:)
super
@token = token
end
+
+ private
+
+ def i18n_scope
+ case token
+ when Token::API then "my.access_token.api"
+ when Token::ICalMeeting then "my.access_token.ical_meeting"
+ else raise ArgumentError, "Unknown token type: #{token_type}"
+ end
+ end
end
end
end
diff --git a/app/views/my/access_tokens/_icalendar_meeting_tokens_section.html.erb b/app/views/my/access_tokens/_icalendar_meeting_tokens_section.html.erb
index c4de739c833..66207274159 100644
--- a/app/views/my/access_tokens/_icalendar_meeting_tokens_section.html.erb
+++ b/app/views/my/access_tokens/_icalendar_meeting_tokens_section.html.erb
@@ -78,7 +78,7 @@ See COPYRIGHT and LICENSE files for more details.
Primer::Beta::Button.new(
tag: :a,
mt: 3,
- scheme: :primary,
+ scheme: :secondary,
test_selector: "ical-meeting-token-add",
href: dialog_my_access_tokens_path(token_type: "ical-meeting"),
data: { turbo_stream: true },
diff --git a/config/locales/en.yml b/config/locales/en.yml
index a791eb785ba..98ebcbdc605 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -615,6 +615,20 @@ en:
my:
access_token:
+ api:
+ dialog_title: "Create new API token"
+ attention_text: "Treat API tokens like passwords. Anyone with this token will have access to information from this instance, share it only with trusted users."
+ dialog_body: "This token will allow third-party applications to communicate with your instance. To differentiate the new API token, please give it a name."
+ create_button: "Create"
+ name_label: "Name"
+ name_placeholder: "My API token"
+ ical_meeting:
+ dialog_title: "Create new iCalendar subscription token for meetings"
+ attention_text: "Treat the URL to the calendar scubscription like a password. Anyone with this link will have access to information from all meetings you are a participant of."
+ dialog_body: "This link will allow you to subscribe to all of your meetings in your calendar application. To differentiate the new iCalendar subscription, please tell us on what device you want to use this subscription."
+ create_button: "Create subscription"
+ name_label: "Where will you be using this?"
+ name_placeholder: 'Type a name, e.g. "Phone", "Work computer"'
create_dialog:
title: Token generated
header: The %{type} token has been generated
@@ -622,13 +636,6 @@ en:
errors:
token_name_blank: "Please provide an API token name"
token_name_in_use: "This API token name is already in use, please select a different one"
- new_access_token_dialog_title: "Create new API token"
- new_access_token_dialog_show_button_text: "API token"
- new_access_token_dialog_text_field_placeholder_text: "My API token"
- new_access_token_dialog_text_field_label: "Name"
- new_access_token_dialog_submit_button_text: "Create"
- new_access_token_dialog_text: "This token will allow third-party applications to communicate with your instance. To differentiate the new API token, please give it a name."
- new_access_token_dialog_attention_text: "Treat API tokens like passwords. Anyone with this link will have access to information from this instance, share it only with trusted users."
failed_to_reset_token: "Failed to reset access token: %{error}"
failed_to_create_token: "Failed to create access token: %{error}"
failed_to_revoke_token: "Failed to revoke access token: %{error}"