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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
[33083] Fix localized links (#8282)
Oliver Günther1c229d77ed70
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.tsindex b1edd9a7d97..ff795fbb125 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@@ -31,9 +31,8 @@ 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";+import {I18nHelpers} from "core-app/helpers/i18n/localized-link";-const termsOfServiceURL = 'https://www.openproject.com/terms-of-service/';-const legalNoticeURL = 'https://www.openproject.com/legal-notice/';const newsletterURL = 'https://www.openproject.com/newsletter/';@Component({@@ -57,8 +56,14 @@ export class EETrialFormComponent {public text = {general_consent: this.I18n.t('js.admin.enterprise.trial.form.general_consent', {- link_terms: termsOfServiceURL,- link_privacy: legalNoticeURL+ link_terms: I18nHelpers.localizeLink({+ en: 'https://www.openproject.com/terms-of-service/',+ de: 'https://www.openproject.org/de/nutzungsbedingungen/',+ }),+ link_privacy: I18nHelpers.localizeLink({+ en: 'https://www.openproject.org/data-privacy-and-security/',+ de: 'https://www.openproject.org/de/datenschutz/'+ })}),invalid_email: this.I18n.t('js.admin.enterprise.trial.form.invalid_email'),label_test_ee: this.I18n.t('js.admin.enterprise.trial.form.test_ee'),diff --git a/frontend/src/app/helpers/i18n/localized-link.ts b/frontend/src/app/helpers/i18n/localized-link.tsnew file mode 100644index 00000000000..73b2a0b1355--- /dev/null+++ b/frontend/src/app/helpers/i18n/localized-link.ts@@ -0,0 +1,19 @@+export namespace I18nHelpers {++ export interface LocalizedLinkMap {+ [key:string]:string;++ en:string;+ }++ /**+ * Return the matching link for the current locale+ *+ * @param map A hash of locale => URL to use+ */+ export function localizeLink(map:LocalizedLinkMap) {+ const locale = I18n.locale;++ return map[locale] || map.en;+ }+}