Skip to content

Commit

Permalink
Merge pull request #6 from armancodv/persian-version
Browse files Browse the repository at this point in the history
persian version
  • Loading branch information
armancodv authored May 15, 2021
2 parents 5e66c38 + 3af301f commit 8ce3dbd
Show file tree
Hide file tree
Showing 20 changed files with 107 additions and 21 deletions.
4 changes: 4 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ android {
dimension 'default'
applicationId "com.armanco.integral_pro"
}
persian {
dimension 'default'
applicationId "com.armanco.integral_persian"
}
}

}
Expand Down
11 changes: 10 additions & 1 deletion app/src/main/java/com/armanco/integral/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@ package com.armanco.integral
import android.os.Bundle
import android.view.View
import androidx.appcompat.app.AppCompatActivity
import androidx.navigation.findNavController
import androidx.navigation.fragment.NavHostFragment
import androidx.navigation.ui.AppBarConfiguration
import androidx.navigation.ui.setupWithNavController
import com.armanco.integral.extensions.isPersian
import com.armanco.integral.extensions.isPro
import com.armanco.integral.extensions.setLocale
import com.google.android.gms.ads.AdRequest
import com.google.android.gms.ads.MobileAds
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.android.synthetic.main.activity_main.*
import java.util.*

@AndroidEntryPoint
class MainActivity: AppCompatActivity() {
Expand All @@ -23,6 +25,13 @@ class MainActivity: AppCompatActivity() {
initToolbar()
}

override fun onResume() {
super.onResume()
if(isPersian) {
setLocale(Locale("fa"))
}
}

private fun initAdMob() {
MobileAds.initialize(this)
val adRequest = AdRequest.Builder().build()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.armanco.integral.extensions

import android.content.Context
import android.os.Build
import java.util.*

fun Context.setLocale(locale: Locale) {
val configuration = resources.configuration
configuration.setLocale(locale)
Locale.setDefault(locale)
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.N) {
createConfigurationContext(configuration)
}
resources.updateConfiguration(configuration, resources.displayMetrics)
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,12 @@ val isPro: Boolean
"pro" -> true
else -> false
}
}

val isPersian: Boolean
get() {
return when (BuildConfig.FLAVOR) {
"persian" -> true
else -> false
}
}
2 changes: 1 addition & 1 deletion app/src/main/res/values-ar/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Integral</string>
<string name="app_name">متكامل</string>
<string name="function">دور</string>
<string name="lower_limit">الحد الأدنى (a)</string>
<string name="upper_limit">الحد الأعلى (b)</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-bn/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Integral</string>
<string name="app_name">ইন্টিগ্রাল</string>
<string name="function">ফাংশন</string>
<string name="lower_limit">নিম্ন সীমা (a)</string>
<string name="upper_limit">উচ্চ সীমা (b)</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-da/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Integral</string>
<string name="app_name">Integreret</string>
<string name="category_1">Rationel</string>
<string name="category_2">Eksponentiel</string>
<string name="category_3">Logaritmer</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-fa/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Integral</string>
<string name="app_name">انتگرال</string>
<string name="function">تابع</string>
<string name="lower_limit">حد پایین (a)</string>
<string name="upper_limit">حد بالا (b)</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Integral</string>
<string name="app_name">Intégral</string>
<string name="category_1">Rationnelles</string>
<string name="category_2">Exponentielles</string>
<string name="category_3">Logarithmes</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-hi/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Integral</string>
<string name="app_name">अविभाज्य</string>
<string name="function">समारोह</string>
<string name="lower_limit">निचली सीमा (a)</string>
<string name="upper_limit">ऊपरी सीमा (b)</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-it/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Integral</string>
<string name="app_name">Integrante</string>
<string name="category_1">Razionali</string>
<string name="category_2">Esponenziali</string>
<string name="category_3">Logaritmi</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-ja/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Integral</string>
<string name="app_name">積分</string>
<string name="function">関数</string>
<string name="lower_limit">下限(a)</string>
<string name="upper_limit">上限(b)</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-ko/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Integral</string>
<string name="app_name">완전한</string>
<string name="function">함수</string>
<string name="lower_limit">하한 (a)</string>
<string name="upper_limit">상한선 (b)</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-pt/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Integral</string>
<string name="app_name">Integrante</string>
<string name="function">Função</string>
<string name="lower_limit">Limite inferior (a)</string>
<string name="upper_limit">Limite Superior (b)</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Integral</string>
<string name="app_name">интеграл</string>
<string name="function">Функция</string>
<string name="lower_limit">Нижний предел (а)</string>
<string name="upper_limit">Верхний предел (б)</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-tr/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Integral</string>
<string name="app_name">İntegral</string>
<string name="function">Fonksiyon</string>
<string name="lower_limit">Alt Sınır (a)</string>
<string name="upper_limit">Üst Limit (b)</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-ur/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Integral</string>
<string name="app_name">لازمی</string>
<string name="category_1">عقلی</string>
<string name="category_2">گستاخانہ</string>
<string name="category_3">لوگرتھمز</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-zh/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Integral</string>
<string name="app_name">不可缺少的</string>
<string name="function">功能</string>
<string name="lower_limit">下限(a)</string>
<string name="upper_limit">上限(b)</string>
Expand Down
50 changes: 49 additions & 1 deletion fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ platform :android do
)
end

desc "Submit a new Internal Test"
desc "Submit a new Internal Test (PRO)"
lane :internal_pro do
validate_play_store_json_key(
json_key: ENV['JSON_PATH']
Expand All @@ -118,6 +118,54 @@ platform :android do
)
end

desc "Deploy a new version to the Google Play (PERSIAN)"
lane :deploy_persian do
validate_play_store_json_key(
json_key: ENV['JSON_PATH']
)
gradle(task: "test")
gradle(
task: 'assemblePersianRelease',
properties: {
"android.injected.signing.store.file" => ENV['KEYSTORE_PATH'],
"android.injected.signing.store.password" => ENV['STORE_PASSWORD'],
"android.injected.signing.key.alias" => ENV['KEY_ALIAS'],
"android.injected.signing.key.password" => ENV['KEY_PASSWORD'],
}
)
upload_to_play_store(
package_name: 'com.armanco.integral_persian',
track: 'production',
apk: ENV['APK_PATH_PERSIAN'],
json_key: ENV['JSON_PATH'],
skip_upload_aab: true
)
end

desc "Submit a new Internal Test (PERSIAN)"
lane :internal_persian do
validate_play_store_json_key(
json_key: ENV['JSON_PATH']
)
gradle(task: "test")
gradle(
task: 'assemblePersianRelease',
properties: {
"android.injected.signing.store.file" => ENV['KEYSTORE_PATH'],
"android.injected.signing.store.password" => ENV['STORE_PASSWORD'],
"android.injected.signing.key.alias" => ENV['KEY_ALIAS'],
"android.injected.signing.key.password" => ENV['KEY_PASSWORD'],
}
)
upload_to_play_store(
package_name: 'com.armanco.integral_persian',
track: 'internal',
apk: ENV['APK_PATH_PERSIAN'],
json_key: ENV['JSON_PATH'],
skip_upload_aab: true
)
end

desc "Build debug and test APK for screenshots"
lane :screenshots do
build_android_app(
Expand Down
12 changes: 7 additions & 5 deletions fastlane/report.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,29 @@



<testcase classname="fastlane.lanes" name="0: default_platform" time="0.000369">
<testcase classname="fastlane.lanes" name="0: default_platform" time="0.000426">

</testcase>


<testcase classname="fastlane.lanes" name="1: validate_play_store_json_key" time="0.125023">
<testcase classname="fastlane.lanes" name="1: validate_play_store_json_key" time="0.113986">

</testcase>


<testcase classname="fastlane.lanes" name="2: test" time="44.471435">
<testcase classname="fastlane.lanes" name="2: test" time="4.637583">

</testcase>


<testcase classname="fastlane.lanes" name="3: assembleProRelease" time="17.004816">
<testcase classname="fastlane.lanes" name="3: assembleProRelease" time="6.533162">

</testcase>


<testcase classname="fastlane.lanes" name="4: upload_to_play_store" time="318.299384">
<testcase classname="fastlane.lanes" name="4: upload_to_play_store" time="15.875603">

<failure message="/usr/local/Cellar/fastlane/2.182.0/libexec/gems/fastlane-2.182.0/fastlane/lib/fastlane/actions/actions_helper.rb:67:in `execute_action'&#10;/usr/local/Cellar/fastlane/2.182.0/libexec/gems/fastlane-2.182.0/fastlane/lib/fastlane/runner.rb:255:in `block in execute_action'&#10;/usr/local/Cellar/fastlane/2.182.0/libexec/gems/fastlane-2.182.0/fastlane/lib/fastlane/runner.rb:229:in `chdir'&#10;/usr/local/Cellar/fastlane/2.182.0/libexec/gems/fastlane-2.182.0/fastlane/lib/fastlane/runner.rb:229:in `execute_action'&#10;/usr/local/Cellar/fastlane/2.182.0/libexec/gems/fastlane-2.182.0/fastlane/lib/fastlane/runner.rb:157:in `trigger_action_by_name'&#10;/usr/local/Cellar/fastlane/2.182.0/libexec/gems/fastlane-2.182.0/fastlane/lib/fastlane/fast_file.rb:159:in `method_missing'&#10;Fastfile:88:in `block (2 levels) in parsing_binding'&#10;/usr/local/Cellar/fastlane/2.182.0/libexec/gems/fastlane-2.182.0/fastlane/lib/fastlane/lane.rb:33:in `call'&#10;/usr/local/Cellar/fastlane/2.182.0/libexec/gems/fastlane-2.182.0/fastlane/lib/fastlane/runner.rb:49:in `block in execute'&#10;/usr/local/Cellar/fastlane/2.182.0/libexec/gems/fastlane-2.182.0/fastlane/lib/fastlane/runner.rb:45:in `chdir'&#10;/usr/local/Cellar/fastlane/2.182.0/libexec/gems/fastlane-2.182.0/fastlane/lib/fastlane/runner.rb:45:in `execute'&#10;/usr/local/Cellar/fastlane/2.182.0/libexec/gems/fastlane-2.182.0/fastlane/lib/fastlane/lane_manager.rb:47:in `cruise_lane'&#10;/usr/local/Cellar/fastlane/2.182.0/libexec/gems/fastlane-2.182.0/fastlane/lib/fastlane/command_line_handler.rb:36:in `handle'&#10;/usr/local/Cellar/fastlane/2.182.0/libexec/gems/fastlane-2.182.0/fastlane/lib/fastlane/commands_generator.rb:109:in `block (2 levels) in run'&#10;/usr/local/Cellar/fastlane/2.182.0/libexec/gems/commander-4.6.0/lib/commander/command.rb:187:in `call'&#10;/usr/local/Cellar/fastlane/2.182.0/libexec/gems/commander-4.6.0/lib/commander/command.rb:157:in `run'&#10;/usr/local/Cellar/fastlane/2.182.0/libexec/gems/commander-4.6.0/lib/commander/runner.rb:444:in `run_active_command'&#10;/usr/local/Cellar/fastlane/2.182.0/libexec/gems/fastlane-2.182.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:76:in `run!'&#10;/usr/local/Cellar/fastlane/2.182.0/libexec/gems/commander-4.6.0/lib/commander/delegates.rb:18:in `run!'&#10;/usr/local/Cellar/fastlane/2.182.0/libexec/gems/fastlane-2.182.0/fastlane/lib/fastlane/commands_generator.rb:353:in `run'&#10;/usr/local/Cellar/fastlane/2.182.0/libexec/gems/fastlane-2.182.0/fastlane/lib/fastlane/commands_generator.rb:42:in `start'&#10;/usr/local/Cellar/fastlane/2.182.0/libexec/gems/fastlane-2.182.0/fastlane/lib/fastlane/cli_tools_distributor.rb:122:in `take_off'&#10;/usr/local/Cellar/fastlane/2.182.0/libexec/gems/fastlane-2.182.0/bin/fastlane:23:in `&lt;top (required)&gt;'&#10;/usr/local/Cellar/fastlane/2.182.0/libexec/bin/fastlane:23:in `load'&#10;/usr/local/Cellar/fastlane/2.182.0/libexec/bin/fastlane:23:in `&lt;main&gt;'&#10;&#10;Google Api Error: forbidden: Cannot update a published APK. - Cannot update a published APK." />

</testcase>

Expand Down

0 comments on commit 8ce3dbd

Please sign in to comment.