General cleanup

This commit is contained in:
Matthew Taylor 2015-10-16 15:10:27 -04:00
parent 7b704e878f
commit 58ef98016a
4 changed files with 224 additions and 163 deletions

View file

@ -11,7 +11,7 @@ require('./activity.scss');
var defaultMessages = defineMessages({
whatsHappening: {
id: 'general.whatsHappening',
defaultMessage: 'What\s Happening?'
defaultMessage: 'What\'s Happening?'
}
});

View file

@ -17,36 +17,48 @@ var Footer = React.createClass({
id='general.about'
defaultMessage={'About'} />
</dt>
<dd><a href="/about/">
<FormattedMessage
id='footer.about'
defaultMessage={'About Scratch'} />
</a></dd>
<dd><a href="/parents/">
<FormattedMessage
id='general.forParents'
defaultMessage={'For Parents'} />
</a></dd>
<dd><a href="/educators/">
<FormattedMessage
id='general.forEducators'
defaultMessage={'For Educators'} />
</a></dd>
<dd><a href="/info/credits/">
<FormattedMessage
id='general.credits'
defaultMessage={'Credits'} />
</a></dd>
<dd><a href="/jobs/">
<FormattedMessage
id='general.jobs'
defaultMessage={'Jobs'} />
</a></dd>
<dd><a href="http://wiki.scratch.mit.edu/wiki/Scratch_Press">
<FormattedMessage
id='general.press'
defaultMessage={'Press'} />
</a></dd>
<dd>
<a href="/about/">
<FormattedMessage
id='footer.about'
defaultMessage={'About Scratch'} />
</a>
</dd>
<dd>
<a href="/parents/">
<FormattedMessage
id='general.forParents'
defaultMessage={'For Parents'} />
</a>
</dd>
<dd>
<a href="/educators/">
<FormattedMessage
id='general.forEducators'
defaultMessage={'For Educators'} />
</a>
</dd>
<dd>
<a href="/info/credits/">
<FormattedMessage
id='general.credits'
defaultMessage={'Credits'} />
</a>
</dd>
<dd>
<a href="/jobs/">
<FormattedMessage
id='general.jobs'
defaultMessage={'Jobs'} />
</a>
</dd>
<dd>
<a href="http://wiki.scratch.mit.edu/wiki/Scratch_Press">
<FormattedMessage
id='general.press'
defaultMessage={'Press'} />
</a>
</dd>
</dl>
<dl>
@ -55,26 +67,34 @@ var Footer = React.createClass({
id='general.communityHeader'
defaultMessage={'Community'} />
</dt>
<dd><a href="/community_guidelines/">
<FormattedMessage
id='general.guidelines'
defaultMessage={'Community Guidelines'} />
</a></dd>
<dd><a href="/discuss/">
<FormattedMessage
id='footer.discuss'
defaultMessage={'Discussion Forums'} />
</a></dd>
<dd><a href="https://wiki.scratch.mit.edu/">
<FormattedMessage
id='general.wiki'
defaultMessage={'Scratch Wiki'} />
</a></dd>
<dd><a href="/statistics/">
<FormattedMessage
id='general.statistics'
defaultMessage={'Statistics'} />
</a></dd>
<dd>
<a href="/community_guidelines/">
<FormattedMessage
id='general.guidelines'
defaultMessage={'Community Guidelines'} />
</a>
</dd>
<dd>
<a href="/discuss/">
<FormattedMessage
id='footer.discuss'
defaultMessage={'Discussion Forums'} />
</a>
</dd>
<dd>
<a href="https://wiki.scratch.mit.edu/">
<FormattedMessage
id='general.wiki'
defaultMessage={'Scratch Wiki'} />
</a>
</dd>
<dd>
<a href="/statistics/">
<FormattedMessage
id='general.statistics'
defaultMessage={'Statistics'} />
</a>
</dd>
</dl>
<dl>
@ -83,31 +103,41 @@ var Footer = React.createClass({
id='general.support'
defaultMessage={'Support'} />
</dt>
<dd><a href="/help/">
<FormattedMessage
id='footer.help'
defaultMessage={'Help Page'} />
</a></dd>
<dd><a href="/info/faq/">
<FormattedMessage
id='general.faq'
defaultMessage={'FAQ'} />
</a></dd>
<dd><a href="/scratch2download/">
<FormattedMessage
id='general.offlineEditor'
defaultMessage={'Offline Editor'} />
</a></dd>
<dd><a href="/contact-us/">
<FormattedMessage
id='general.contactUs'
defaultMessage={'Contact Us'} />
</a></dd>
<dd><a href="https://secure.donationpay.org/codetolearn/">
<FormattedMessage
id='general.donate'
defaultMessage={'Donate'} />
</a></dd>
<dd>
<a href="/help/">
<FormattedMessage
id='footer.help'
defaultMessage={'Help Page'} />
</a>
</dd>
<dd>
<a href="/info/faq/">
<FormattedMessage
id='general.faq'
defaultMessage={'FAQ'} />
</a>
</dd>
<dd>
<a href="/scratch2download/">
<FormattedMessage
id='general.offlineEditor'
defaultMessage={'Offline Editor'} />
</a>
</dd>
<dd>
<a href="/contact-us/">
<FormattedMessage
id='general.contactUs'
defaultMessage={'Contact Us'} />
</a>
</dd>
<dd>
<a href="https://secure.donationpay.org/codetolearn/">
<FormattedMessage
id='general.donate'
defaultMessage={'Donate'} />
</a>
</dd>
</dl>
<dl>
@ -116,22 +146,27 @@ var Footer = React.createClass({
id='general.legal'
defaultMessage={'Legal'} />
</dt>
<dd><a href="/terms_of_use/">
<FormattedMessage
id='general.termsOfUse'
defaultMessage={'Terms of Use'} />
Terms of Use
</a></dd>
<dd><a href="/privacy_policy/">
<FormattedMessage
id='privacyPolicy'
defaultMessage={'Privacy Policy'} />
</a></dd>
<dd><a href="/DMCA/">
<FormattedMessage
id='general.dmca'
defaultMessage={'DMCA'} />
</a></dd>
<dd>
<a href="/terms_of_use/">
<FormattedMessage
id='general.termsOfUse'
defaultMessage={'Terms of Use'} />
</a>
</dd>
<dd>
<a href="/privacy_policy/">
<FormattedMessage
id='privacyPolicy'
defaultMessage={'Privacy Policy'} />
</a>
</dd>
<dd>
<a href="/DMCA/">
<FormattedMessage
id='general.dmca'
defaultMessage={'DMCA'} />
</a>
</dd>
</dl>
<dl>
@ -140,31 +175,41 @@ var Footer = React.createClass({
id='footer.scratchFamily'
defaultMessage={'Scratch Family'} />
</dt>
<dd><a href="http://scratched.gse.harvard.edu/">
<FormattedMessage
id='general.scratchEd'
defaultMessage={'ScratchEd'} />
</a></dd>
<dd><a href="http://www.scratchjr.org/">
<FormattedMessage
id='general.scratchJr'
defaultMessage={'ScratchJr'} />
</a></dd>
<dd><a href="http://day.scratch.mit.edu/">
<FormattedMessage
id='general.scratchday'
defaultMessage={'Scratch Day'} />
</a></dd>
<dd><a href="/conference/">
<FormattedMessage
id='general.scratchConference'
defaultMessage={'Scratch Conference'} />
</a></dd>
<dd><a href="http://www.scratchfoundation.org/">
<FormattedMessage
id='general.scratchFoundation'
defaultMessage={'Scratch Foundation'} />
</a></dd>
<dd>
<a href="http://scratched.gse.harvard.edu/">
<FormattedMessage
id='general.scratchEd'
defaultMessage={'ScratchEd'} />
</a>
</dd>
<dd>
<a href="http://www.scratchjr.org/">
<FormattedMessage
id='general.scratchJr'
defaultMessage={'ScratchJr'} />
</a>
</dd>
<dd>
<a href="http://day.scratch.mit.edu/">
<FormattedMessage
id='general.scratchday'
defaultMessage={'Scratch Day'} />
</a>
</dd>
<dd>
<a href="/conference/">
<FormattedMessage
id='general.scratchConference'
defaultMessage={'Scratch Conference'} />
</a>
</dd>
<dd>
<a href="http://www.scratchfoundation.org/">
<FormattedMessage
id='general.scratchFoundation'
defaultMessage={'Scratch Foundation'} />
</a>
</dd>
</dl>
</div>

View file

@ -123,31 +123,41 @@ var Navigation = React.createClass({
<ul>
<li className="logo"><a href="/"></a></li>
<li className="link create"><a href="/projects/editor">
<FormattedMessage
id="general.create"
defaultMessage={'Create'} />
</a></li>
<li className="link explore"><a href="/explore?date=this_month">
<FormattedMessage
id="general.explore"
defaultMessage={'Explore'} />
</a></li>
<li className="link discuss"><a href="/discuss">
<FormattedMessage
id="general.discuss"
defaultMessage={'Discuss'} />
</a></li>
<li className="link about"><a href="/about">
<FormattedMessage
id="general.about"
defaultMessage={'About'} />
</a></li>
<li className="link help"><a href="/help">
<FormattedMessage
id="general.help"
defaultMessage={'Help'} />
</a></li>
<li className="link create">
<a href="/projects/editor">
<FormattedMessage
id="general.create"
defaultMessage={'Create'} />
</a>
</li>
<li className="link explore">
<a href="/explore?date=this_month">
<FormattedMessage
id="general.explore"
defaultMessage={'Explore'} />
</a>
</li>
<li className="link discuss">
<a href="/discuss">
<FormattedMessage
id="general.discuss"
defaultMessage={'Discuss'} />
</a>
</li>
<li className="link about">
<a href="/about">
<FormattedMessage
id="general.about"
defaultMessage={'About'} />
</a>
</li>
<li className="link help">
<a href="/help">
<FormattedMessage
id="general.help"
defaultMessage={'Help'} />
</a>
</li>
<li className="search">
<form action="/search/google_results" method="get">
@ -161,16 +171,16 @@ var Navigation = React.createClass({
<li className="link right messages" key="messages">
<a
href="/messages/"
title={formatMessage(defaultMessages.messages)}
>
title={formatMessage(defaultMessages.messages)}>
<FormattedMessage {...defaultMessages.messages} />
</a>
</li>,
<li className="link right mystuff" key="mystuff">
<a
href="/mystuff/"
title={formatMessage(defaultMessages.myStuff)}
>
title={formatMessage(defaultMessages.myStuff)}>
<FormattedMessage {...defaultMessages.myStuff} />
</a>
</li>,
@ -183,19 +193,25 @@ var Navigation = React.createClass({
as="ul"
isOpen={this.state.accountNavOpen}
onRequestClose={this.closeAccountNav}>
<li><a href={this.getProfileUrl()}>
<FormattedMessage
id='general.profile'
defaultMessage={'Profile'} />
</a></li>
<li><a href="/mystuff/">
<FormattedMessage {...defaultMessages.myStuff} />
</a></li>
<li><a href="/accounts/settings/">
<FormattedMessage
id='general.accountSettings'
defaultMessage={'Account settings'} />
</a></li>
<li>
<a href={this.getProfileUrl()}>
<FormattedMessage
id='general.profile'
defaultMessage={'Profile'} />
</a>
</li>
<li>
<a href="/mystuff/">
<FormattedMessage {...defaultMessages.myStuff} />
</a>
</li>
<li>
<a href="/accounts/settings/">
<FormattedMessage
id='general.accountSettings'
defaultMessage={'Account settings'} />
</a>
</li>
<li className="divider">
<a href="#" onClick={this.handleLogOut}>
<FormattedMessage

View file

@ -37,7 +37,6 @@ if (!args.length) {
}
var outputFile = path.resolve(__dirname, '../../', args[0]);
// var outputDir = path.resolve(__dirname, '../../messages');
var poUiDir = path.resolve(__dirname, '../../node_modules/scratchr2_translations/ui');
var icuTemplateFile = path.resolve(__dirname, '../../en.json');
@ -52,6 +51,8 @@ var locales = {
// Get ui localization strings first
glob(poUiDir + '/*', function (err, files) {
if (err) throw new Error(err);
files.forEach(function (file) {
var lang = file.split('/').pop();
var jsFile = path.resolve(file, 'LC_MESSAGES/djangojs.po');
@ -62,18 +63,17 @@ glob(poUiDir + '/*', function (err, files) {
var jsTranslations = po2icu.poFileToICUSync(lang, jsFile);
translations = mergeNewTranslations(translations, jsTranslations, icuWithIds);
} catch (err) {
// :);
process.stdout.write('Warning: the file ' + jsFile + ' was not found\n');
}
try {
var pyTranslations = po2icu.poFileToICUSync(lang, pyFile);
translations = mergeNewTranslations(translations, pyTranslations, icuWithIds);
} catch (err) {
// :);
process.stdout.write('Warning: the file ' + pyFile + ' was not found\n');
}
locales[lang] = translations;
// fs.writeFileSync(icuFile, JSON.stringify(existingTranslations, null, 4));
});
fs.writeFileSync(outputFile, JSON.stringify(locales, null, 4));
});