This repository has been archived by the owner on Aug 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from openedx/feature/NOVA-136
feat: add i18n to app
- Loading branch information
Showing
24 changed files
with
373 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[main] | ||
host = https://www.transifex.com | ||
|
||
[o:open-edx:p:edx-platform:r:frontend-component-ai-translations] | ||
file_filter = src/i18n/messages/<lang>.json | ||
source_file = src/i18n/transifex_input.json | ||
source_lang = en | ||
type = KEYVALUEJSON |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { messages as paragonMessages } from '@edx/paragon'; | ||
import arMessages from './messages/ar.json'; | ||
import frMessages from './messages/fr.json'; | ||
import es419Messages from './messages/es_419.json'; | ||
import zhcnMessages from './messages/zh_CN.json'; | ||
import ptMessages from './messages/pt.json'; | ||
import itMessages from './messages/it.json'; | ||
import ukMessages from './messages/uk.json'; | ||
import deMessages from './messages/de.json'; | ||
import ruMessages from './messages/ru.json'; | ||
import hiMessages from './messages/hi.json'; | ||
import frCAMessages from './messages/fr_CA.json'; | ||
import dedeMessages from './messages/de_DE.json'; | ||
import ititMessages from './messages/it_IT.json'; | ||
import ptptMessages from './messages/pt_PT.json'; | ||
// no need to import en messages-- they are in the defaultMessage field | ||
|
||
const appMessages = { | ||
ar: arMessages, | ||
'es-419': es419Messages, | ||
fr: frMessages, | ||
'zh-cn': zhcnMessages, | ||
pt: ptMessages, | ||
it: itMessages, | ||
de: deMessages, | ||
hi: hiMessages, | ||
'fr-ca': frCAMessages, | ||
ru: ruMessages, | ||
uk: ukMessages, | ||
'de-de': dedeMessages, | ||
'it-it': ititMessages, | ||
'pt-pt': ptptMessages, | ||
}; | ||
|
||
export default [ | ||
paragonMessages, | ||
appMessages, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import messages from './index'; | ||
|
||
describe('messages', () => { | ||
it('contains app messages', () => { | ||
expect(messages.length).toEqual(2); | ||
const appMessages = messages[1]; | ||
const languages = Object.getOwnPropertyNames(appMessages); | ||
expect(languages).toContainEqual('ar'); | ||
expect(languages).toContainEqual('es-419'); | ||
expect(languages).toContainEqual('fr'); | ||
expect(languages).toContainEqual('zh-cn'); | ||
expect(languages).toContainEqual('pt'); | ||
expect(languages).toContainEqual('it'); | ||
expect(languages).toContainEqual('de'); | ||
expect(languages).toContainEqual('hi'); | ||
expect(languages).toContainEqual('fr-ca'); | ||
expect(languages).toContainEqual('ru'); | ||
expect(languages).toContainEqual('uk'); | ||
expect(languages).toContainEqual('de-de'); | ||
expect(languages).toContainEqual('it-it'); | ||
expect(languages).toContainEqual('pt-pt'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { defineMessages } from '@edx/frontend-platform/i18n'; | ||
|
||
const messages = defineMessages({ | ||
getFreeTranslations: { | ||
id: 'ai-translations.request.heading.top', | ||
defaultMessage: 'Get free translations', | ||
description: 'Translations heading available', | ||
}, | ||
translationsNotAvailable: { | ||
id: 'ai-translations.request.heading.bottom', | ||
defaultMessage: 'Translations service is not available', | ||
description: 'Translations heading not available', | ||
}, | ||
backButtonAlt: { | ||
id: 'ai-translations.icon.button.back.alt', | ||
defaultMessage: 'Back button to main transcript settings view', | ||
description: 'alt text for back icon button', | ||
}, | ||
closeButtonAlt: { | ||
id: 'ai-translations.icon.button.close.alt', | ||
defaultMessage: 'Close settings', | ||
description: 'alt text for close settings icon button', | ||
}, | ||
}); | ||
|
||
export default messages; |