various translations uses __()
This commit is contained in:
parent
eedcbbfa10
commit
545e885da2
10 changed files with 35 additions and 35 deletions
|
|
@ -117,8 +117,8 @@ frappe.get_modal = function(title, body_html) {
|
|||
<div class="modal-body ui-front">'+body_html+'\
|
||||
</div>\
|
||||
<div class="modal-footer hide">\
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>\
|
||||
<button type="button" class="btn btn-primary">Confirm</button>\
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">' + __("Close") + '</button>\
|
||||
<button type="button" class="btn btn-primary">' + __("Confirm") + '</button>\
|
||||
</div>\
|
||||
</div>\
|
||||
</div>\
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ frappe.ui.form.Comments = Class.extend({
|
|||
<textarea style="height: 80px" class="form-control"></textarea>\
|
||||
<div class="text-right" style="margin-top: 10px">\
|
||||
<button class="btn btn-default btn-go btn-sm">\
|
||||
<i class="icon-ok"></i> Add comment</button>\
|
||||
<i class="icon-ok"></i> ' + __("Add comment") + '</button>\
|
||||
</div>\
|
||||
</div>\
|
||||
</div>', {image: frappe.user_info(user).image,
|
||||
|
|
|
|||
|
|
@ -787,11 +787,11 @@ frappe.ui.form.ControlLink = frappe.ui.form.ControlData.extend({
|
|||
<input type="text" class="input-with-feedback form-control" \
|
||||
style="display: table-cell">\
|
||||
<span class="link-field-btn" style="display: table-cell">\
|
||||
<a class="btn-search" title="Search Link">\
|
||||
<a class="btn-search" title=' + __("Search Link") + '>\
|
||||
<i class="icon-search"></i>\
|
||||
</a><a class="btn-open" title="Open Link">\
|
||||
</a><a class="btn-open" title=' + __("Open Link") + '>\
|
||||
<i class="icon-arrow-right"></i>\
|
||||
</a><a class="btn-new" title="Make New">\
|
||||
</a><a class="btn-new" title=' + __("Make New") + '>\
|
||||
<i class="icon-plus"></i>\
|
||||
</a>\
|
||||
</span>\
|
||||
|
|
@ -894,7 +894,7 @@ frappe.ui.form.ControlLink = frappe.ui.form.ControlData.extend({
|
|||
callback: function(r) {
|
||||
if(frappe.model.can_create(doctype)) {
|
||||
r.results.push({
|
||||
value: "<i class='icon-plus'></i> <em>" + __("Create a new {0}", [me.df.options]) + "</em>",
|
||||
value: "<i class='icon-plus'></i> <em>" + __("Create a new {0}", [__(me.df.options)]) + "</em>",
|
||||
make_new: true
|
||||
});
|
||||
};
|
||||
|
|
@ -937,9 +937,9 @@ frappe.ui.form.ControlLink = frappe.ui.form.ControlData.extend({
|
|||
}
|
||||
}
|
||||
}).data('ui-autocomplete')._renderItem = function(ul, d) {
|
||||
var html = "<strong>" + d.value + "</strong>";
|
||||
var html = "<strong>" + __(d.value) + "</strong>";
|
||||
if(d.description && d.value!==d.description) {
|
||||
html += '<br><span class="small">' + d.description + '</span>';
|
||||
html += '<br><span class="small">' + __(d.description) + '</span>';
|
||||
}
|
||||
return $('<li></li>')
|
||||
.data('item.autocomplete', d)
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
// MIT License. See license.txt
|
||||
|
||||
frappe.ui.form.LinkSelector = Class.extend({
|
||||
_help: "Dialog box to select a Link Value",
|
||||
_help: __("Dialog box to select a Link Value"),
|
||||
init: function(opts) {
|
||||
/* help: Options: doctype, get_query, target */
|
||||
$.extend(this, opts);
|
||||
|
|
@ -18,7 +18,7 @@ frappe.ui.form.LinkSelector = Class.extend({
|
|||
},
|
||||
make: function() {
|
||||
this.dialog = new frappe.ui.Dialog({
|
||||
title: "Select " + (this.doctype=='[Select]' ? "Value" : this.doctype),
|
||||
title: __("Select ") + (this.doctype=='[Select]' ? __("Value") : __(this.doctype)),
|
||||
fields: [
|
||||
{
|
||||
fieldtype: "Data", fieldname: "txt", label: __("Beginning with"),
|
||||
|
|
@ -28,7 +28,7 @@ frappe.ui.form.LinkSelector = Class.extend({
|
|||
fieldtype: "HTML", fieldname: "results"
|
||||
}
|
||||
],
|
||||
primary_action_label: "Search",
|
||||
primary_action_label: __("Search"),
|
||||
primary_action: function() {
|
||||
me.search();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,19 +12,19 @@ $.extend(frappe.model, {
|
|||
std_fields_list: ['name', 'owner', 'creation', 'modified', 'modified_by',
|
||||
'_user_tags', '_comments', 'docstatus', 'parent', 'parenttype', 'parentfield', 'idx'],
|
||||
std_fields: [
|
||||
{fieldname:'name', fieldtype:'Link', label:'ID'},
|
||||
{fieldname:'owner', fieldtype:'Data', label:'Created By'},
|
||||
{fieldname:'idx', fieldtype:'Int', label:'Index'},
|
||||
{fieldname:'creation', fieldtype:'Date', label:'Created On'},
|
||||
{fieldname:'modified', fieldtype:'Date', label:'Last Updated On'},
|
||||
{fieldname:'modified_by', fieldtype:'Data', label:'Last Updated By'},
|
||||
{fieldname:'_user_tags', fieldtype:'Data', label:'Tags'},
|
||||
{fieldname:'_comments', fieldtype:'Text', label:'Comments'},
|
||||
{fieldname:'docstatus', fieldtype:'Int', label:'Document Status'},
|
||||
{fieldname:'name', fieldtype:'Link', label:__('ID')},
|
||||
{fieldname:'owner', fieldtype:'Data', label:__('Created By')},
|
||||
{fieldname:'idx', fieldtype:'Int', label:__('Index')},
|
||||
{fieldname:'creation', fieldtype:'Date', label:__('Created On')},
|
||||
{fieldname:'modified', fieldtype:'Date', label:__('Last Updated On')},
|
||||
{fieldname:'modified_by', fieldtype:'Data', label:__('Last Updated By')},
|
||||
{fieldname:'_user_tags', fieldtype:'Data', label:__('Tags')},
|
||||
{fieldname:'_comments', fieldtype:'Text', label:__('Comments')},
|
||||
{fieldname:'docstatus', fieldtype:'Int', label:__('Document Status')},
|
||||
],
|
||||
|
||||
std_fields_table: [
|
||||
{fieldname:'parent', fieldtype:'Data', label:'Parent'},
|
||||
{fieldname:'parent', fieldtype:'Data', label:__('Parent')},
|
||||
],
|
||||
|
||||
new_names: {},
|
||||
|
|
@ -368,11 +368,11 @@ $.extend(frappe.model, {
|
|||
|
||||
rename_doc: function(doctype, docname, callback) {
|
||||
var d = new frappe.ui.Dialog({
|
||||
title: "Rename " + docname,
|
||||
title: __("Rename ") + __(docname),
|
||||
fields: [
|
||||
{label:"New Name", fieldtype:"Data", reqd:1},
|
||||
{label:"Merge with existing", fieldtype:"Check", fieldname:"merge"},
|
||||
{label:"Rename", fieldtype: "Button"}
|
||||
{label:__("New Name"), fieldtype:"Data", reqd:1},
|
||||
{label:__("Merge with existing"), fieldtype:"Check", fieldname:"merge"},
|
||||
{label:__("Rename"), fieldtype: "Button"}
|
||||
]
|
||||
});
|
||||
d.get_input("rename").on("click", function() {
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ frappe.ui.Listing = Class.extend({
|
|||
|
||||
// hide-refresh
|
||||
if(!(this.hide_refresh || this.no_refresh)) {
|
||||
this.add_button('Refresh', function() {
|
||||
this.add_button(__('Refresh'), function() {
|
||||
me.run();
|
||||
}, 'icon-refresh');
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ frappe.ui.TagEditor = Class.extend({
|
|||
this.$tags = $('<ul>').prependTo(this.$w).tagit({
|
||||
animate: false,
|
||||
allowSpaces: true,
|
||||
placeholderText: 'Add Tag',
|
||||
placeholderText: __('Add Tag'),
|
||||
onTagAdded: function(ev, tag) {
|
||||
if(me.initialized && !me.refreshing) {
|
||||
return frappe.call({
|
||||
|
|
|
|||
|
|
@ -31,10 +31,10 @@ frappe.ui.toolbar.RecentDocs = Class.extend({
|
|||
var html = repl('<li data-docref="%(dt)s/%(dn)s">\
|
||||
<a href="#Form/%(dt_encoded)s/%(dn_encoded)s">\
|
||||
<i class="icon-fixed-width %(icon)s"></i> \
|
||||
%(dn)s</span>\
|
||||
%(dnshow)s</span>\
|
||||
</a></li>',
|
||||
{dt_encoded:encodeURIComponent(dt), dn_encoded:encodeURIComponent(dn),
|
||||
dt: dt, dn: dn, icon:frappe.boot.doctype_icons[dt]});
|
||||
dt: dt, dn: dn,dnshow:__(dn), icon:frappe.boot.doctype_icons[dt]});
|
||||
if(on_top) {
|
||||
$('#toolbar-recent').prepend(html);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -194,7 +194,7 @@ frappe.ui.toolbar.update_notifications = function() {
|
|||
<span class="badge pull-right">\
|
||||
%(count)s</span> \
|
||||
<i class="icon-fixed-width %(icon)s"></i> %(module)s </a></li>', {
|
||||
module: module,
|
||||
module: __(module),
|
||||
count: count,
|
||||
icon: frappe.modules[module].icon
|
||||
}))
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ frappe.views.CommunicationList = Class.extend({
|
|||
clear_list: function() {
|
||||
this.body.remove();
|
||||
$("<p class='text-muted'>" + __("No Communication tagged with this ")
|
||||
+ this.doc.doctype +" yet.</p>").appendTo(this.wrapper);
|
||||
+ __(this.doc.doctype) + __(" yet.") + "</p>").appendTo(this.wrapper);
|
||||
},
|
||||
make_body: function() {
|
||||
$(this.parent)
|
||||
|
|
@ -59,7 +59,7 @@ frappe.views.CommunicationList = Class.extend({
|
|||
var subject = this.doc.subject;
|
||||
if(!subject && this.list.length) {
|
||||
// get subject from previous message
|
||||
subject = this.list[0].subject || "[No Subject]";
|
||||
subject = this.list[0].subject || __("[No Subject]");
|
||||
if(strip(subject.toLowerCase().split(":")[0])!="re") {
|
||||
subject = "Re: " + subject;
|
||||
}
|
||||
|
|
@ -74,13 +74,13 @@ frappe.views.CommunicationList = Class.extend({
|
|||
prepare: function(doc) {
|
||||
//doc.when = comment_when(this.doc.modified);
|
||||
doc.when = comment_when(doc.creation);
|
||||
if(!doc.content) doc.content = "[no content]";
|
||||
if(!doc.content) doc.content = __("[no content]");
|
||||
if(!frappe.utils.is_html(doc.content)) {
|
||||
doc.content = doc.content.replace(/\n/g, "<br>");
|
||||
}
|
||||
doc.content = frappe.utils.remove_script_and_style(doc.content);
|
||||
|
||||
if(!doc.sender) doc.sender = "[unknown sender]";
|
||||
if(!doc.sender) doc.sender = __("[unknown sender]");
|
||||
doc._sender = doc.sender.replace(/</, "<").replace(/>/, ">");
|
||||
doc._sender_id = doc.sender.indexOf("<")!== -1 ?
|
||||
strip(doc.sender.split("<")[1].split(">")[0]) : doc.sender;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue