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

Send user language to augur

Inga Mai99dd1243c2b4
diff --git a/app/views/layouts/base.html.erb b/app/views/layouts/base.html.erb
index 5c02a12d2f9..1ee5eb64101 100644
--- a/app/views/layouts/base.html.erb
+++ b/app/views/layouts/base.html.erb
@@ -50,7 +50,8 @@ See docs/COPYRIGHT.rdoc for more details.
<meta name="current_user"
data-name="<%= User.current.name %>"
data-mail="<%= User.current.mail %>"
- data-id="<%= User.current.id %>" />
+ data-id="<%= User.current.id %>"
+ data-lang="<%= User.current.language %>"/>
<% end %>
<% if OpenProject::Configuration.frontend_sentry? %>
diff --git a/frontend/src/app/components/enterprise/enterprise-modal/enterprise-trial-form/ee-trial-form.component.ts b/frontend/src/app/components/enterprise/enterprise-modal/enterprise-trial-form/ee-trial-form.component.ts
index 9fb1a16c4b7..1611c8f145f 100644
--- a/frontend/src/app/components/enterprise/enterprise-modal/enterprise-trial-form/ee-trial-form.component.ts
+++ b/frontend/src/app/components/enterprise/enterprise-modal/enterprise-trial-form/ee-trial-form.component.ts
@@ -30,6 +30,7 @@ import {Component, ElementRef} from "@angular/core";
import {FormBuilder, Validators} from "@angular/forms";
import {I18nService} from "app/modules/common/i18n/i18n.service";
import {EnterpriseTrialData, EnterpriseTrialService} from "core-components/enterprise/enterprise-trial.service";
+import {CurrentUserService} from "core-components/user/current-user.service";
const termsOfServiceURL = 'https://www.openproject.com/terms-of-service/';
const legalNoticeURL = 'https://www.openproject.com/legal-notice/';
@@ -51,6 +52,7 @@ export class EETrialFormComponent {
domain: [this.userData.domain, Validators.required],
general_consent: [null, Validators.required],
newsletter_consent: null,
+ language: this.currentUserService.language
});
public text = {
@@ -73,6 +75,7 @@ export class EETrialFormComponent {
constructor(readonly elementRef:ElementRef,
readonly I18n:I18nService,
private formBuilder:FormBuilder,
+ readonly currentUserService:CurrentUserService,
public eeTrialService:EnterpriseTrialService) {
}
diff --git a/frontend/src/app/components/user/current-user.service.ts b/frontend/src/app/components/user/current-user.service.ts
index 829738b1c6c..4ac1831446b 100644
--- a/frontend/src/app/components/user/current-user.service.ts
+++ b/frontend/src/app/components/user/current-user.service.ts
@@ -46,6 +46,10 @@ export class CurrentUserService {
return this.userMeta.data('mail');
}
+ public get language() {
+ return this.userMeta.data('lang');
+ }
+
private get userMeta():JQuery {
return jQuery('meta[name=current_user]');
}