Skip to content

Commit

Permalink
Merge pull request #1657 from Infomaniak/fixUseOtherLanguages
Browse files Browse the repository at this point in the history
fix: select the correct language
  • Loading branch information
KevinBoulongne authored Jan 23, 2024
2 parents 05cfddf + ffafd33 commit 44261a4
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ android {
buildConfigField 'String', 'GITHUB_REPO', '"android-mail"'

resValue 'string', 'ATTACHMENTS_AUTHORITY', 'com.infomaniak.mail.attachments'

resourceConfigurations += ["en", "de", "es", "fr", "it"]
}

buildTypes {
Expand All @@ -62,8 +64,6 @@ android {

buildFeatures { viewBinding true }

androidResources { generateLocaleConfig true }

flavorDimensions += 'distribution'

productFlavors {
Expand Down
1 change: 1 addition & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
android:fullBackupContent="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/appName"
android:localeConfig="@xml/locales_config"
android:networkSecurityConfig="@xml/network_security_config"
android:roundIcon="@mipmap/ic_launcher_round"
android:theme="@style/AppTheme.Pink"
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/java/com/infomaniak/mail/ui/LaunchActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.lifecycle.lifecycleScope
import androidx.navigation.NavDeepLinkBuilder
import com.infomaniak.lib.core.extensions.setDefaultLocaleIfNeeded
import com.infomaniak.mail.MatomoMail.trackNotificationActionEvent
import com.infomaniak.mail.MatomoMail.trackUserId
import com.infomaniak.mail.R
Expand Down Expand Up @@ -55,6 +56,8 @@ class LaunchActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

setDefaultLocaleIfNeeded()

handleNotificationDestinationIntent()

lifecycleScope.launch(ioDispatcher) {
Expand Down
24 changes: 24 additions & 0 deletions app/src/main/res/xml/locales_config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ Infomaniak Mail - Android
~ Copyright (C) 2024 Infomaniak Network SA
~
~ This program is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<locale-config xmlns:android="http://schemas.android.com/apk/res/android">
<locale android:name="en" />
<locale android:name="de" />
<locale android:name="es" />
<locale android:name="fr" />
<locale android:name="it" />
</locale-config>

0 comments on commit 44261a4

Please sign in to comment.