Browse Source

in templates, gettext() -> {% trans %}

Natenom/support-murmur-13-1446181288462
Michael Ziegler 14 years ago
parent
commit
45bb7759b1
  1. 18
      pyweb/mumble/templates/mumble/list.html
  2. 34
      pyweb/mumble/templates/mumble/mumble.html

18
pyweb/mumble/templates/mumble/list.html

@ -19,19 +19,19 @@
renderTo: document.body, renderTo: document.body,
height: 600, height: 600,
layout: "border", layout: "border",
title: gettext("Mumble Servers"),
title: "{% trans 'Mumble Servers' %}",
buttons: [ buttons: [
{% if user.is_staff and "rosetta" in INSTALLED_APPS %} {% if user.is_staff and "rosetta" in INSTALLED_APPS %}
{ {
xtype: 'buttonIframeWindow', xtype: 'buttonIframeWindow',
text: gettext('Edit Translation'),
text: "{% trans 'Edit Translation' %}",
url: '{% url rosetta-home %}', url: '{% url rosetta-home %}',
}, },
{% endif %} {% endif %}
{% if user.is_staff %} {% if user.is_staff %}
{ {
xtype: 'buttonIframeWindow', xtype: 'buttonIframeWindow',
text: gettext('Administration'),
text: "{% trans 'Administration' %}",
url: '{% url admin:app_list "mumble" %}', url: '{% url admin:app_list "mumble" %}',
}, },
{% endif %} {% endif %}
@ -43,7 +43,7 @@
], ],
items: [{ items: [{
xtype: "listview", xtype: "listview",
title: gettext("Available servers"),
title: "{% trans 'Available servers' %}",
ref: "serverlist", ref: "serverlist",
region: "west", region: "west",
width: 350, width: 350,
@ -65,7 +65,7 @@
} }
}), }),
columns: [{ columns: [{
header: gettext("Name"),
header: "{% trans 'Name' %}",
dataIndex: "name", dataIndex: "name",
width: 1. width: 1.
}], }],
@ -80,7 +80,7 @@
if( response.result.booted ) if( response.result.booted )
var info = renderserverinfos(response.result); var info = renderserverinfos(response.result);
else else
var info = gettext("This server is currently offline.");
var info = "{% trans 'This server is currently offline.' %}";
mainpanel.descrippanel.el.dom.children[1].children[0].innerHTML = info; mainpanel.descrippanel.el.dom.children[1].children[0].innerHTML = info;
}); });
} }
@ -88,11 +88,11 @@
}, { }, {
xtype: "panel", xtype: "panel",
region: "center", region: "center",
title: gettext("Server overview"),
title: "{% trans 'Server overview' %}",
ref: 'descrippanel', ref: 'descrippanel',
html: gettext("Loading..."),
html: "{% trans 'Loading...' %}",
buttons: [{ buttons: [{
text: gettext('Server details'),
text: "{% trans 'Server details' %}",
handler: function( button, state ){ handler: function( button, state ){
location.href = mainpanel.selectedServer.detailsurl; location.href = mainpanel.selectedServer.detailsurl;
} }

34
pyweb/mumble/templates/mumble/mumble.html

@ -37,7 +37,7 @@
height: 600, height: 600,
layout: "border", layout: "border",
tbar: [ { tbar: [ {
text: gettext("Back to the server list"),
text: "{% trans "Back to the server list" %}",
xtype: "button", xtype: "button",
handler: function(){ handler: function(){
location.href = "{% url mumble.views.mumbles %}"; location.href = "{% url mumble.views.mumbles %}";
@ -47,14 +47,14 @@
{% if user.is_staff and "rosetta" in INSTALLED_APPS %} {% if user.is_staff and "rosetta" in INSTALLED_APPS %}
{ {
xtype: 'buttonIframeWindow', xtype: 'buttonIframeWindow',
text: gettext('Edit Translation'),
text: "{% trans 'Edit Translation' %}",
url: '{% url rosetta-home %}' url: '{% url rosetta-home %}'
}, },
{% endif %} {% endif %}
{% if user.is_staff %} {% if user.is_staff %}
{ {
xtype: 'buttonIframeWindow', xtype: 'buttonIframeWindow',
text: gettext('Administration'),
text: "{% trans 'Administration' %}",
url: '{% url admin:mumble_mumble_change MumbleServer.id %}' url: '{% url admin:mumble_mumble_change MumbleServer.id %}'
}, },
{% endif %} {% endif %}
@ -64,7 +64,7 @@
{% if 'registration' in INSTALLED_APPS %} {% if 'registration' in INSTALLED_APPS %}
{ {
xtype: 'buttonIframeWindow', xtype: 'buttonIframeWindow',
text: gettext('Register'),
text: "{% trans 'Register' %}",
url: '{% url registration.views.register %}' url: '{% url registration.views.register %}'
}, },
{% endif %} {% endif %}
@ -104,7 +104,7 @@
enableTabScroll: true, enableTabScroll: true,
plugins: [ new Ext.ux.TabScrollerMenu() ], plugins: [ new Ext.ux.TabScrollerMenu() ],
items: [{ items: [{
title: gettext("Server info"),
title: "{% trans "Server info" %}",
{% if QRAvailable %} {% if QRAvailable %}
html: ('<img src="{% url mumble.views.qrcode MumbleServer.id %}" ' + html: ('<img src="{% url mumble.views.qrcode MumbleServer.id %}" ' +
'style="float: right" alt="QR Code for embedded view"/>' + 'style="float: right" alt="QR Code for embedded view"/>' +
@ -115,7 +115,7 @@
} }
{% if user.is_authenticated %}, {% if user.is_authenticated %},
{ {
title: gettext("Registration"),
title: "{% trans "Registration" %}",
xtype: "{{ RegForm|lower }}", xtype: "{{ RegForm|lower }}",
pk: {% if MumbleAccount %}{{ MumbleAccount.id }}{% else %}-1{% endif %}, pk: {% if MumbleAccount %}{{ MumbleAccount.id }}{% else %}-1{% endif %},
labelWidth: 150, labelWidth: 150,
@ -133,7 +133,7 @@
id: 'content-anchor-tip', id: 'content-anchor-tip',
target: '{{ RegForm }}_submit', target: '{{ RegForm }}_submit',
anchor: 'right', anchor: 'right',
html: gettext("Saved successfully."),
html: "{% trans "Saved successfully." %}",
width: 150, width: 150,
autoHide: true, autoHide: true,
listeners: { listeners: {
@ -150,7 +150,7 @@
}, },
{% if IsAdmin %} {% if IsAdmin %}
{ {
title: gettext("Administration"),
title: "{% trans "Administration" %}",
pk: {{ MumbleServer.id }}, pk: {{ MumbleServer.id }},
labelWidth: 150, labelWidth: 150,
xtype: 'mumbleform', xtype: 'mumbleform',
@ -160,7 +160,7 @@
id: 'content-anchor-tip', id: 'content-anchor-tip',
target: 'MumbleForm_submit', target: 'MumbleForm_submit',
anchor: 'right', anchor: 'right',
html: gettext("Saved successfully."),
html: "{% trans "Saved successfully." %}",
width: 150, width: 150,
autoHide: true, autoHide: true,
listeners: { listeners: {
@ -177,11 +177,9 @@
{% endif %} {% endif %}
{% if MumbleAccount %} {% if MumbleAccount %}
{ {
title: gettext("User texture"),
title: "{% trans "User texture" %}",
{% if MumbleServer|mmversion_eq:"1.2.2" %} {% if MumbleServer|mmversion_eq:"1.2.2" %}
html: gettext(
'Sorry, due to a bug in Murmur 1.2.2, displaying and setting the Texture is disabled.'
)
html: "{% trans 'Sorry, due to a bug in Murmur 1.2.2, displaying and setting the Texture is disabled.' %}"
{% else %} {% else %}
layout: "border", layout: "border",
items: [{ items: [{
@ -191,13 +189,13 @@
items: [{ items: [{
flex: 1, flex: 1,
height: 200, height: 200,
title: gettext("Texture"),
title: "{% trans "Texture" %}",
html: String.format('<img src="{0}" alt="Avatar" id="img_avatar" />', html: String.format('<img src="{0}" alt="Avatar" id="img_avatar" />',
"{% url mumble.views.showTexture MumbleServer.id MumbleAccount.mumbleid %}") "{% url mumble.views.showTexture MumbleServer.id MumbleAccount.mumbleid %}")
}, { }, {
flex: 1, flex: 1,
height: 200, height: 200,
title: gettext("Gravatar"),
title: "{% trans "Gravatar" %}",
html: String.format('<img src="{0}" alt="grAvatar" />', "{{ MumbleAccount.gravatar }}") html: String.format('<img src="{0}" alt="grAvatar" />', "{{ MumbleAccount.gravatar }}")
}] }]
}, { }, {
@ -208,16 +206,16 @@
url: "{% url mumble.views.update_avatar MumbleAccount.id %}", url: "{% url mumble.views.update_avatar MumbleAccount.id %}",
items: [{ items: [{
name: "usegravatar", name: "usegravatar",
fieldLabel: gettext("Use Gravatar"),
fieldLabel: "{% trans "Use Gravatar" %}",
xtype: "checkbox" xtype: "checkbox"
}, { }, {
name: "texturefile", name: "texturefile",
fieldLabel: gettext("Upload Avatar"),
fieldLabel: "{% trans "Upload Avatar" %}",
xtype: "textfield", xtype: "textfield",
inputType: "file" inputType: "file"
}], }],
buttons: [{ buttons: [{
text: gettext('Submit'),
text: "{% trans 'Submit' %}",
handler: function(){ handler: function(){
this.ownerCt.ownerCt.getForm().submit({ this.ownerCt.ownerCt.getForm().submit({
success: function(form, action){ success: function(form, action){

Loading…
Cancel
Save