Browse Source

Merge branch 'js-translations'

This also cleans up some lint errors
Armin Ronacher 9 years ago
parent
commit
e3a63cc5da

+ 3 - 2
package.json

@@ -55,7 +55,6 @@
     "babel-core": "5.8.33",
     "babel-gettext-extractor": "^1.0.0",
     "babel-loader": "5.3.3",
-    "po-catalog-loader": "^1.0.0",
     "chai": "3.4.1",
     "js-cookie": "2.0.4",
     "karma": "0.13.15",
@@ -66,7 +65,9 @@
     "karma-sourcemap-loader": "0.3.6",
     "karma-webpack": "1.7.0",
     "platformicons": "0.0.7",
+    "po-catalog-loader": "^1.0.0",
     "sinon": "1.17.2",
-    "sinon-chai": "2.8.0"
+    "sinon-chai": "2.8.0",
+    "sprintf-js": "^1.0.3"
   }
 }

BIN
src/sentry/locale/en/LC_MESSAGES/django.mo


File diff suppressed because it is too large
+ 470 - 69
src/sentry/locale/en/LC_MESSAGES/django.po


+ 2 - 1
src/sentry/static/sentry/app/components/alertMessage.jsx

@@ -1,6 +1,7 @@
 import React from 'react';
 import AlertActions from '../actions/alertActions';
 import PureRenderMixin from 'react-addons-pure-render-mixin';
+import {t} from '../locale';
 
 const AlertMessage = React.createClass({
   propTypes: {
@@ -23,7 +24,7 @@ const AlertMessage = React.createClass({
     return (
       <div className={className}>
         <div className="container">
-          <button type="button" className="close" aria-label="Close"
+          <button type="button" className="close" aria-label={t('Close')}
                   onClick={this.closeAlert}>
             <span aria-hidden="true">&times;</span>
           </button>

+ 4 - 1
src/sentry/static/sentry/app/components/clippedBox.jsx

@@ -1,5 +1,6 @@
 import React from 'react';
 import ReactDOM from 'react-dom';
+import {t} from '../locale';
 
 const ClippedBox = React.createClass({
   propTypes: {
@@ -52,7 +53,9 @@ const ClippedBox = React.createClass({
         }
         {this.props.children}
         <div className="clip-fade">
-          <a onClick={this.reveal} className="show-more btn btn-primary btn-xs">Show more</a>
+          <a onClick={this.reveal} className="show-more btn btn-primary btn-xs">
+            {t('Show more')}
+          </a>
         </div>
       </div>
     );

+ 2 - 1
src/sentry/static/sentry/app/components/events/errorItem.jsx

@@ -1,4 +1,5 @@
 import React from 'react';
+import {t} from '../../locale';
 
 const EventErrorItem = React.createClass({
   getInitialState(){
@@ -21,7 +22,7 @@ const EventErrorItem = React.createClass({
     return (
       <li>
         {error.message}
-        <small> <a style={{marginLeft: 10}} onClick={this.toggle}>{isOpen ? 'Collapse' : 'Expand'}</a></small>
+        <small> <a style={{marginLeft: 10}} onClick={this.toggle}>{isOpen ? t('Collapse') : t('Expand')}</a></small>
         <pre style={{display: isOpen ? 'block' : 'none'}}>{JSON.stringify(error.data, null, 2)}</pre>
       </li>
     );

+ 7 - 2
src/sentry/static/sentry/app/components/events/errors.jsx

@@ -3,6 +3,7 @@ import React from 'react';
 import EventDataSection from './eventDataSection';
 import EventErrorItem from './errorItem';
 import PropTypes from '../../proptypes';
+import {t, tn} from '../../locale';
 
 const EventErrors = React.createClass({
   propTypes: {
@@ -38,8 +39,12 @@ const EventErrors = React.createClass({
           type="errors"
           className="errors">
         <p>
-          <a className="pull-right" onClick={this.toggle}>{isOpen ? 'Hide' : 'Show'}</a>
-          There {numErrors != 1 ? ('were ' + numErrors + ' errors') : 'was 1 error'} encountered while processing this event.
+          <a className="pull-right" onClick={this.toggle}>{isOpen ? t('Hide') : t('Show')}</a>
+          {
+            tn('There was 1 error encountered while processing this event',
+               'There were %d errors encountered while processing this event',
+               numErrors)
+          }
         </p>
         <ul style={{display: isOpen ? 'block' : 'none'}}>
           {errors.map((error, errorIdx) => {

+ 2 - 1
src/sentry/static/sentry/app/components/events/eventTags.jsx

@@ -6,6 +6,7 @@ import PropTypes from '../../proptypes';
 
 import EventDataSection from './eventDataSection';
 import {isUrl} from '../../utils';
+import {t} from '../../locale';
 
 const EventTags = React.createClass({
   propTypes: {
@@ -25,7 +26,7 @@ const EventTags = React.createClass({
       <EventDataSection
           group={this.props.group}
           event={this.props.event}
-          title="Tags"
+          title={t('Tags')}
           type="tags">
         <ul className="mini-tag-list">
           {tags.map((tag) => {

+ 2 - 1
src/sentry/static/sentry/app/components/events/extraData.jsx

@@ -4,6 +4,7 @@ import PropTypes from '../../proptypes';
 import {objectToArray} from '../../utils';
 import EventDataSection from './eventDataSection';
 import KeyValueList from './interfaces/keyValueList';
+import {t} from '../../locale';
 
 const EventExtraData = React.createClass({
   propTypes: {
@@ -23,7 +24,7 @@ const EventExtraData = React.createClass({
           group={this.props.group}
           event={this.props.event}
           type="extra"
-          title="Additional Data">
+          title={t('Additional Data')}>
           <KeyValueList
               data={extraDataArray}
               isContextData={true}/>

+ 5 - 4
src/sentry/static/sentry/app/components/events/interfaces/csp.jsx

@@ -4,6 +4,7 @@ import PropTypes from '../../../proptypes';
 import GroupEventDataSection from '../eventDataSection';
 import CSPContent from './cspContent';
 import CSPHelp from './cspHelp';
+import {t} from '../../../locale';
 
 function getView(view, data) {
   switch (view) {
@@ -50,11 +51,11 @@ const CSPInterface = React.createClass({
     var title = (
       <div>
         <div className="btn-group">
-          <a className={(view === 'report' ? 'active' : '') + ' btn btn-default btn-sm'} onClick={this.toggleView.bind(this, 'report')}>Report</a>
-          <a className={(view === 'raw' ? 'active' : '') + ' btn btn-default btn-sm'} onClick={this.toggleView.bind(this, 'raw')}>Raw</a>
-          <a className={(view === 'help' ? 'active' : '') + ' btn btn-default btn-sm'} onClick={this.toggleView.bind(this, 'help')}>Help</a>
+          <a className={(view === 'report' ? 'active' : '') + ' btn btn-default btn-sm'} onClick={this.toggleView.bind(this, 'report')}>{t('Report')}</a>
+          <a className={(view === 'raw' ? 'active' : '') + ' btn btn-default btn-sm'} onClick={this.toggleView.bind(this, 'raw')}>{t('Raw')}</a>
+          <a className={(view === 'help' ? 'active' : '') + ' btn btn-default btn-sm'} onClick={this.toggleView.bind(this, 'help')}>{t('Help')}</a>
         </div>
-        <h3>{'CSP Report'}</h3>
+        <h3>{t('CSP Report')}</h3>
       </div>
     );
 

Some files were not shown because too many files changed in this diff