mirror of
https://github.com/ascribe/onion.git
synced 2024-12-22 17:33:14 +01:00
add german language file and integrated translation method
This commit is contained in:
parent
347517a0b3
commit
3183dae054
@ -2,6 +2,7 @@ import React from 'react';
|
||||
|
||||
import AccordionListItemTable from './accordion_list_item_table';
|
||||
|
||||
import { getLangText } from '../../utils/lang_utils';
|
||||
|
||||
let AccordionListItem = React.createClass({
|
||||
propTypes: {
|
||||
@ -19,7 +20,7 @@ let AccordionListItem = React.createClass({
|
||||
</div>
|
||||
<div className="info-wrapper">
|
||||
<h1>{this.props.content.title}</h1>
|
||||
<h3>by {this.props.content.artist_name}</h3>
|
||||
<h3>{getLangText('by %s', this.props.content.artist_name)}</h3>
|
||||
</div>
|
||||
<span style={{'clear': 'both'}}></span>
|
||||
</div>
|
||||
|
@ -1,6 +1,8 @@
|
||||
import React from 'react';
|
||||
import Router from 'react-router';
|
||||
|
||||
import { getLangText } from '../../utils/lang_utils';
|
||||
|
||||
let Link = Router.Link;
|
||||
|
||||
let PaginationButton = React.createClass({
|
||||
@ -25,14 +27,14 @@ let PaginationButton = React.createClass({
|
||||
page -= 1;
|
||||
directionDisplay = (
|
||||
<span>
|
||||
<span aria-hidden="true">←</span> Previous
|
||||
<span aria-hidden="true">←</span> {getLangText('Previous')}
|
||||
</span>
|
||||
);
|
||||
} else {
|
||||
page += 1;
|
||||
directionDisplay = (
|
||||
<span>
|
||||
Next <span aria-hidden="true">→</span>
|
||||
{getLangText('Next')} <span aria-hidden="true">→</span>
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
@ -11,6 +11,8 @@ import NavItem from 'react-bootstrap/lib/NavItem';
|
||||
import DropdownButton from 'react-bootstrap/lib/DropdownButton';
|
||||
import MenuItem from 'react-bootstrap/lib/MenuItem';
|
||||
|
||||
import { getLangText } from '../utils/lang_utils';
|
||||
|
||||
let Link = Router.Link;
|
||||
|
||||
let Header = React.createClass({
|
||||
@ -39,12 +41,12 @@ let Header = React.createClass({
|
||||
</Nav>
|
||||
<Nav right>
|
||||
<DropdownButton eventKey={3} title={this.state.currentUser.username}>
|
||||
<MenuItem eventKey="1" href="/art/account_settings/">Account Settings</MenuItem>
|
||||
<MenuItem eventKey="1" href="/art/account_settings/">{getLangText('Account Settings')}</MenuItem>
|
||||
<li className="divider"></li>
|
||||
<MenuItem eventKey="2" href="/art/faq/">FAQ</MenuItem>
|
||||
<MenuItem eventKey="3" href="/art/terms/">Terms of Service</MenuItem>
|
||||
<MenuItem eventKey="2" href="/art/faq/">{getLangText('FAQ')}</MenuItem>
|
||||
<MenuItem eventKey="3" href="/art/terms/">{getLangText('Terms of Service')}</MenuItem>
|
||||
<MenuItem divider />
|
||||
<MenuItem eventKey="4" href="/api/users/logout/">Log out</MenuItem>
|
||||
<MenuItem eventKey="4" href="/api/users/logout/">{getLangText('Log out')}</MenuItem>
|
||||
</DropdownButton>
|
||||
</Nav>
|
||||
</Navbar>
|
||||
|
@ -3,7 +3,27 @@ const languages = {
|
||||
'Bitcoin Address': 'Bitcoin Address',
|
||||
'Actions': 'Actions',
|
||||
'Hide all %d Editions': 'Hide all %d Editions',
|
||||
'Show all %d Editions': 'Show all %d Editions'
|
||||
'Show all %d Editions': 'Show all %d Editions',
|
||||
'by %s': 'by %s',
|
||||
'Account Settings': 'Account Settings',
|
||||
'FAQ': 'FAQ',
|
||||
'Terms of Service': 'Terms of Service',
|
||||
'Log out': 'Log out',
|
||||
'Previous': 'Previous',
|
||||
'Next': 'Next'
|
||||
},
|
||||
'de': {
|
||||
'Bitcoin Address': 'Bitcoin Adresse',
|
||||
'Actions': 'Aktionen',
|
||||
'Hide all %d Editions': 'Zeige all %d Editionen an',
|
||||
'Show all %d Editions': 'Verstecke alle %d Editionen',
|
||||
'by %s': 'von %s',
|
||||
'Account Settings': 'Kontoeinstellungen',
|
||||
'FAQ': 'Fragen & Antworten',
|
||||
'Terms of Service': 'AGB',
|
||||
'Log out': 'Log out',
|
||||
'Previous': 'Zurück',
|
||||
'Next': 'Weiter'
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -4,7 +4,6 @@ import { formatText } from './general_utils';
|
||||
|
||||
export function getLangText(s, ...args) {
|
||||
let lang = navigator.language || navigator.userLanguage;
|
||||
|
||||
try {
|
||||
if(lang in languages) {
|
||||
return formatText(languages[lang][s], args);
|
||||
|
Loading…
Reference in New Issue
Block a user