Skip to content

Commit 2655766

Browse files
committed
fix: resolving conflicts
# Conflicts: # app/src/main/java/org/openedx/app/AppRouter.kt # app/src/main/java/org/openedx/app/di/ScreenModule.kt # auth/src/main/java/org/openedx/auth/presentation/signin/SignInFragment.kt # auth/src/main/java/org/openedx/auth/presentation/signin/SignInViewModel.kt # auth/src/main/java/org/openedx/auth/presentation/signin/compose/SignInView.kt # build.gradle # core/src/main/java/org/openedx/core/config/Config.kt # core/src/main/res/values/strings.xml # default_config/prod/config.yaml # default_config/stage/config.yaml
2 parents e32055d + c0e1cfc commit 2655766

File tree

619 files changed

+20718
-8191
lines changed

Some content is hidden

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

619 files changed

+20718
-8191
lines changed

.github/workflows/detekt.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Detekt
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request: { }
6+
7+
env:
8+
GRADLE_OPTS: -Dorg.gradle.daemon=false
9+
CI_GRADLE_ARG_PROPERTIES: --stacktrace
10+
11+
jobs:
12+
linting:
13+
name: Run Detekt
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout Repo
18+
uses: actions/checkout@v4
19+
20+
- name: Setup Java
21+
uses: actions/setup-java@v4
22+
with:
23+
distribution: 'temurin' # See 'Supported distributions' for available options
24+
java-version: '17'
25+
26+
- name: Run Detekt
27+
run: ./gradlew detektAll
28+
29+
- name: Upload report
30+
uses: github/codeql-action/upload-sarif@v3
31+
if: success() || failure()
32+
with:
33+
sarif_file: build/reports/detekt/detekt.sarif

.github/workflows/unit_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
run: ./gradlew testProdDebugUnitTest $CI_GRADLE_ARG_PROPERTIES
4343

4444
- name: Upload reports
45-
uses: actions/upload-artifact@v3
45+
uses: actions/upload-artifact@v4
4646
if: failure()
4747
with:
4848
name: failures
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Validate English strings.xml
2+
3+
on:
4+
pull_request: { }
5+
push:
6+
branches: [ main, develop ]
7+
8+
jobs:
9+
translation_strings:
10+
name: Validate strings.xml
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Use Python
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: 3.11
21+
22+
- name: Install translations requirements
23+
run: make translation_requirements
24+
25+
- name: Validate English plurals in strings.xml
26+
run: make validate_english_plurals
27+
28+
- name: Test extract strings
29+
run: |
30+
make extract_translations
31+
# Ensure the file is extracted
32+
test -f i18n/src/main/res/values/strings.xml

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,6 @@ local.properties
1616
/.idea/
1717
*.log
1818
/config_settings.yaml
19+
.venv/
20+
i18n/
21+
**/values-*/strings.xml

Documentation/ConfigurationManagement.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ TOKEN_TYPE: "JWT"
4949

5050
FIREBASE:
5151
ENABLED: false
52-
ANALYTICS_SOURCE: ''
5352
CLOUD_MESSAGING_ENABLED: false
5453
PROJECT_NUMBER: ''
5554
PROJECT_ID: ''
@@ -82,14 +81,14 @@ android:
8281
- **Facebook:** Sign in and Sign up via Facebook
8382
- **Branch:** Deeplinks
8483
- **Braze:** Cloud Messaging
85-
- **SegmentIO:** Analytics
8684

8785
## Available Feature Flags
8886
- **PRE_LOGIN_EXPERIENCE_ENABLED:** Enables the pre login courses discovery experience.
8987
- **WHATS_NEW_ENABLED:** Enables the "What's New" feature to present the latest changes to the user.
9088
- **SOCIAL_AUTH_ENABLED:** Enables SSO buttons on the SignIn and SignUp screens.
91-
- **COURSE_NESTED_LIST_ENABLED:** Enables an alternative visual representation for the course structure.
92-
- **COURSE_UNIT_PROGRESS_ENABLED:** Enables the display of the unit progress within the courseware.
89+
- **COURSE_DROPDOWN_NAVIGATION_ENABLED:** Enables an alternative navigation through units.
90+
- **COURSE_UNIT_PROGRESS_ENABLED:** Enables the display of the unit progress within the courseware.
91+
- **REGISTRATION_ENABLED:** Enables user registration from the app.
9392

9493
## Future Support
9594
- To add config related to some other service, create a class, e.g. `ServiceNameConfig.kt`, to be able to populate related fields.

Makefile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
clean_translations_temp_directory:
2+
rm -rf i18n/
3+
4+
translation_requirements:
5+
pip3 install -r i18n_scripts/requirements.txt
6+
7+
pull_translations: clean_translations_temp_directory
8+
atlas pull $(ATLAS_OPTIONS) translations/openedx-app-android/i18n:i18n
9+
python3 i18n_scripts/translation.py --split --replace-underscore
10+
11+
extract_translations: clean_translations_temp_directory
12+
python3 i18n_scripts/translation.py --combine
13+
14+
validate_english_plurals:
15+
@if git grep 'quantity' -- '**/res/values/strings.xml' | grep -E 'quantity=.(zero|two|few|many)'; then \
16+
echo ""; \
17+
echo ""; \
18+
echo "Error: Found invalid plurals in the files listed above."; \
19+
echo " Please only use 'one' and 'other' in English strings.xml files,"; \
20+
echo " otherwise Transifex fails to parse them."; \
21+
echo ""; \
22+
exit 1; \
23+
else \
24+
echo "strings.xml files are valid."; \
25+
fi

README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,48 @@ Modern vision of the mobile application for the Open edX platform from Raccoon G
2020

2121
6. Click the **Run** button.
2222

23+
## Translations
24+
25+
### Getting Translations for the App
26+
Translations aren't included in the source code of this repository as of [OEP-58](https://docs.openedx.org/en/latest/developers/concepts/oep58.html). Therefore, they need to be pulled before testing or publishing to App Store.
27+
28+
Before retrieving the translations for the app, we need to install the requirements listed in the requirements.txt file located in the i18n_scripts directory. This can be done easily by running the following make command:
29+
```bash
30+
make translation_requirements
31+
```
32+
33+
Then, to get the latest translations for all languages use the following command:
34+
```bash
35+
make pull_translations
36+
```
37+
This command runs [`atlas pull`](https://github.com/openedx/openedx-atlas) to download the latest translations files from the [openedx/openedx-translations](https://github.com/openedx/openedx-translations) repository. These files contain the latest translations for all languages. In the [openedx/openedx-translations](https://github.com/openedx/openedx-translations) repository each language's translations are saved as a single file e.g. `i18n/src/main/res/values-uk/strings.xml` ([example](https://github.com/openedx/openedx-translations/blob/04ccea36b8e6a9889646dfb5a5acb99686fa9ae0/translations/openedx-app-android/i18n/src/main/res/values-uk/strings.xml)). After these are pulled, each language's translation file is split into the App's modules e.g. `auth/src/main/res/values-uk/strings.xml`.
38+
39+
After this command is run the application can load the translations by changing the device (or the emulator) language in the settings.
40+
41+
### Using Custom Translations
42+
43+
By default, the command `make pull_translations` runs [`atlas pull`](https://github.com/openedx/openedx-atlas) with no arguments which pulls translations from the [openedx-translations repository](https://github.com/openedx/openedx-translations).
44+
45+
You can use custom translations on your fork of the openedx-translations repository by setting the following configuration parameters:
46+
47+
- `--revision` (default: `"main"`): Branch or git tag to pull translations from.
48+
- `--repository` (default: `"openedx/openedx-translations"`): GitHub repository slug. There's a feature request to [support GitLab and other providers](https://github.com/openedx/openedx-atlas/issues/20).
49+
50+
Arguments can be passed via the `ATLAS_OPTIONS` environment variable as shown below:
51+
``` bash
52+
make ATLAS_OPTIONS='--repository=<your-github-org>/<repository-name> --revision=<branch-name>' pull_translations
53+
```
54+
Additional arguments can be passed to `atlas pull`. Refer to the [atlas documentations ](https://github.com/openedx/openedx-atlas) for more information.
55+
56+
### How to Translate the App
57+
58+
Translations are managed in the [open-edx/openedx-translations](https://app.transifex.com/open-edx/openedx-translations/dashboard/) Transifex project.
59+
60+
To translate the app join the [Transifex project](https://app.transifex.com/open-edx/openedx-translations/dashboard/) and add your translations to the
61+
[`openedx-app-android`](https://app.transifex.com/open-edx/openedx-translations/openedx-app-android/) resource.
62+
63+
Once the resource is both 100% translated and reviewed the [Transifex integration](https://github.com/apps/transifex-integration) will automatically push it to the [openedx-translations](https://github.com/openedx/openedx-translations) repository and developers can use the translations in their app.
64+
2365
## API
2466
This project targets on the latest Open edX release and rely on the relevant mobile APIs.
2567

app/build.gradle

Lines changed: 16 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
def config = configHelper.fetchConfig()
22
def appId = config.getOrDefault("APPLICATION_ID", "org.openedx.app")
3-
def platformName = config.getOrDefault("PLATFORM_NAME", "OpenEdx").toLowerCase()
3+
def themeDirectory = config.getOrDefault("THEME_DIRECTORY", "openedx")
44
def firebaseConfig = config.get('FIREBASE')
55
def firebaseEnabled = firebaseConfig?.getOrDefault('ENABLED', false)
66

77
apply plugin: 'com.android.application'
88
apply plugin: 'org.jetbrains.kotlin.android'
99
apply plugin: 'kotlin-parcelize'
10-
apply plugin: 'kotlin-kapt'
10+
apply plugin: 'com.google.devtools.ksp'
11+
apply plugin: 'org.jetbrains.kotlin.plugin.compose'
12+
1113
if (firebaseEnabled) {
1214
apply plugin: 'com.google.gms.google-services'
1315
apply plugin: 'com.google.firebase.crashlytics'
@@ -63,13 +65,13 @@ android {
6365

6466
sourceSets {
6567
prod {
66-
res.srcDirs = ["src/$platformName/res"]
68+
res.srcDirs = ["src/$themeDirectory/res"]
6769
}
6870
develop {
69-
res.srcDirs = ["src/$platformName/res"]
71+
res.srcDirs = ["src/$themeDirectory/res"]
7072
}
7173
stage {
72-
res.srcDirs = ["src/$platformName/res"]
74+
res.srcDirs = ["src/$themeDirectory/res"]
7375
}
7476
}
7577

@@ -91,15 +93,13 @@ android {
9193
}
9294
kotlinOptions {
9395
jvmTarget = JavaVersion.VERSION_17
96+
freeCompilerArgs = List.of("-Xstring-concat=inline")
9497
}
9598
buildFeatures {
9699
viewBinding true
97100
compose true
98101
buildConfig true
99102
}
100-
composeOptions {
101-
kotlinCompilerExtensionVersion = "$compose_compiler_version"
102-
}
103103
bundle {
104104
language {
105105
enableSplit = false
@@ -126,34 +126,24 @@ dependencies {
126126
implementation project(path: ':discussion')
127127
implementation project(path: ':whatsnew')
128128

129-
kapt "androidx.room:room-compiler:$room_version"
129+
ksp "androidx.room:room-compiler:$room_version"
130130

131131
implementation 'androidx.core:core-splashscreen:1.0.1'
132132

133-
// Segment Library
134-
implementation "com.segment.analytics.kotlin:android:1.14.2"
135-
// Segment's Firebase integration
136-
implementation 'com.segment.analytics.kotlin.destinations:firebase:1.5.2'
133+
api platform("com.google.firebase:firebase-bom:$firebase_version")
134+
api "com.google.firebase:firebase-messaging"
135+
137136
// Braze SDK Integration
138-
implementation "com.braze:braze-segment-kotlin:1.4.2"
139137
implementation "com.braze:android-sdk-ui:30.2.0"
140138

141-
// Firebase Cloud Messaging Integration for Braze
142-
implementation 'com.google.firebase:firebase-messaging-ktx:23.4.1'
143-
144-
// Branch SDK Integration
145-
implementation 'io.branch.sdk.android:library:5.9.0'
146-
implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1'
147-
implementation "com.android.installreferrer:installreferrer:2.2"
139+
// Plugins
140+
implementation("com.github.openedx:openedx-app-firebase-analytics-android:1.0.0")
148141

149-
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
150-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
151-
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
152-
debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_version"
142+
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
143+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
153144
testImplementation "junit:junit:$junit_version"
154145
testImplementation "io.mockk:mockk:$mockk_version"
155146
testImplementation "io.mockk:mockk-android:$mockk_version"
156-
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutines_version"
157147
testImplementation "androidx.arch.core:core-testing:$android_arch_version"
158148
}
159149

0 commit comments

Comments
 (0)