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

Update translations for the API token section according to new copy

Klaus Zanders5e010ad3bbed
diff --git a/app/components/my/access_token/access_token_created_dialog_component.html.erb b/app/components/my/access_token/access_token_created_dialog_component.html.erb
index 70e15db5e96..f1b37b71ac2 100644
--- a/app/components/my/access_token/access_token_created_dialog_component.html.erb
+++ b/app/components/my/access_token/access_token_created_dialog_component.html.erb
@@ -31,16 +31,24 @@ See COPYRIGHT and LICENSE files for more details.
render(
Primer::OpenProject::FeedbackDialog.new(
id:,
- title: I18n.t("my.access_token.create_dialog.title"),
- size: :large
+ title: I18n.t(:title, scope: i18n_scope),
+ size: :xlarge
)
) do |dialog|
dialog.with_feedback_message do |message|
- message.with_heading(tag: :h2) { I18n.t("my.access_token.create_dialog.header", type: token.model_name.human) }
+ message.with_heading(tag: :h2) { I18n.t(:title, scope: i18n_scope) }
end
dialog.with_additional_details do
flex_layout do |flex|
+ if I18n.t(:body, scope: i18n_scope, default: "").present?
+ flex.with_row(mb: 3) do
+ render(Primer::Beta::Text.new(tag: :p)) do
+ I18n.t(:body, scope: i18n_scope)
+ end
+ end
+ end
+
flex.with_row(mb: 2) do
render(Primer::OpenProject::InputGroup.new) do |input_group|
input_group.with_text_input(
@@ -59,7 +67,7 @@ See COPYRIGHT and LICENSE files for more details.
end
flex.with_row do
render(Primer::Alpha::Banner.new(scheme: :warning, icon: :alert)) do
- I18n.t("my.access_token.create_dialog.warning")
+ I18n.t(:warning, scope: i18n_scope)
end
end
end
diff --git a/app/components/my/access_token/access_token_created_dialog_component.rb b/app/components/my/access_token/access_token_created_dialog_component.rb
index 7f38e9011b7..b1770045710 100644
--- a/app/components/my/access_token/access_token_created_dialog_component.rb
+++ b/app/components/my/access_token/access_token_created_dialog_component.rb
@@ -57,6 +57,14 @@ module My
raise ArgumentError, "Unknown token type: #{token.class}"
end
end
+
+ def i18n_scope
+ case token
+ when Token::API then "my.access_token.created_dialog.api"
+ when Token::ICalMeeting then "my.access_token.created_dialog.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 6672e90bd20..b1327b6d593 100644
--- a/app/components/my/access_token/new_access_token_form.rb
+++ b/app/components/my/access_token/new_access_token_form.rb
@@ -34,8 +34,10 @@ module My
form do |new_access_token_form|
new_access_token_form.text_field(
name: :token_name,
+ autofocus: true,
+ autocomplete: "off",
label: I18n.t(:name_label, scope: i18n_scope),
- placeholder: I18n.t(:name_placeholder, scope: i18n_scope),
+ caption: I18n.t(:name_caption, scope: i18n_scope, default: ""),
visually_hide_label: false,
required: true
)
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 17ab8dd9f45..30f1489aaa7 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
@@ -42,13 +42,15 @@ See COPYRIGHT and LICENSE files for more details.
)
) do
flex_layout(mb: 3) do |body|
- body.with_row do
- render(Primer::Alpha::Banner.new(scheme: :warning)) do
- I18n.t(:attention_text, scope: i18n_scope)
+ if show_warning?
+ body.with_row(mb: 3) do
+ render(Primer::Alpha::Banner.new(scheme: :warning)) do
+ I18n.t(:attention_text, scope: i18n_scope)
+ end
end
end
- body.with_row(mt: 3) do
+ body.with_row do
render(Primer::Beta::Text.new(tag: :p)) do
I18n.t(:dialog_body, scope: i18n_scope)
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 1ba8598c841..a6fe9fe682f 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
@@ -51,6 +51,15 @@ module My
else raise ArgumentError, "Unknown token type: #{token_type}"
end
end
+
+ def show_warning?
+ case token
+ when Token::API then true
+ when Token::ICalMeeting then false
+ else
+ raise ArgumentError, "Unknown token type: #{token_type}"
+ end
+ end
end
end
end
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 86238443393..4b08d5915bf 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -621,19 +621,21 @@ en:
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"
+ name_label: "Token name"
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."
+ dialog_title: "New iCal subscription token for meetings"
+ dialog_body: "This token will generate an iCal subscription URL that lets you view all your meetings in an external calendar application."
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
- warning: Note that this is the only time you will see this token, make sure to copy it now.
+ name_label: "Token name"
+ name_caption: 'You can name it after where you will use it, such as"My phone" or "Work computer.'
+ created_dialog:
+ api:
+ title: "The API token has been generated"
+ warning: "This is the only time you will see this token. Make sure to copy it now."
+ ical_meeting:
+ title: "An iCal meeting subscription token has been generated"
+ body: "Treat the following URL as you would a password. Anyone who has access to it can view all your meetings."
+ warning: "This is the only time you will see this token. Make sure to copy it now."
revocation:
ical_meeting:
notice_success: "The iCalendar meeting subscription has been revoked successfully."
@@ -1649,7 +1651,8 @@ en:
cant_exceed_work: "cannot be higher than Work."
must_be_set_when_work_is_set: "required when Work is set."
must_be_set_when_work_and_percent_complete_are_set: "required when Work and % Complete are set."
- must_be_set_to_zero_hours_when_work_is_set_and_percent_complete_is_100p: >-
+ must_be_set_to_zero_hours_when_work_is_set_and_percent_complete_is_100p:
+ >-
must be 0h when Work is set and % Complete is 100%.
must_be_empty_when_work_is_empty_and_percent_complete_is_100p: >-
must be empty when Work is empty and % Complete is 100%.
@@ -2088,9 +2091,33 @@ en:
date:
abbr_day_names: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
- abbr_month_names: [~, "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
+ abbr_month_names:
+ [
+ ~,
+ "Jan",
+ "Feb",
+ "Mar",
+ "Apr",
+ "May",
+ "Jun",
+ "Jul",
+ "Aug",
+ "Sep",
+ "Oct",
+ "Nov",
+ "Dec",
+ ]
abbr_week: "Wk"
- day_names: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
+ day_names:
+ [
+ "Sunday",
+ "Monday",
+ "Tuesday",
+ "Wednesday",
+ "Thursday",
+ "Friday",
+ "Saturday",
+ ]
formats:
# Use the strftime parameters for formats.
# When no format has been given, it uses default.