Skip to content

Commit

Permalink
[#2802] Update i18n calls in modules
Browse files Browse the repository at this point in the history
Updated to work with lazy loaded translations
  • Loading branch information
aron committed Aug 6, 2012
1 parent aec8e7b commit 8b72d1f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions ckan/public/base/javascript/modules/api-info.js
Expand Up @@ -17,8 +17,8 @@ this.ckan.module('api-info', function (jQuery, _) {
options: {
template: null,
i18n: {
noTemplate: _('There is no API data to load for this resource').fetch(),
loadError: _('Failed to load data API information').fetch()
noTemplate: _('There is no API data to load for this resource'),
loadError: _('Failed to load data API information')
}
},

Expand Down
8 changes: 4 additions & 4 deletions ckan/public/base/javascript/modules/confirm-delete.js
Expand Up @@ -4,10 +4,10 @@ this.ckan.module('confirm-delete', function (jQuery, _) {
options: {
/* Locale options can be overidden with data-module-i18n attribute */
i18n: {
heading: _('Please Confirm Action').fetch(),
content: _('Are you sure you want to delete this item?').fetch(),
confirm: _('Confirm').fetch(),
cancel: _('Cancel').fetch()
heading: _('Please Confirm Action'),
content: _('Are you sure you want to delete this item?'),
confirm: _('Confirm'),
cancel: _('Cancel')
},
template: [
'<div class="modal">',
Expand Down
2 changes: 2 additions & 0 deletions ckan/public/base/javascript/modules/slug-preview.js
Expand Up @@ -29,6 +29,7 @@ this.ckan.module('slug-preview-slug', function (jQuery, _) {
prefix: '',
placeholder: '<slug>',
i18n: {
url: _('URL'),
edit: _('Edit')
}
},
Expand All @@ -53,6 +54,7 @@ this.ckan.module('slug-preview-slug', function (jQuery, _) {
prefix: options.prefix,
placeholder: options.placeholder,
i18n: {
'URL': this.i18n('url'),
'Edit': this.i18n('edit')
}
});
Expand Down
4 changes: 3 additions & 1 deletion ckan/public/base/javascript/plugins/jquery.slug-preview.js
Expand Up @@ -37,6 +37,7 @@
value.text(val);
}

preview.find('strong').text(options.i18n['URL'] + ':');
preview.find('.slug-preview-prefix').text(options.prefix);
preview.find('button').text(options.i18n['Edit']).click(function (event) {
event.preventDefault();
Expand All @@ -61,11 +62,12 @@
prefix: '',
placeholder: '',
i18n: {
'URL': 'URL',
'Edit': 'Edit'
},
template: [
'<div class="slug-preview">',
'<strong>URL:</strong>',
'<strong></strong>',
'<span class="slug-preview-prefix"></span><span class="slug-preview-value"></span>',
'<button class="btn btn-small"></button>',
'</div>'
Expand Down

0 comments on commit 8b72d1f

Please sign in to comment.