Skip to content

Commit 65610ec

Browse files
authored
Merge pull request #6 from eduNEXT/main.v2
feat: improve internationalization (i18n) workflows, user interface messages, and profile field handling
2 parents 6bc9efb + ca50b5a commit 65610ec

55 files changed

Lines changed: 2436 additions & 7 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ npm-debug.log
66
coverage
77
module.config.js
88

9-
dist/
109
src/i18n/transifex_input.json
1110
temp/babel-plugin-react-intl
1211

Makefile

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
transifex_utils = ./node_modules/.bin/transifex-utils.js
2+
i18n = ./src/i18n
3+
transifex_input = $(i18n)/transifex_input.json
4+
5+
# This directory must match .babelrc .
6+
transifex_temp = ./temp/babel-plugin-formatjs
7+
18
precommit:
29
npm run lint
310
npm audit
@@ -13,3 +20,28 @@ build:
1320
cp ./package.json ./dist/package.json
1421
cp ./LICENSE ./dist/LICENSE
1522
cp ./README.md ./dist/README.md
23+
24+
requirements:
25+
npm ci
26+
27+
i18n.extract:
28+
# Pulling display strings from .jsx files into .json files...
29+
rm -rf $(transifex_temp)
30+
npm run-script i18n_extract
31+
32+
i18n.concat:
33+
# Gathering JSON messages into one file...
34+
$(transifex_utils) $(transifex_temp) $(transifex_input)
35+
36+
extract_translations: | requirements i18n.extract i18n.concat
37+
38+
# Despite the name, we actually need this target to detect changes in the incoming translated message files as well.
39+
detect_changed_source_translations:
40+
# Checking for changed translations...
41+
git diff --exit-code $(i18n)
42+
43+
44+
# This target is used by Travis.
45+
validate-no-uncommitted-package-lock-changes:
46+
# Checking for package-lock.json changes...
47+
git diff --exit-code package-lock.json

dist/LICENSE

Lines changed: 661 additions & 0 deletions
Large diffs are not rendered by default.

dist/README.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# frontend-slot-footer
2+
3+
This package provides a wrapped version of the lms and studio footer using [Frontend Plugin Framework](https://github.com/openedx/frontend-plugin-framework).
4+
5+
- ### LMS Footer Slot ID: `footer_slot`
6+
- ### Studio Footer Slot ID: `studio_footer_slot`
7+
8+
## Description
9+
10+
The slots are used to replace/modify/hide the footer.
11+
12+
## Example
13+
14+
The following `env.config.jsx` will replace the default footer.
15+
16+
LMS:
17+
18+
![Screenshot of Default LMS Footer](./docs/images/default_footer.png)
19+
20+
Studio:
21+
22+
![Screenshot of Default Studio Footer](./docs/images/default_studio_footer.png)
23+
with a simple custom footer
24+
25+
![Screenshot of Custom Footer](./docs/images/custom_footer.png)
26+
27+
```js
28+
import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';
29+
30+
const config = {
31+
pluginSlots: {
32+
// For authoring MFE, replace footer_slot with studio_footer_slot
33+
footer_slot: {
34+
plugins: [
35+
{
36+
// Hide the default footer
37+
op: PLUGIN_OPERATIONS.Hide,
38+
widgetId: 'default_contents',
39+
},
40+
{
41+
// Insert a custom footer
42+
op: PLUGIN_OPERATIONS.Insert,
43+
widget: {
44+
id: 'custom_footer',
45+
type: DIRECT_PLUGIN,
46+
RenderWidget: () => (
47+
<h1 style={{textAlign: 'center'}}>🦶</h1>
48+
),
49+
},
50+
},
51+
]
52+
}
53+
},
54+
}
55+
56+
export default config;
57+
```

dist/extended-profile/ExtendedProfileContext.js

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/extended-profile/ExtendedProfileContext.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/extended-profile/ExtendedProfileProvider.js

Lines changed: 98 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/extended-profile/ExtendedProfileProvider.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)