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 @@
'js/student_account/models/user_account_model',
'js/student_account/models/user_preferences_model',
'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,
AccountSettingsFieldViews, AccountSettingsView) {
AccountSettingsFieldViews, AccountSettingsView, StringUtils) {
return function (fieldsData, authData, userAccountsApiUrl, userPreferencesApiUrl, accountUserId, platformName) {
var accountSettingsElement, userAccountModel, userPreferencesModel, aboutSectionsData,
......@@ -24,18 +25,16 @@
aboutSectionsData = [
{
title: gettext('Basic Account Information'),
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.'
),
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 */
fields: [
{
view: new AccountSettingsFieldViews.ReadonlyFieldView({
model: userAccountModel,
title: gettext('Username'),
valueAttribute: 'username',
helpMessage: interpolate_text(
gettext('The name that identifies you throughout {platform_name}. You cannot change your username.'), {platform_name: platformName}
helpMessage: StringUtils.interpolate(
gettext('The name that identifies you throughout {platform_name}. You cannot change your username.'), /* jshint ignore:line */
{platform_name: platformName}
)
})
},
......@@ -55,8 +54,9 @@
model: userAccountModel,
title: gettext('Email Address'),
valueAttribute: 'email',
helpMessage: interpolate_text(
gettext('The email address you use to sign in. Communications from {platform_name} and your courses are sent to this address.'), {platform_name: platformName}
helpMessage: StringUtils.interpolate(
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
})
......@@ -70,9 +70,10 @@
emailAttribute: 'email',
linkTitle: gettext('Reset Your Password'),
linkHref: fieldsData.password.url,
helpMessage: gettext('When you click "Reset Your Password", edX will send a message ' +
'to the email address for your edX account. Click the link in the message to ' +
'reset your password.')
helpMessage: StringUtils.interpolate(
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 */
{platform_name: platformName}
)
})
},
{
......@@ -82,8 +83,9 @@
valueAttribute: 'pref-lang',
required: true,
refreshPageOnSave: true,
helpMessage: interpolate_text(
gettext('The language used throughout this site. This site is currently available in a limited number of languages.'), {platform_name: platformName}
helpMessage: StringUtils.interpolate(
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,
persistChanges: true
......@@ -147,9 +149,9 @@
accountsSectionData = [
{
title: gettext('Linked Accounts'),
subtitle: gettext(
'You can link your social media accounts to your edX account to make signing in to edx.org ' +
'and the edX mobile apps easier.'
subtitle: StringUtils.interpolate(
gettext('You can link your social media accounts to simplify signing in to {platform_name}.'),
{platform_name: platformName}
),
fields: _.map(authData.providers, function(provider) {
return {
......@@ -160,7 +162,8 @@
connected: provider.connected,
connectUrl: provider.connect_url,
acceptsLogins: provider.accepts_logins,
disconnectUrl: provider.disconnect_url
disconnectUrl: provider.disconnect_url,
platformName: platformName
})
};
})
......
......@@ -10,7 +10,8 @@
'text!templates/fields/field_readonly_account.underscore',
'text!templates/fields/field_link_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 (
gettext, $, _, Backbone,
FieldViews,
......@@ -18,7 +19,9 @@
field_readonly_account_template,
field_link_account_template,
field_dropdown_account_template,
field_social_link_template)
field_social_link_template,
StringUtils
)
{
var AccountSettingsFieldViews = {
......@@ -34,11 +37,8 @@
EmailFieldView: FieldViews.TextFieldView.extend({
fieldTemplate: field_text_account_template,
successMessage: function () {
return this.indicators.success + window.interpolate_text(
gettext(
'We\'ve sent a confirmation message to {new_email_address}. Click the link in the ' +
'message to update your email address.'
),
return this.indicators.success + StringUtils.interpolate(
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 */
{'new_email_address': this.fieldValue()}
);
}
......@@ -102,11 +102,8 @@
});
},
successMessage: function () {
return this.indicators.success + window.interpolate_text(
gettext(
'We\'ve sent a message to {email_address}. Click the link in the message to reset ' +
'your password.'
),
return this.indicators.success + StringUtils.interpolate(
gettext('We\'ve sent a message to {email_address}. Click the link in the message to reset your password.'), /* jshint ignore:line */
{'email_address': this.model.get(this.options.emailAttribute)}
);
}
......@@ -144,27 +141,27 @@
var linkTitle = '',
linkClass = '',
subTitle = '',
screenReaderTitle = window.interpolate_text(
gettext("Link your {accountName} account"), {accountName: this.options.title}
screenReaderTitle = StringUtils.interpolate(
gettext("Link your {accountName} account"),
{accountName: this.options.title}
);
if (this.options.connected) {
linkTitle = gettext('Unlink This Account');
linkClass = 'social-field-linked';
subTitle = window.interpolate_text(
gettext('You can use your {accountName} account to sign in to your edX account.'),
{accountName: this.options.title}
subTitle = StringUtils.interpolate(
gettext('You can use your {accountName} account to sign in to your {platformName} account.'), /* jshint ignore:line */
{accountName: this.options.title, platformName: this.options.platformName}
);
screenReaderTitle = window.interpolate_text(
gettext("Unlink your {accountName} account"), {accountName: this.options.title}
screenReaderTitle = StringUtils.interpolate(
gettext("Unlink your {accountName} account"),
{accountName: this.options.title}
);
} else if (this.options.acceptsLogins) {
linkTitle = gettext('Link Your Account');
linkClass = 'social-field-unlinked';
subTitle = window.interpolate_text(
gettext(
'Link your {accountName} account to your edX account and ' +
'use {accountName} to sign in to edX.'
), {accountName: this.options.title}
subTitle = StringUtils.interpolate(
gettext('Link your {accountName} account to your {platformName} account and use {accountName} to sign in to {platformName}.'), /* jshint ignore:line */
{accountName: this.options.title, platformName: this.options.platformName}
);
}
......
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