Commit c681c567 by Waheed Ahmed

Merge pull request #12586 from edx/waheed/fix-i18n-issues

Fixed i18n issues, follow up PR for "Account Settings Navigation".
parents 655c1aa2 c8d23c16
...@@ -5,9 +5,10 @@ ...@@ -5,9 +5,10 @@
'js/student_account/models/user_account_model', 'js/student_account/models/user_account_model',
'js/student_account/models/user_preferences_model', 'js/student_account/models/user_preferences_model',
'js/student_account/views/account_settings_fields', 'js/student_account/views/account_settings_fields',
'js/student_account/views/account_settings_view' 'js/student_account/views/account_settings_view',
'edx-ui-toolkit/js/utils/string-utils'
], function (gettext, $, _, Backbone, Logger, UserAccountModel, UserPreferencesModel, ], function (gettext, $, _, Backbone, Logger, UserAccountModel, UserPreferencesModel,
AccountSettingsFieldViews, AccountSettingsView) { AccountSettingsFieldViews, AccountSettingsView, StringUtils) {
return function (fieldsData, authData, userAccountsApiUrl, userPreferencesApiUrl, accountUserId, platformName) { return function (fieldsData, authData, userAccountsApiUrl, userPreferencesApiUrl, accountUserId, platformName) {
var accountSettingsElement, userAccountModel, userPreferencesModel, aboutSectionsData, var accountSettingsElement, userAccountModel, userPreferencesModel, aboutSectionsData,
...@@ -24,18 +25,16 @@ ...@@ -24,18 +25,16 @@
aboutSectionsData = [ aboutSectionsData = [
{ {
title: gettext('Basic Account Information'), title: gettext('Basic Account Information'),
subtitle: gettext( subtitle: gettext('These settings include basic information about your account. You can also specify additional information and see your linked social accounts on this page.'), /* jshint ignore:line */
'These settings include basic information about your account. You can also ' +
'specify additional information and see your linked social accounts on this page.'
),
fields: [ fields: [
{ {
view: new AccountSettingsFieldViews.ReadonlyFieldView({ view: new AccountSettingsFieldViews.ReadonlyFieldView({
model: userAccountModel, model: userAccountModel,
title: gettext('Username'), title: gettext('Username'),
valueAttribute: 'username', valueAttribute: 'username',
helpMessage: interpolate_text( helpMessage: StringUtils.interpolate(
gettext('The name that identifies you throughout {platform_name}. You cannot change your username.'), {platform_name: platformName} gettext('The name that identifies you throughout {platform_name}. You cannot change your username.'), /* jshint ignore:line */
{platform_name: platformName}
) )
}) })
}, },
...@@ -55,8 +54,9 @@ ...@@ -55,8 +54,9 @@
model: userAccountModel, model: userAccountModel,
title: gettext('Email Address'), title: gettext('Email Address'),
valueAttribute: 'email', valueAttribute: 'email',
helpMessage: interpolate_text( helpMessage: StringUtils.interpolate(
gettext('The email address you use to sign in. Communications from {platform_name} and your courses are sent to this address.'), {platform_name: platformName} gettext('The email address you use to sign in. Communications from {platform_name} and your courses are sent to this address.'), /* jshint ignore:line */
{platform_name: platformName}
), ),
persistChanges: true persistChanges: true
}) })
...@@ -70,9 +70,10 @@ ...@@ -70,9 +70,10 @@
emailAttribute: 'email', emailAttribute: 'email',
linkTitle: gettext('Reset Your Password'), linkTitle: gettext('Reset Your Password'),
linkHref: fieldsData.password.url, linkHref: fieldsData.password.url,
helpMessage: gettext('When you click "Reset Your Password", edX will send a message ' + helpMessage: StringUtils.interpolate(
'to the email address for your edX account. Click the link in the message to ' + gettext('When you select "Reset Your Password", a message will be sent to the email address for your {platform_name} account. Click the link in the message to reset your password.'), /* jshint ignore:line */
'reset your password.') {platform_name: platformName}
)
}) })
}, },
{ {
...@@ -82,8 +83,9 @@ ...@@ -82,8 +83,9 @@
valueAttribute: 'pref-lang', valueAttribute: 'pref-lang',
required: true, required: true,
refreshPageOnSave: true, refreshPageOnSave: true,
helpMessage: interpolate_text( helpMessage: StringUtils.interpolate(
gettext('The language used throughout this site. This site is currently available in a limited number of languages.'), {platform_name: platformName} gettext('The language used throughout this site. This site is currently available in a limited number of languages.'), /* jshint ignore:line */
{platform_name: platformName}
), ),
options: fieldsData.language.options, options: fieldsData.language.options,
persistChanges: true persistChanges: true
...@@ -147,9 +149,9 @@ ...@@ -147,9 +149,9 @@
accountsSectionData = [ accountsSectionData = [
{ {
title: gettext('Linked Accounts'), title: gettext('Linked Accounts'),
subtitle: gettext( subtitle: StringUtils.interpolate(
'You can link your social media accounts to your edX account to make signing in to edx.org ' + gettext('You can link your social media accounts to simplify signing in to {platform_name}.'),
'and the edX mobile apps easier.' {platform_name: platformName}
), ),
fields: _.map(authData.providers, function(provider) { fields: _.map(authData.providers, function(provider) {
return { return {
...@@ -160,7 +162,8 @@ ...@@ -160,7 +162,8 @@
connected: provider.connected, connected: provider.connected,
connectUrl: provider.connect_url, connectUrl: provider.connect_url,
acceptsLogins: provider.accepts_logins, acceptsLogins: provider.accepts_logins,
disconnectUrl: provider.disconnect_url disconnectUrl: provider.disconnect_url,
platformName: platformName
}) })
}; };
}) })
......
...@@ -10,7 +10,8 @@ ...@@ -10,7 +10,8 @@
'text!templates/fields/field_readonly_account.underscore', 'text!templates/fields/field_readonly_account.underscore',
'text!templates/fields/field_link_account.underscore', 'text!templates/fields/field_link_account.underscore',
'text!templates/fields/field_dropdown_account.underscore', 'text!templates/fields/field_dropdown_account.underscore',
'text!templates/fields/field_social_link_account.underscore' 'text!templates/fields/field_social_link_account.underscore',
'edx-ui-toolkit/js/utils/string-utils'
], function ( ], function (
gettext, $, _, Backbone, gettext, $, _, Backbone,
FieldViews, FieldViews,
...@@ -18,7 +19,9 @@ ...@@ -18,7 +19,9 @@
field_readonly_account_template, field_readonly_account_template,
field_link_account_template, field_link_account_template,
field_dropdown_account_template, field_dropdown_account_template,
field_social_link_template) field_social_link_template,
StringUtils
)
{ {
var AccountSettingsFieldViews = { var AccountSettingsFieldViews = {
...@@ -34,11 +37,8 @@ ...@@ -34,11 +37,8 @@
EmailFieldView: FieldViews.TextFieldView.extend({ EmailFieldView: FieldViews.TextFieldView.extend({
fieldTemplate: field_text_account_template, fieldTemplate: field_text_account_template,
successMessage: function () { successMessage: function () {
return this.indicators.success + window.interpolate_text( return this.indicators.success + StringUtils.interpolate(
gettext( gettext('We\'ve sent a confirmation message to {new_email_address}. Click the link in the message to update your email address.'), /* jshint ignore:line */
'We\'ve sent a confirmation message to {new_email_address}. Click the link in the ' +
'message to update your email address.'
),
{'new_email_address': this.fieldValue()} {'new_email_address': this.fieldValue()}
); );
} }
...@@ -102,11 +102,8 @@ ...@@ -102,11 +102,8 @@
}); });
}, },
successMessage: function () { successMessage: function () {
return this.indicators.success + window.interpolate_text( return this.indicators.success + StringUtils.interpolate(
gettext( gettext('We\'ve sent a message to {email_address}. Click the link in the message to reset your password.'), /* jshint ignore:line */
'We\'ve sent a message to {email_address}. Click the link in the message to reset ' +
'your password.'
),
{'email_address': this.model.get(this.options.emailAttribute)} {'email_address': this.model.get(this.options.emailAttribute)}
); );
} }
...@@ -144,27 +141,27 @@ ...@@ -144,27 +141,27 @@
var linkTitle = '', var linkTitle = '',
linkClass = '', linkClass = '',
subTitle = '', subTitle = '',
screenReaderTitle = window.interpolate_text( screenReaderTitle = StringUtils.interpolate(
gettext("Link your {accountName} account"), {accountName: this.options.title} gettext("Link your {accountName} account"),
{accountName: this.options.title}
); );
if (this.options.connected) { if (this.options.connected) {
linkTitle = gettext('Unlink This Account'); linkTitle = gettext('Unlink This Account');
linkClass = 'social-field-linked'; linkClass = 'social-field-linked';
subTitle = window.interpolate_text( subTitle = StringUtils.interpolate(
gettext('You can use your {accountName} account to sign in to your edX account.'), gettext('You can use your {accountName} account to sign in to your {platformName} account.'), /* jshint ignore:line */
{accountName: this.options.title} {accountName: this.options.title, platformName: this.options.platformName}
); );
screenReaderTitle = window.interpolate_text( screenReaderTitle = StringUtils.interpolate(
gettext("Unlink your {accountName} account"), {accountName: this.options.title} gettext("Unlink your {accountName} account"),
{accountName: this.options.title}
); );
} else if (this.options.acceptsLogins) { } else if (this.options.acceptsLogins) {
linkTitle = gettext('Link Your Account'); linkTitle = gettext('Link Your Account');
linkClass = 'social-field-unlinked'; linkClass = 'social-field-unlinked';
subTitle = window.interpolate_text( subTitle = StringUtils.interpolate(
gettext( gettext('Link your {accountName} account to your {platformName} account and use {accountName} to sign in to {platformName}.'), /* jshint ignore:line */
'Link your {accountName} account to your edX account and ' + {accountName: this.options.title, platformName: this.options.platformName}
'use {accountName} to sign in to edX.'
), {accountName: this.options.title}
); );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment