forked from 0x2620/oxjs
add localization to Ox
This commit is contained in:
parent
b68b827d7b
commit
4d8c716d0b
31 changed files with 499 additions and 352 deletions
|
|
@ -28,7 +28,7 @@ Ox.DocPage = function(options, self) {
|
|||
|
||||
self.$homeButton = Ox.Button({
|
||||
title: 'home',
|
||||
tooltip: 'Home',
|
||||
tooltip: Ox._('Home'),
|
||||
type: 'image'
|
||||
})
|
||||
.css({float: 'left', margin: '4px 2px 4px 4px'})
|
||||
|
|
@ -56,7 +56,7 @@ Ox.DocPage = function(options, self) {
|
|||
if (self.options.item.examples) {
|
||||
self.$examplesMenu = Ox.MenuButton({
|
||||
items: self.options.item.examples,
|
||||
title: 'Examples...',
|
||||
title: Ox._('Examples...'),
|
||||
})
|
||||
.css({float: 'right', margin: '4px 4px 4px 2px'})
|
||||
.bindEvent({
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ Ox.DocPanel = function(options, self) {
|
|||
.appendTo(self.$toolbar);
|
||||
if (!self.options.results) {
|
||||
self.options.results = {};
|
||||
self.$testsButton = Ox.Button({title: 'Run Tests'})
|
||||
self.$testsButton = Ox.Button({title: Ox._('Run Tests')})
|
||||
.css({margin: '4px auto'})
|
||||
.bindEvent({click: runTests})
|
||||
.appendTo(self.$toolbar);
|
||||
|
|
@ -152,7 +152,7 @@ Ox.DocPanel = function(options, self) {
|
|||
var path = self.options.examplesPath + example;
|
||||
Ox.get(path + '/index.html', function(html) {
|
||||
var match = html.match(/<title>(.+)<\/title>/),
|
||||
title = match ? match[1] : 'Untitled';
|
||||
title = match ? match[1] : Ox._('Untitled');
|
||||
Ox.get(path + '/js/example.js', function(js) {
|
||||
var references = js.match(self.options.references);
|
||||
if (references) {
|
||||
|
|
@ -386,7 +386,7 @@ Ox.DocPanel = function(options, self) {
|
|||
width: 256,
|
||||
textAlign: 'center'
|
||||
})
|
||||
.html('Generating Documentation...')
|
||||
.html(Ox._('Generating Documentation...'))
|
||||
.appendTo(self.$page);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ Ox.ExamplePage = function(options, self) {
|
|||
|
||||
self.$homeButton = Ox.Button({
|
||||
title: 'home',
|
||||
tooltip: 'Home',
|
||||
tooltip: Ox._('Home'),
|
||||
type: 'image'
|
||||
})
|
||||
.css({float: 'left', margin: '4px 2px 4px 4px'})
|
||||
|
|
@ -54,7 +54,7 @@ Ox.ExamplePage = function(options, self) {
|
|||
self.$openButton = Ox.Button({
|
||||
disabled: self.options.selected == 'source',
|
||||
title: 'open',
|
||||
tooltip: 'Open in New Tab',
|
||||
tooltip: Ox._('Open in New Tab'),
|
||||
type: 'image'
|
||||
})
|
||||
.css({float: 'right', margin: '4px 4px 4px 2px'})
|
||||
|
|
@ -68,7 +68,7 @@ Ox.ExamplePage = function(options, self) {
|
|||
self.$reloadButton = Ox.Button({
|
||||
disabled: self.options.selected == 'source',
|
||||
title: 'redo',
|
||||
tooltip: 'Reload',
|
||||
tooltip: Ox._('Reload'),
|
||||
type: 'image'
|
||||
})
|
||||
.css({float: 'right', margin: '4px 2px 4px 2px'})
|
||||
|
|
@ -82,7 +82,7 @@ Ox.ExamplePage = function(options, self) {
|
|||
self.$switchButton = Ox.Button({
|
||||
disabled: self.options.selected == 'source',
|
||||
title: 'switch',
|
||||
tooltip: 'Switch Theme',
|
||||
tooltip: Ox._('Switch Theme'),
|
||||
type: 'image'
|
||||
})
|
||||
.css({float: 'right', margin: '4px 2px 4px 2px'})
|
||||
|
|
@ -104,12 +104,12 @@ Ox.ExamplePage = function(options, self) {
|
|||
buttons: [
|
||||
{
|
||||
id: 'source',
|
||||
title: 'View Source',
|
||||
title: Ox._('View Source'),
|
||||
width: 80
|
||||
},
|
||||
{
|
||||
id: 'live',
|
||||
title: 'View Live',
|
||||
title: Ox._('View Live'),
|
||||
width: 80
|
||||
}
|
||||
],
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ Ox.ExamplePanel = function(options, self) {
|
|||
var match = html.match(/<title>(.+)<\/title>/);
|
||||
item.title = match ? match[1] : 'Untitled';
|
||||
match = html.match(/<meta http-equiv="Keywords" content="(.+)"\/>/);
|
||||
item.sectionTitle = match ? match[1] : 'Untitled';
|
||||
item.sectionTitle = match ? match[1] : Ox._('Untitled');
|
||||
Ox.get(item.js, function(js) {
|
||||
var references = js.match(self.options.references);
|
||||
item.references = references ? Ox.unique(references).sort(function(a, b) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue