Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
scratch-www
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
scratch-www
Commits
56787ee0
Commit
56787ee0
authored
Mar 23, 2016
by
Matthew Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add spot check for cards, use new `Page` paradigm
parent
b9030676
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
4 deletions
+40
-4
src/views/cards/cards.jsx
src/views/cards/cards.jsx
+2
-2
src/views/cards/l10n-static.json
src/views/cards/l10n-static.json
+1
-1
src/views/cards/l10n.json
src/views/cards/l10n.json
+1
-1
test/localization/spot_check_cards_has_strings.js
test/localization/spot_check_cards_has_strings.js
+36
-0
No files found.
src/views/cards/cards.jsx
View file @
56787ee0
var
React
=
require
(
'
react
'
);
var
injectIntl
=
require
(
'
react-intl
'
).
injectIntl
;
var
FormattedMessage
=
require
(
'
react-intl
'
).
FormattedMessage
;
var
FormattedHTMLMessage
=
require
(
'
react-intl
'
).
FormattedHTMLMessage
;
var
render
=
require
(
'
../../lib/render.jsx
'
);
var
Box
=
require
(
'
../../components/box/box.jsx
'
);
var
Page
=
require
(
'
../../components/page/page.jsx
'
);
require
(
'
./cards.scss
'
);
...
...
@@ -147,4 +147,4 @@ var Cards = injectIntl(React.createClass({
}
}));
render
(<
Cards
/>,
document
.
getElementById
(
'
view
'
));
render
(<
Page
><
Cards
/></
Page
>,
document
.
getElementById
(
'
app
'
));
src/views/cards/l10n-static.json
View file @
56787ee0
...
...
@@ -5,4 +5,4 @@
"cards.storyLink"
:
"//scratch.mit.edu/scratchr2/static/pdfs/help/StoryCards.pdf"
,
"cards.danceLink"
:
"//scratch.mit.edu/scratchr2/static/pdfs/help/DanceCards.pdf"
,
"cards.hideLink"
:
"//scratch.mit.edu/scratchr2/static/pdfs/help/Hide-and-Seek-Cards.pdf"
}
\ No newline at end of file
}
src/views/cards/l10n.json
View file @
56787ee0
...
...
@@ -10,4 +10,4 @@
"cards.story"
:
"Animate a Story"
,
"cards.dance"
:
"Dance, Dance, Dance"
,
"cards.hide"
:
"Hide and Seek"
}
\ No newline at end of file
}
test/localization/spot_check_cards_has_strings.js
0 → 100644
View file @
56787ee0
/*
* spot check that each language has values for the string id keys on Cards page
* that are contained in English (i.e. make sure strings will show up, not ids")
*/
var
merge
=
require
(
'
lodash.merge
'
);
var
path
=
require
(
'
path
'
);
var
tap
=
require
(
'
tap
'
);
var
languages
=
require
(
'
../../languages.json
'
);
var
localeCompare
=
require
(
'
../../bin/lib/locale-compare
'
);
tap
.
test
(
'
spotCheckAboutStrings
'
,
function
(
t
)
{
var
isoCodes
=
Object
.
keys
(
languages
);
isoCodes
.
splice
(
isoCodes
.
indexOf
(
'
en
'
),
1
);
var
viewLocales
=
{};
var
idsWithICU
=
{};
var
icuWithIds
=
{};
localeCompare
.
getIdsForView
(
'
cards
'
,
path
.
resolve
(
__dirname
,
'
../../src/views/cards/l10n.json
'
),
viewLocales
,
idsWithICU
,
icuWithIds
);
var
md5WithIds
=
localeCompare
.
getMD5Map
(
icuWithIds
);
var
keysToCheck
=
Object
.
keys
(
merge
(
viewLocales
[
'
cards
'
][
'
en
'
])).
sort
();
for
(
var
i
in
isoCodes
)
{
var
translations
=
localeCompare
.
getTranslationsForLanguage
(
isoCodes
[
i
],
idsWithICU
,
md5WithIds
);
t
.
same
(
Object
.
keys
(
translations
[
'
cards
'
][
isoCodes
[
i
]]).
sort
(),
keysToCheck
,
'
check Cards keys for language
'
+
isoCodes
[
i
]
);
}
t
.
end
();
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment